The Pragmatic Programmer: From Journeyman to Master

Posted December 27, 2006 at 2:32 PM

Tags: Work, Books

I finally finished reading the Pragmatic Programmer last night before going to bed. It's a good book. I didn't know what it was about before reading it and was a bit surprised at the content; it was more of a "best practices" for programming as a methodical job rather than a how-to of programming tips and tricks. I am used to reading more how-to type books such as those about design patterns and general reference books (who says reference books are not meant to be read cover to cover???), so this was actually a really nice change of pace and a much faster read (despite the fact that I read insanely slow). It talks about debugging, source control, working in teams, effective development environments, writing dynamic code, not letting bad code persist, and basically about being a good programmer in general. A lot of the stuff is "common sense" type stuff, but a lot of it is stuff that you probably never formalized before. I would recommend it to any one who wants a swift kick-in-the-ass reminder that there are better ways of developing applications.

Note: None of it is ColdFusion specific. In fact, most of it is language agnostic. The teachings of this book can be applied to most any language, and in fact, much of it can be considered life-lessons, not just those meant for programming. Happy reading!

Post Comment  |  Ask Ben  |  Permalink  |  Print Page




Reader Comments

Dec 27, 2006 at 3:03 PM // reply »
35 Comments

My good friend Zach let me borrow his copy. I read it 3 times in a week just to make sure it sunk in.

You are right to distinguish this from the many How-To manuals out there. The lessons are applicable cross-domain and I am much better for having read it. Thanks for posting this and a big thanks to Zach for turning me on to The Pragmatic Programmer

dw


Dec 27, 2006 at 3:39 PM // reply »
111 Comments

Yeah, this is a MUST read as the little tips and tricks just make you a better programmer all round. I suggest skimming it every few months as there is usually a good reminder of something - whether it is "no broken windows" or their stuff on writing generators.


Dec 27, 2006 at 3:39 PM // reply »
6,516 Comments

Dan,

Three times in one week :) Nicely done.

One thing that I had a question about was that towards the end it stated that Hungarian type naming (where the data type is part of the name, ex. intNumber, arrValues) is hugely inappropriate of object oriented programming. I have heard Sean Corfield talk briefly about this and how it couples the code to its implementation... I was wondering if you could shed any more light on this.

As a naming convention, my stand-alone values use this naming convention (ex. intItemIndex, arrLines) but my scoped values do not (ex. REQUEST.ItemIndex, REQUEST.Lines).

Just trying to figure out the "best" mentality. Thanks.


Dec 27, 2006 at 3:40 PM // reply »
6,516 Comments

Yeah, "No Broken Windows" is a great section! I find myself being very guilty of that, especially when I jump on someone else's application that has less-than-pretty code.


Dec 27, 2006 at 4:22 PM // reply »
111 Comments

Hi Ben,

Reason to dump Hungarian (intItemIndex), notation is that it somewhat breaks encapsulation as should you wish to change the data type of the property you have to change the name everywhere. I know that much of the code working with it might also have to be changed, but it is one extra thing to mess with. The argument in Java is also that you already know the type (compiler helps with this) so you're duplicating the info.


Dec 27, 2006 at 4:32 PM // reply »
6,516 Comments

Yeah, I gotcha (regarding the one extra thing to change)... but it almost seems like not enough of an argument. Along the same lines, couldn't you also say that you should never scope a variable (so long as ColdFusion will find it in the scope-chain) because you might want to switch from the URL to FORM to some manually defined Attributes scope?

Of course, I am not arguing with you, I know you were just explaining the rationale. But, in my opinion, the self-documenting nature of the variable name seems like a nice trade off to the slightly increased coupling.

Anyway, not sold in either direction.


Dec 27, 2006 at 5:01 PM // reply »
111 Comments

Yeah, I'm not completely sold either, but as smarter people than me have a preference and I don't, I'll go with the crowd on this one (although some smart people love Hungarian - so I'm sure there is a healthy dose of preference in the choice).

As for scope, funnily enough, I NEVER reference URL or form scope directly - always use an IBO as an attribute facade containing both that even does nifty things like returning null or 0 based on data type if attribute doesn't exist and RegExing all form and URL attributes to make sure they are well formed for their data type. Saves a bunch of tedious coding!


Dec 27, 2006 at 5:07 PM // reply »
6,516 Comments

Yeah, I tend to go with a unionned FORM/URL to REQUEST.Attributes object most of the time. I have not made the leap to IBO yet, but I have played around with it a bit.

As far as "smart people" go, I'm sure a lot of "smart" people would tell you not to eat buffalo wings that were left out on the table over the weekend... but I have proved that one wrong on many Monday mornings :) So the question becomes, is that not smart... or is that simply revolutionary ;)


