Comments on: 5 Principles For Programming http://empathybox.com/archives/8 living la vida obscura Thu, 28 Aug 2008 23:50:40 +0000 http://wordpress.org/?v=2.2.2 By: bugfox blog » Blog Archive » 5 Principles For Programming http://empathybox.com/archives/8#comment-45 bugfox blog » Blog Archive » 5 Principles For Programming Fri, 20 Oct 2006 14:42:43 +0000 http://empathybox.com/archives/8#comment-45 [...] Simple but deep: Empathy Box :: 5 Principles For Programming [...] […] Simple but deep: Empathy Box :: 5 Principles For Programming […]

]]>
By: David House http://empathybox.com/archives/8#comment-44 David House Thu, 19 Oct 2006 15:51:44 +0000 http://empathybox.com/archives/8#comment-44 Really interesting post. I'm a Haskeller myself, so I'm in total accord with things like your advocation of static typing. The last section was probably the most interesting -- I can claim knowledge of a functional programming language, I've read a few papers and am about to start a maths degree, but kernels scare me and my database experience goes about as far as MySQL. :) I think I'll be buying some books. Thanks again. Really interesting post. I’m a Haskeller myself, so I’m in total accord with things like your advocation of static typing. The last section was probably the most interesting — I can claim knowledge of a functional programming language, I’ve read a few papers and am about to start a maths degree, but kernels scare me and my database experience goes about as far as MySQL. :) I think I’ll be buying some books.

Thanks again.

]]>
By: James Watson http://empathybox.com/archives/8#comment-43 James Watson Tue, 17 Oct 2006 16:43:00 +0000 http://empathybox.com/archives/8#comment-43 "I feel that unless a member needs to be non-final, it should be non-final." That should read: I feel that unless a member needs to be non-final, it should be final. “I feel that unless a member needs to be non-final, it should be non-final.”

That should read:

I feel that unless a member needs to be non-final, it should be final.

]]>
By: James Watson http://empathybox.com/archives/8#comment-42 James Watson Tue, 17 Oct 2006 16:40:01 +0000 http://empathybox.com/archives/8#comment-42 The points about state are very good to point out as they are often unknown/ignored in the Java universe. I feel that unless a member needs to be non-final, it should be non-final. I wish the compiler would follow method calls in the constructor to check for initializing finals, though. Another technique is to use stateful objects that never escape the stack. There is no concurrency issues with this and in fact, future versions of Java will (if all goes well) actually create such Objects on the stack or even extract their members onto the stack. But again, I completely agree with reducting state to the absolute minimum. If you do so, it will be much easier to refactor code to be threadsafe if needed in the future. The points about state are very good to point out as they are often unknown/ignored in the Java universe. I feel that unless a member needs to be non-final, it should be non-final. I wish the compiler would follow method calls in the constructor to check for initializing finals, though.

Another technique is to use stateful objects that never escape the stack. There is no concurrency issues with this and in fact, future versions of Java will (if all goes well) actually create such Objects on the stack or even extract their members onto the stack.

But again, I completely agree with reducting state to the absolute minimum. If you do so, it will be much easier to refactor code to be threadsafe if needed in the future.

]]>
By: jay http://empathybox.com/archives/8#comment-39 jay Tue, 17 Oct 2006 07:21:32 +0000 http://empathybox.com/archives/8#comment-39 Brian--I agree that it is Occam's razor, although I don't think that Occam's razor really <i>explains</i> much of anything, it is just the observation that simple things are more likely. I actually had substantially more about this, and talked about Occam's Razor and MDL explicitly, but then I realized it would work better as a seperate entry. John--Yes but those numbers are for a page performing well. The poorly performing page is usually from the db. It is hard to spend a lot of time in a JSP and not notice it. Thomas--you are totally correct. Thank you for catching that. The Goetz book I mentioned before gives the conditions for immutability nicely, stating that an object is immutable if 1. Its state cannot be modified after construction. 2. All its fields are final and 3. It is properly constructed (the this reference does not escape during construction). Brian–I agree that it is Occam’s razor, although I don’t think that Occam’s razor really explains much of anything, it is just the observation that simple things are more likely. I actually had substantially more about this, and talked about Occam’s Razor and MDL explicitly, but then I realized it would work better as a seperate entry.

John–Yes but those numbers are for a page performing well. The poorly performing page is usually from the db. It is hard to spend a lot of time in a JSP and not notice it.

Thomas–you are totally correct. Thank you for catching that. The Goetz book I mentioned before gives the conditions for immutability nicely, stating that an object is immutable if
1. Its state cannot be modified after construction.
2. All its fields are final and
3. It is properly constructed (the this reference does not escape during construction).

]]>
By: jarred http://empathybox.com/archives/8#comment-38 jarred Tue, 17 Oct 2006 01:57:44 +0000 http://empathybox.com/archives/8#comment-38 <strong>编程的六个原则(翻译)...</strong> 编程的六个原则... 编程的六个原则(翻译)…

编程的六个原则…

]]>
By: Mike http://empathybox.com/archives/8#comment-37 Mike Mon, 16 Oct 2006 23:44:17 +0000 http://empathybox.com/archives/8#comment-37 On "Fail Fast", that's one thing I really loved about my limited time I was forced to use Standard ML in a CS class -- serious compile-time type checking catches so many silly little bugs early. On “Fail Fast”, that’s one thing I really loved about my limited time I was forced to use Standard ML in a CS class — serious compile-time type checking catches so many silly little bugs early.

]]>
By: John http://empathybox.com/archives/8#comment-36 John Mon, 16 Oct 2006 23:14:56 +0000 http://empathybox.com/archives/8#comment-36 "Web programmers know that all performance problems come from the database." Using a profiler, I found that only ten percent of the total time to display a JSP in my J2EE application was spent querying the database and building persistent objects. The other 90% was spent on in-memory operations required to render the page. This is a commercial application that was built using industry best practices by ten of the best software developers I have ever worked with. I have seen bad developers waste a lot of resources optimizing the wrong code. The 7th principle - forget everything you think you know about performance bottlenecks. “Web programmers know that all performance problems come from the database.”

Using a profiler, I found that only ten percent of the total time to display a JSP in my J2EE application was spent querying the database and building persistent objects. The other 90% was spent on in-memory operations required to render the page. This is a commercial application that was built using industry best practices by ten of the best software developers I have ever worked with.

I have seen bad developers waste a lot of resources optimizing the wrong code. The 7th principle - forget everything you think you know about performance bottlenecks.

]]>
By: links for 2006-10-16 « Ashish Kulkarni’s Journal http://empathybox.com/archives/8#comment-35 links for 2006-10-16 « Ashish Kulkarni’s Journal Mon, 16 Oct 2006 22:23:11 +0000 http://empathybox.com/archives/8#comment-35 [...] 5 Principles For Programming “since nobody seems to know very much about making good software, it makes sense to try to distill a little wisdom when possible.” [...] […] 5 Principles For Programming “since nobody seems to know very much about making good software, it makes sense to try to distill a little wisdom when possible.” […]

]]>
By: Model Reality » Blog Archive » 5 (zero-indexed) Principles For Programming http://empathybox.com/archives/8#comment-34 Model Reality » Blog Archive » 5 (zero-indexed) Principles For Programming Mon, 16 Oct 2006 21:00:14 +0000 http://empathybox.com/archives/8#comment-34 [...] Empathy Box :: 5 Principles For Programming [...] […] Empathy Box :: 5 Principles For Programming […]

]]>