The Artima Developer Community
Sponsored Link

Java Buzz Forum
Joel explains Hungarian notation

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Kevin Dangoor

Posts: 1101
Nickname: tazzzzz
Registered: Jul, 2003

Kevin Dangoor is a developer with JSTOR
Joel explains Hungarian notation Posted: May 11, 2005 11:57 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Kevin Dangoor.
Original Post: Joel explains Hungarian notation
Feed Title: Blue Sky On Mars
Feed URL: http://www.blueskyonmars.com/feed/?cat=8%2C13%2C14
Feed Description: Kevin Dangoor's Weblog of Technology, Entertainment and Life - Java only feed. For all articles, check out http://www.blueskyonmars.com
Latest Java Buzz Posts
Latest Java Buzz Posts by Kevin Dangoor
Latest Posts From Blue Sky On Mars

Advertisement

Joel Spolsky, as always, is entertaining and takes a bit of exposition to get to the point in his latest article: Making Wrong Code Look Wrong. In the article, he makes a differentiation between "Apps Hungarian" notation and "Systems Hungarian" notation, and now it makes sense to me. Whenever I saw people talking about Hungarian Notation, I always saw the Systems version which seemed completely nonsensical: why would someone have a variable name that just duplicates information that you've already got? Conveying more useful information, as in the unsafe string example Joel gives, is a good thing.

I don't buy the exceptions argument that Joel makes. When you're writing the code, if you're calling some outside function you need to know whether that function throws exceptions or if it returns an error code. Either way, when you're calling something that can fail, you need to decide how you're going to handle that failure. If you use error codes, you're forced to do bookkeeping all the way up the chain until the error hits a point where it can be properly dealt with (sometimes requiring action from the user). With exceptions, you can just say "this method is not in a position to do something about this problem, pass it along".

CompSci is all about tradeoffs: Joel's preference is for more explicit code that requires more bookkeeping. My preference is for something that requires a bit less bookkeeping, and saves a bit of time by leaning on the tools a bit more. People writing macros in LISP are all the way at the extreme of hiding much of the bookkeepnig behind the tools provided by the language.

There's no proveably correct answer to this, so pick your poision as they say.

Regardless of how you feel about exceptions, though, Joel's article is worth the read because of his Hungarian Notation explanation. If you've been turned off by Hungarian Notation in the past, it's worth taking a look at Joel's view on it.

Read: Joel explains Hungarian notation

Topic: Site upgraded, turbulence expected Previous Topic   Next Topic Topic: Apple: What's Next?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use