Optimizations - Programmer vs. Compiler?
Saravana Kannan asks: "I have been coding in C for a while (10 yrs or so) and tend to use short code snippets. As a simple example, take 'if (!ptr)' instead of 'if (ptr==NULL)'. The reason someone might use the former code snippet is because they believe it would result in smaller machine code if the compiler does not do optimizations or is not smart enough to optimize the particular code snippet. IMHO the latter code snippet is clearer than the former, and I would use it in my code if I know for sure that the compiler will optimize it and produce machine code equivalent to the former code snippet. The previous example was easy. What about code that is more complex? Now that compilers have matured over years and have had many improvements, I ask the Slashdot crowd, what they believe the compiler can be trusted to optimize and what must be hand optimized?"
"How would your answer differ (in terms of the level of trust on the compiler) if I'm talking about compilers for Desktops vs. Embedded systems? Compilers for which of the following platforms do you think is more optimized at present - Desktops (because is more commonly used) or Embedded systems (because of need for maximum optimization)? Would be better if you could stick to free (as in beer) and Open Source compilers. Give examples of code optimizations that you think the compiler can/can't be trusted to do."
So, did working at RIM teach you to put a fixed timeout on the time it takes to complete a mail fetch operation even for protocols that report mail message size and hence allow you to _estimate_ how long it will take? By the way if you do not understand what timeout I am talking about it is the 150s limit to fetch in the RIM server software. The retarded piece of garbageware always cuts the connection regardless of data transfered after 150s and aborts all data. That is even for IMAP which allows partial fetch per part and has already given you full size and header information. Classic example of HOW NOT TO DO NETWORK PROGRAMMING
So did working at the RIM teach you to add the Sender header field to the reply-to mail recipients when a user hits Reply-to-All? Where exactly it is in the RFC822 that the sender is anything and you have to reply to him as well when replying to mail? And if you do not understand to what it leads here is a classic example of one of my least favourite politicians telling BBC to fuck off. http://news.bbc.co.uk/1/hi/uk_politics/4247237.stm Good advertisement for RIM by the way
Or it is just the usual Retarded in Motion attitude of "We invented the email, the Internet and everything around it". At least this is the answer I am getting every time I try to file these as bugs. The answer is "our software is working correctly and shall not be changed".
It is nice that you talk about better code, but frankly you got the wrong company to present as an example. Because in order to produce good code you have to honour and understand the protocols and the specs you deal with and RIM is one of the most profound examples of people who do not.
Baker's Law: Misery no longer loves company. Nowadays it insists on it
http://www.sigsegv.cx/