Better Software - April 2008 - (Page 14) Code Craft A “D” in Programming, Part 1 by Chuck Allison They say there are three things you should never discuss if you want to get along with other people: politics, sports, and religion. Since I want to stay on your good side, I’ll steer clear of these topics, but I would like to discuss something else that often elicits religious-like fervor from developers—favorite programming languages. Language Wars What’s the best programming language? Be honest—how many times have you defended your favorite language du jour? And how many languages have been your “favorite” at one time or another? To seed the discussion, let me relate my first and only exposure to COBOL, one of my “unfavorites.” In 1975, I was standing in line, card deck in hand, waiting to submit my job to the IBM 360 expediters at Brigham Young University. I had about forty cards containing a Fortran program that numerically solved a system of ordinary differential equations. Complex stuff. Behind me stood another student with a deck of cards more than a foot thick—800 to 1,000 cards, I’d guess. Impressed and intimidated, I asked the student what his program did. “It writes a report.” Hmmm. Since I had written reports in Fortran in considerably fewer statements, I decided right then and there I would never use COBOL. No offense to the many COBOL aficionados out there—I just knew it wouldn’t work for me. My mathematical background has ingrained within me a constant yearning for economy of expression. One language is not necessarily better than another, of course. For example, I prefer Python to Perl, but both are fine scripting languages as well as general-purpose, multi-paradigm programming languages. I see Python as cleaner and more orthogonal in its design—your mileage may vary. Nonetheless, you may appreciate the following “Jedi wisdom”: YODA: Code! Yes. A programmer’s strength flows from code maintainability. But beware of Perl. Terse syntax … more than one way to do it … default variables. The dark side of code maintainability are they. Easily they flow, quick to join you when code you write. If once you start down the dark path, forever will it dominate your destiny, consume you it will. LUKE: Is Perl better than Python? YODA: No … no … no. Quicker, easier, more seductive. LUKE: But how will I know why Python is better than Perl? YODA: You will know. When your code you try to read six months from now. [1] ISTOCKPHOTO Not too many years have passed since the Java “revolution,” fueled not only by Sun’s leveraging the sudden popularity of the Internet but also in part as a “reaction” to C++. I well remember public discussions at conferences and online debunking C++ as unsafe (“pointers are evil and Java doesn’t have pointers”—a deception) and too difficult to learn (Java is no cakewalk either). These comments were relentlessly proffered as context for evangelizing the so-called superiority of this new programming language. I respect Java and its inventors, have used the language professionally and taught it in academia, but I still wince when I recall the bad form that characterized Java’s rise to popularity. There is a certain irony in the fact that the HotSpot JVM is written in C++. That said, there is always room for improvement. Java does have a simpler object model and a more flexible execution model than C++. It has brought portable concurrency and GUI tools to Joe Programmer. The relatively new Scala language is in turn an improvement on Java, combining high-level, functional programming constructs with static type safety. Scala translates to Java byte code providing access to the massive Java library. The Groovy language is a similar alternative but with dynamic typing. Alas, it’s been twelve years since Java made its debut, and its popularity seems to have peaked as it is finding its niche mainly in enterprise applications. Just today I found the following in an InfoWorld article entitled, “Java is Becoming the New COBOL”: “Java, the oldest new programming language around, is falling out of favor with developers. When it comes to developing the increasingly common rich Internet applications, Java is losing ground to Ruby on Rails, PHP, AJAX and other cool new languages … Now that Java is no longer the unchallenged champ for Internet-delivered apps, it makes sense for companies to find programmers who are skilled in the new languages. If you’re a Java developer, now’s the time to invest in new skills.” [2] 14 BETTER SOFTWARE APRIL 2008 www.StickyMinds.com http://www.StickyMinds.com
Table of Contents Feed for the Digital Edition of Better Software - April 2008 Better Software - April 2008 Contents Mark Your Calendar Contributions eLightenment Technology Speaking - A Change Would Do You Good Code Craft - A "D" In Programming, Part 1 Test Connection - Learning the Hardware Lessons Management Chronicles - The Art of Persuading Management Cover Story - Incremental and Iterative Development Developers...Start Your Engines Where Do I Go From Here Product Announcements 10 Things You Might Not Know About... The Last Word - Software Quality and the Prisoner's Dilemma Ad Index Better Software - April 2008 Better Software - April 2008 - (Page Intro) Better Software - April 2008 - Better Software - April 2008 (Page Cover1) Better Software - April 2008 - Better Software - April 2008 (Page Cover2) Better Software - April 2008 - Better Software - April 2008 (Page 1) Better Software - April 2008 - Better Software - April 2008 (Page 2) Better Software - April 2008 - Contents (Page 3) Better Software - April 2008 - Mark Your Calendar (Page 4) Better Software - April 2008 - Mark Your Calendar (Page 5) Better Software - April 2008 - Contributions (Page 6) Better Software - April 2008 - Contributions (Page 7) Better Software - April 2008 - eLightenment (Page 8) Better Software - April 2008 - eLightenment (Page 9) Better Software - April 2008 - eLightenment (Page 10) Better Software - April 2008 - eLightenment (Page 11) Better Software - April 2008 - eLightenment (Page 12) Better Software - April 2008 - Technology Speaking - A Change Would Do You Good (Page 13) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 14) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 15) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 16) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 17) Better Software - April 2008 - Test Connection - Learning the Hardware Lessons (Page 18) Better Software - April 2008 - Test Connection - Learning the Hardware Lessons (Page 19) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 20) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 21) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 22) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 23) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 24) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 25) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 26) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 27) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 28) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 29) Better Software - April 2008 - Developers...Start Your Engines (Page 30) Better Software - April 2008 - Developers...Start Your Engines (Page 31) Better Software - April 2008 - Developers...Start Your Engines (Page 32) Better Software - April 2008 - Developers...Start Your Engines (Page 33) Better Software - April 2008 - Developers...Start Your Engines (Page 34) Better Software - April 2008 - Developers...Start Your Engines (Page 35) Better Software - April 2008 - Where Do I Go From Here (Page 36) Better Software - April 2008 - Where Do I Go From Here (Page 37) Better Software - April 2008 - Where Do I Go From Here (Page 38) Better Software - April 2008 - Where Do I Go From Here (Page 39) Better Software - April 2008 - Where Do I Go From Here (Page 40) Better Software - April 2008 - Where Do I Go From Here (Page 41) Better Software - April 2008 - Where Do I Go From Here (Page 42) Better Software - April 2008 - Product Announcements (Page 43) Better Software - April 2008 - Product Announcements (Page 44) Better Software - April 2008 - Product Announcements (Page 45) Better Software - April 2008 - 10 Things You Might Not Know About... (Page 46) Better Software - April 2008 - The Last Word - Software Quality and the Prisoner's Dilemma (Page 47) Better Software - April 2008 - Ad Index (Page 48) Better Software - April 2008 - Ad Index (Page Cover3) Better Software - April 2008 - Ad Index (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.