Dec 27, 2006 at 5:12 PM // reply »
6,516 Comments

Although, speaking of unnecessary coupling, one of the things that I did really like in the Pragmatic Programmer was the suggestion to never put the file name in the file comments (as it couples to the physical file name). If you ever look at any of the code that I write, you will see that all files have a header comment that includes the file name. I can now stop doing that and feel at ease that it is the "right" thing to do. It was always something that I did because I thought it was correct and not because I felt that it was necessary.

That is one of the best aspects of the book; I feel that it helps to distinguish a number of things that ARE right vs. I THOUGHT they were right.


Dec 27, 2006 at 5:18 PM // reply »
111 Comments

Hmmm, in that case either revolutionary or simply gifted with a GI system with a resilience previously unknown to medical science :->

Yeah. I have file names in all my old script comments too. Always nice to learn what you've been doing wrong all these years!


Dec 27, 2006 at 11:06 PM // reply »
95 Comments

If anybody is interested in concept programming books, I hear "Code Complete" is quite a good book.

So good that I bought it and now it collects dust on my bookshelf, he he. Of course that is typical for me since I hardly ever read any of the tech books I buy.


Dec 28, 2006 at 7:51 AM // reply »
6,516 Comments

Yeah, I have heard good things about Code Complete, but cannot vouch for it personally. I will check it out on Amazon. Thanks.


Dec 28, 2006 at 10:46 AM // reply »
111 Comments

I read it the other month. It starts off very good and then settles down to merely valuable. I would definitely recommend it. It is very thorough but it isn't as "fun" as a lot of the newer, shorter books which is why it is easy for it to end up on a bookshelf unread. The book is well written, but it isn't as tight as something like PP. Still, it is on most programmers "essential reading" list, so it is worth picking up a copy - even if you just skim it.


Dec 28, 2006 at 11:43 AM // reply »
6,516 Comments

I'll see if I can find a used copy somewhere. Never know where the good deals are to be had.


Dec 28, 2006 at 11:54 AM // reply »
111 Comments

If you're stuck, let me know. I'm flying out Saturday, but will be back late Jan and have a copy I'm not planning to read again for a while . . .


Dec 28, 2006 at 5:30 PM // reply »
4 Comments

Joel on Software has an interesting article on Hungarian notation.

http://www.joelonsoftware.com/articles/Wrong.html

Some history, and some good use cases where the notation is used with different "types" that aren't necessarily datatypes like int.


Dec 28, 2006 at 6:38 PM // reply »
111 Comments

Interesting article. I'd argue that this is a bit of a hack to solve an architectural problem, however. In this particular use case you can architect your business objects to have an HTML aware view decorator that takes care of all of this automatically. That said, I'm always open to cases where Hungarian notation works - I just think in this case it is a syntactic hack for something that should have been solved at an architectural level.

Very cool link though, thanks!


Jan 26, 2009 at 9:54 PM // reply »
1 Comments

Nice review. I plan on buying this book but after reading your comments I may just opt for a used copy from Amazon.

Thanks,
-Duj


Post Comment  |  Ask Ben

Recent Blog Comments
Nov 21, 2009 at 6:47 PM
Hal Helms - Real World Object Oriented Development, Sarasota - Day Five
@charlie griefer, Thank you.. ... read »
Nov 21, 2009 at 5:15 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jose Galdamez, Oh heh yeah I didn't paste the whole code. I should have defined the vars -- my bad. It's fixed thou. Thanks. ... read »
Nov 21, 2009 at 4:49 PM
Styling The ColdFusion 8 WriteToBrowser CFImage Output
Great work yet again Ben! Whilst I didn't use this whole code, I copied some of your regex code for a similar problem with the lack of an alt attribute and unescaped ampersands in CFIMAGE for Railo 3 ... read »
Nov 21, 2009 at 1:13 PM
My First ColdFusion Builder Extension - Encrypting And Decrypting CFM / CFC Files
@Ben, Because I am pedantic, I just want to make sure that everyone knows there is absolutely no encryption going on. There is only encoding and obfuscation. The cfencode tool only obfuscates your C ... read »
Nov 21, 2009 at 12:28 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jody I can't seem to get your code sample to work. If you are still having problems, try this code out and see if it gets you what you wanted. <!--- Comma delimited list with various duplicates ... read »
Nov 21, 2009 at 11:03 AM
Groovy Operator Overloading Does Not Work In The ColdFusion Context
Hi Ben, Thanks for this informative post. Now I am reading ur old posts too ... read »
Nov 21, 2009 at 10:56 AM
HostMySite.com Has The Best ColdFusion Hosting
@Mehul, Yes very nice people, however several downtimes per day which was not acceptable. Hence we had to move out. I am glad you are having good luck with them so far. ... read »