This is an interesting talk by Charles Petzold about the current state of programming. He's been programming for many years and has written several Windows Programming books. He begins with a summary of how computers have been portrayed in movies, which I of course particularly liked.
He then gets to programming. First about IntelliSense, how enormous libraries make you dependent on it, and how it forces you to give up and top-down programming. Then he talks about how generated code (in particular that generated by Visual Studio) is often bloated and not exemplary of good programming practices. One quick example is how generated code uses really poor variable names like button1, button2, etc. It's also quite a different paradigm for the programmer from traditional programming methods. The general premise is that Visual Studio is designed to make us faster programmers, not necessarily better ones.
He's not dogmatica about it. Often saying he's not sure if what he's complaining about is significant. But I found a good (and also a long) read.
A Mac note: I read this article (as I do most long ones) by copying the text into Tofu, a simple program that just formats the text into easy to read narrow columns, like newspaper articles. I also enable speech recognition so I can literally just say "move right" to scroll the page. Great stuff.
2 comments:
That was interesting about Designers and code generators. For some Gang of Four rocket scientists who can sit down with edlin and a c compiler...yes, it could be argued that they do rot your mind some. But for your regular hack chump...such as myself...I think Designers and code generators can be rather enabling.
Imagine I go back in time to 1990s and I am trying to write some sort of business application. Equipped with a c compiler and emacs...it would take an awfully long time to do something. Equip me with Powerbuilder...which could be viewed as a GUI that generates PB code using PB object library ...that is then compiled into c...I will get there a lot quicker. Is the code that the PB GUI generates perfectly OO....probably not.
Imagine I go back to 1997...I am trying to piece together some web-based application...whipping up some HTML here....adding some server-side Javascript there...a royal pain in the but to create a header/detail page. Along comes tools such as SSSW Designer...I frankly found it empowering and enabling rather than mind rot. Was the code that SSSW Designer generated perfectly OO...probably not.
From a marketing perspective...the number of people who can actually write good OO code is ...um...N. The number of people who can't...but want to..is 10N. 10N is the bigger market...you sell to them...and there is bigger value gain potential in enabling 10N to become participants and players....both for the vendor...and for the person.
Stuff like Eclipse plug-ins that generate code, even OO imperfect code..they don't rot my mind...they enable and educate me. I guess Designers and code generators may rot some minds....but assist others....all depends on who you are.
Perhaps the question is why don't they generate better code? The answer is probably because that's not their goal. Their goal is to generate code that they can continue to edit via a tool, not to be read by humans and often deliberately so that humans can't edit it for fear it will be too difficult for the tool to read it later. There doesn't seem to be an excuse for them to generate bloated code as to his point on public fields.
Then there's the question of what programming classes (not say a PowerBuilder class) should use. Code generation probably isn't what you want but I would think IntelliSense would help. But you also have to be able to use top-down when appropriate. I use IntelliSense like features by hitting a command key rather than having it on all the time, maybe that's a happy medium.
Post a Comment