Shrink Your Comfort Zone

I was talking to a co-worker the other day and I mentioned that I am teaching myself Python and Lisp. He immediately tensed up as if I had uttered a blasphemy. He replied, Why waste your time doing that, you'll never use them? All you'll ever really use in the real world is C#, PowerShell and maybe some VBScript.

I think that the crux of the matter comes down to the size of one's own comfort zone. In order for me to be a better programmer, I believe I need to keep my comfort zone really small. When I only use C#, Visual Basic, PowerShell and VBScript my comfort zone is large because these languages all have the same background: Microsoft and the .Net framework.

Large Comfort Zone

Large Comfort Zone

I think that a programmer needs to ask himself: Are all of these programming languages really different? They are all turing-complete after all, aren't they? Programming languages are not what really matters; What matters are the concepts they are made of.

I'm glad I'm learning Lisp because I now know more about macros, scope and the meta-circular interpreter. I'm glad I'm learning Python because I now know more about generator expressions and list comprehensions. I'm glad I'm learning both languages because now I know a lot more about functional programming.

The key thing is that the knowledge you had before and the new knowledge must overlap a little, otherwise you can't bridge that knowledge and make the connections among past, present and future knowledge.

Small Comfort Zone

Small Comfort Zone

In order to improve your skills, you got to shrink your comfort zone without letting it disappear completely.

The New Command Line

In the old days, you would type ...

> mutt

... to read your mail, and this to read your news ...

> tin

... or this to edit a file ...

> emacs ~/document.txt

... but then the command line interface (CLI) became an archaic user interface and the powers that be adopted the GUI. Now-a-days, one may use the following single line commands to read mail, news or edit a file, respectively:

Is this a revival of the command line interface? Some people will say No... This is a completely different context. I agree that the context is different, but the principle behind CLI is still the same that it was 30 or 35 years ago. This principle is that written language is power, be it in CLI or any other paradigm. Nobody understands this better today than these guys. I am keeping an eye on them.

5 Books Every Programmer Should Read

Here are 5 non-technical books I think every programmer should read:

Languages Worth Knowing

Among many other pearls, Alan Perlis is known for saying this one: A language that doesn't affect the way you think about programming, is not worth knowing.

I was wondering about the languages I knew, know and will come to know and realized that the languages that changed the way I thought and think about programming are quite and eclectic bunch: Sinclair BASIC, HyperCard, Visual Basic, SQL, and Python. In between those there are others that did not change my thinking: C, Java, PHP, C#, Bash, and PowerShell. I have written working programs in all the languages listed here, so to a degree I can claim working knowledge of all these languages at some point in time. However, I will never claim real expertise in any of them.

Sinclair BASIC on the ZX Spectrum 48K was my first programming language. It was 1985 and I lived in São Paulo, Brasil at the time. I was fresh out of an after-school computer course that taught people how to program BASIC on a TRS 80 III machine. I was eager to go off on my own and try my new skill set. I successfully talked my parents into buying a ZX Spectrum. I taught myself Sinclair BASIC and remember being mesmerized by the color display and at the ease with which you could create little games in the language. That experience sparked my passion for technology if nothing else.

Some would argue that you cannot properly call HyperCard a programming language, but it sure felt like one to me at the time. The major paradigm shift I went through as a consequence of direct exposure to HyperCard was this: You can actually create useful programs with this thing. That was back in 1992 when I was working as an aid in the college computer lab. I wrote a little HyperCard application to check people in and out of the lab and show a report at the end of each day.

My first serious programming language was Visual Basic 4.0. I was a passionate classic VB advocate until its demise as VB.NET and I wrote VB code professionally for quite a while. VB made me realize that anyone can program (and that's a good thing). The ease with which one can create an application with VB was unprecedented in the computer industry. Classic VB was the most popular programming language of its time for a reason, and people want it back.

SQL (more specifically T-SQL on MS SQL Server) was an eye opener because of the fundamental shift in thinking about data that you have to go through in order to use it effectively. What I mean by that is if you try to write SQL code in a procedural style you will shoot yourself in the foot very quickly. As a matter of fact, you will blow your whole leg off. With SQL, you have to think in sets. If you don't think in sets you will write a bunch of crappy and slow SQL code.

About a year ago I started to teach myself Python and I had an immediate A-Ha moment: This is sooo easy... programming is fun again! My current work involves the support of hardware and software systems for a large fortune 100 company. It's rare when a day goes by in which I have a technical problem to which the solution cannot be trivially achieved in Python. Python is the most expressive language I have used so far in my career. Using Python constantly makes me think What was I doing writing all that code before?

I also started to look into Lisp recently and although I already know that it has affected the way I think about programming in a profound way, I can't quite articulate what that is yet. But I think this paradigm shift is a major one and will require its own entry.

As I stated above, I learned other languages (to various degrees of proficiency) that did not impact my thinking that much. Were they worth learning? That's also a topic for another post.

P.S. Thanks to Reginald Braithwaite for pointing out that HyperCard scripting was indeed considered a programming language. However, I know some people that, despite insurmountable evidence of the contrary, still think that HyperCard was not programming.

Crenshaw's Let's Build a Compiler

I am going through the Let's Build a Compiler series by Jack Crenshaw. He uses Turbo Pascal 4.0 for writing the compiler code and the output language is 68K assembler. It's easy enough to port the code to C or C# directly and follow along just fine. However, if you are like myself and want to use the original Turbo Pascal you can get it here (version 5.5). If you also want to ensure your output is correct you'll need a 68K assembler and emulator. I am using this one.

Learning Lisp: Choosing an Implementation

Six months ago I began to teach myself Lisp. The catalyst for me was the now famous quote by Eric Raymond:

LISP is worth learning for a different reason — the profound enlightenment experience you will have when you finally get it. That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot.

After reading this I couldn't help myself but to try Lisp.

I understand that the common knowledge in the Lisp community is that the current obligatory initial text on Common Lisp is Peter Seibel's Practical Common Lisp. However, during and after reading this tome, the common question I hear beginners like myself ask is this: _What implementation of Common Lisp should I use?

To the rescue comes Daniel Weinreb's survey of all actively developed Common Lisp implementations on the loose today. This is not an extensive survey, but it gives you a pretty good idea of the capabilities of each implementation. The last third of the survey's content gives the reader a great list of Common Lisp resources. This is a must read for anyone learning Common Lisp.


Fascinating word: Heuristics. Some definitions follow.

Heuristics: Of or constituting an educational method in which learning takes place through discoveries that result from investigations made by the student.

Computer Science: Relating to or using a problem-solving technique in which the most appropriate solution of several found by alternative methods is selected at successive stages of a program for use in the next step of the program.

A heuristic is a technique that helps you look for an answer. Its results are subject to chance because a heuristic tells you only how to look, not what to find. It doesn't tell you how to get directly from point A to point B; it might not even know where point A and point B are. In effect, a heuristic is an algorithm in a clown suit. It's less predictable, it's more fun, and it comes without a 30-day, money-back guarantee.

Code Complete - 2nd Ed., by Steve McConnell; Chapter 2 - Parag. 21