Sometimes you see the C# code like this:
if(isValid()) {
return true;
}
else {
return false;
}
or even "better":
return (isValid()? true : false);
I always wondered why not just write the code like this:
return isValid()
Is the reason is that some of the younger developers don't have any background in C, C++ or any languages where the conditional statements return int, not bool? It is psychologically difficult for them to accept Boolean as the first class citizen - data type. For them Boolean cannot be separated from the if statements or "?" operator. Am I correct? What is your opinion?
Wednesday, April 15, 2009
Tuesday, April 14, 2009
JavaFx installation
Oddly enough it did not prompt me to download and install JavaFx, it just showed me the small icon. When I clicked on the icon it prompted me to download the latest Java, and after 6 minutes (on high-speed connection) and two browser restarts I've got it up and running.
Monday, April 06, 2009
Fixing Outlook annoyancies
If a message comes as plain text, Outlook will use plain text format to reply to this message. As a result the signature gets messed up, etc. This article shows how to overcome this limitations. A simple macro can convert a received email from plain text to html:
Sub ConvertMessage()
Dim oMailItem As MailItem
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
oMailItem.BodyFormat = olFormatHTML
'oMailItem.HTMLBody = oMailItem.Body
oMailItem.Close (olSave)
Set oMailItem = Nothing
End Sub
I commented out one of the lines because it works better for me this way.
Sub ConvertMessage()
Dim oMailItem As MailItem
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
oMailItem.BodyFormat = olFormatHTML
'oMailItem.HTMLBody = oMailItem.Body
oMailItem.Close (olSave)
Set oMailItem = Nothing
End Sub
I commented out one of the lines because it works better for me this way.
Subscribe to:
Posts (Atom)