Re:Erlang will replace Java in the next 2 years as the stand...
by gaius on Thursday September 11, 2008 @04:55PM
(#301758)
I have that book, and I am a big fan of Forth.
It's not unusual now for some of my source files to be more comments than code, the comments explain my intent and the assumptions I have made.
I'm gonna call a function french_onion_soup tomorrow just for larks :-)
Re:Erlang will replace Java in the next 2 years as the stand...
by silentbicycle on Thursday September 11, 2008 @07:19PM
(#301881)
For leeks, you mean. :)
The biggest thing I learned from Forth is that if I'm about to add a comment inside a function because something needs clarification, I should probably try breaking it out and thinking up a descriptive name instead.
Part of writing good code, whether two pages of brilliance or twenty of gradual brilliance, is conveying intent in the human-readable parts. The parser doesn't care if all the functions have names like doTheNextThing() or french_onion_soup, but it would be a slap in the face to any future maintainers.
Choosing informative names and separating a program along clear conceptual boundaries can be a greater aid to understanding than any syntactic redundancies. Well-placed comments help smooth things over, particularly notes on why a particular approach was chosen. The names themselves should be able to convey what is going on in most cases.
(For distilled wisdom along those lines, see _Thinking Forth_ by Leo Brodie, also online at http://thinking-forth.sourceforge.net/.)