Nov

19

Favorite C.S. Quote

November 19, 2007 | Leave a Comment

I took a C.S. elective course my sophomore year of college that used “Structure and Interpretation of Computer Programs” as it’s textbook. I will never forget the first paragraphs of the book (emphasis mine):

We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells.

A computational process is indeed much like a sorcerer’s idea of a spirit. It cannot be seen or touched. It is not composed of matter at all. However, it is very real. It can perform intellectual work. It can answer questions. It can affect the world by disbursing money at a bank or by controlling a robot arm in a factory. The programs we use to conjure processes are like a sorcerer’s spells. They are carefully composed from symbolic expressions in arcane and esoteric programming languages that prescribe the tasks we want our processes to perform.

A computational process, in a correctly working computer, executes programs precisely and accurately. Thus, like the sorcerer’s apprentice, novice programmers must learn to understand and to anticipate the consequences of their conjuring. Even small errors (usually called bugs or glitches) in programs can have complex and unanticipated consequences.

Fortunately, learning to program is considerably less dangerous than learning sorcery, because the spirits we deal with are conveniently contained in a secure way. Real-world programming, however, requires care, expertise, and wisdom. A small bug in a computer-aided design program, for example, can lead to the catastrophic collapse of an airplane or a dam or the self-destruction of an industrial robot.

Master software engineers have the ability to organize programs so that they can be reasonably sure that the resulting processes will perform the tasks intended. They can visualize the behavior of their systems in advance. They know how to structure programs so that unanticipated problems do not lead to catastrophic consequences, and when problems do arise, they can debug their programs. Well-designed computational systems, like well-designed automobiles or nuclear reactors, are designed in a modular manner, so that the parts can be constructed, replaced, and debugged separately.

cover.jpg

Feb

13

IDEs in a Commercial

February 13, 2007 | 2 Comments

I heard a co-worker calling someone nasty names. I turned and looked at him like there was something wrong with him.

“What, a guy can’t curse at his IDE?” (he uses Eclipse)

If there was a commercial with IDEs represented as people in it, Eclipse would be the Windows Guy and Idea IntelliJ would be the Macintosh guy.

Jan

22

It’s old news now but Steve Jobs said “No one uses Java” (or something like that). There has been a lot of discussion about this. I’m not a Steve Jobs disciple or a huge Mac fan but I have a healthy respect for both of them. But his statement and the discussion around it has threatened my “world view” (from a Java perspective).

Early in my career I decided to hang my hat on Java. It appeared to be a great up and comer. A language that could solve world hunger and cure cancer. Although it’s not quite done that yet, it had always appeared to me to be rather healthy. I also specialized in J2EE and even though I haven’t created an EJB in years I’ve been pumping out servlets and started using open source frameworks to my advantage (a la Spring/Ibatis).

After Steve’s comments I’ve started to question whether I’ve “maxed out” on Java. I’m not an expert by any means on Spring/Ibatis nor any other popular Java frameworks. But the difference between one who knows a subject and one who is an expert on a subject is experience. Not the “I’ve coded 50 million of my own applications in my spare time that no one uses” kind of experience because in that context you can always change the parameters of your project. I’m talking the experience where you have to conform to a customer’s requirements. In that context I can pretty much pick up any framework I need to and the only experience I lack to become an expert is completing projects for customers that REQUIRE those frameworks (or where I chose those frameworks).

To be fair the context of Steve’s comments appear to be directed to Java as a client language. I’ve never coded client side Java in my professional life. I’ve even lost the opportunities for jobs I really wanted due to my lack of experience with Java UI. The Java I’m experienced with and have “hung my hat on” is the server side Java. This has always been my direction. I view Java as the 21st century COBOL. That’s not meant to be degrading, it’s simply where Java has thrived. Where COBOL (or FORTRAN) programs on mainframes were once used as tools for business now Java on small servers are used.

I’ve always had the attitude that I will pickup whatever technology I need to keep myself marketable. Since all I’m hearing about lately is how Ruby can solve world hunger and cure cancer I guess I need to start picking that up. But I’m getting older and the older the dog the harder the new tricks come.

Jan

3

Code in Books

January 3, 2007 | 1 Comment

NOTE: My OCD may be a factor in the following post:

If there is one pet peeve I have about reading technical books it’s errors in the example code. For example, in the Spring: A Developer’s Notebook that I’m reading right now on page 45 the following line appears:

protected RentABIke getRentABike(){

As soon as I saw the line I recognized the error because I had done the same fat-finger several times during the first two chapters (the I in RentABIke should be lowercase). As far as code errors in books goes this is a very trivial error. But it does point to the fact that the person who wrote the example, in this case not the primary author, didn’t even enter the code in an IDE much less compiled or tested it.

The most egregious of errors are when the example code not only does not work but the entire way in which the code is structured or framed doesn’t work. I’ve seen this where you have to basically re-write the example to get it to function. The re-write may demonstrate what you need to learn from the example but it takes so much time to do so you might as well teach yourself and forgo even reading the book. Most books at least forget to include some xml configuration entry or possibly a small method required somewhere. It can make it hard to learn the subject matter if your busy trying to figure out some small bit of configuration or code that has been left out.

I don’t learn from actually entering the example code and running it. I can do it with my mind completely shut down. The way I learn is to look at something that works and change it. The best case scenario for me to learn from examples in books is to enter the code, get it to run and the change it around. I want to look at it, think of some change I want to do (starting small and making larger changes until I feel I understand), make the change and test the results. For me it just takes too much time to do this if I am wasting my time fixing the example code.

I remember in my comp-sci 101 class the Pascal book we worked out of had the example code in the text but had an appendix in the back with full and complete code for the examples in the back. To me this is the best way to use example code in books. The code in the back should be fully tested by someone other than the author to make sure it compiles and functions the way the author desires. I guess not having this in the back saves a lot of money in printing. Why bother these days anyway when you can (usually!) download the code from the publishers site. BECAUSE THE BOOK IS INCOMPLETE IF YOU DON’T, THAT’S WHY!!!

I think I would be good at going through books and verifying the quality of the examples. I would enjoy doing it also. If any authors are interested, drop me a line, maybe we could work something out. I doubt it though. I just can’t see making the same amount of money I do now editing example code.

Dec

22

JUnit’s Usefullness

December 22, 2006 | 1 Comment

Since, I have just finished chapter 2 of Spring Developer’s Notebook I have a question (I feel foolish for even posting these thoughts but here goes). I have never understood the usefulness of using JUnit in testing web applications. I know that’s blasphemy. I know every good Java developer should be using JUnit to test their code. This is especially true if they are using iterative development.

Although I have never researched how to use JUnit properly, from the few examples I have seen it used in books it seems rather pedantic. The tests you setup you know will work from the program successfully compiling. Testing with your local web server and testing the app seems like it would be faster than coding the JUnit test cases.

I am guessing that I am missing complex tests and proper ways to use JUnit to test with.

Dec

21

Spring Dev Notebook

December 21, 2006 | 1 Comment

Inspired by Erik Weibust I have started working through the “labs” in Spring Developer’s Notebook. This is good since I have already implemented a Flex/Spring/Ibatis application that allows mapping of comma delimited files to database tables to upload for a client. Oh, well. Better late than never.

In case your curious, before I implemented the app, I had never worked with Spring/Ibatis (although I had worked with Flex 1.5). I spent 3 days researching and two days implementing before I got my first “slice” (a single function of the application that goes from the client all the way to the DB) working with the framework in the object configurations I wanted. The rest was implemented in the setup I did without problems (spent more time on the Flex front end than the Spring code).

I’ll mark my progress to the right.

Search


Links

Archives