Thursday, December 22, 2005

Confessions of a Language Bigot

I'm so ashamed. It all started when I was a poor boy and awfully abused...

Ok, well, that's not quite true, at least the second sentence. :-)

Back in 1995, I was exposed to Python for the first time and pretty annoyed by it. Unlike most people significant whitespace was a positive, since it was pointed out curly braces are redundant with whitespace. So I was already specifying my intent once, why would I need to repeat myself. DRY and all that. Ok, I buy that argument.

But really, C had served me quite well for many years, I was quite experienced with it and I could do everything I needed. Sure developing GUIs was kinda painful, but come on, what's really better.

Well, we had to develop over 280 C APIs to implement the highly repetitive, but fairly regular RTCA DO-219. So this guy wrote Python code that generated the C APIs. I had to review the Python code. I wasn't really happy about it.

Ok, there were a few things which I reluctantly had to admit were half decent. I still managed to avoid actually using Python for the duration of my stint at ARINC which lasted until 2000. In the meantime, I learned C++ and used it increasingly. It was fine, better than C in some ways, worse in others. But since it was mostly C-ish, it was okay, I didn't really have let go of the basic syntax. No matter how bad something is, most people prefer a known bad versus an unknown.

In 2000, I wasn't able to achieve the things I wanted at ARINC, so I followed that guy above to a dot bomb in DC. There was this new-fangled technology I'd heard so much about called Java. It was gonna fix all the worlds problems and there would never need to be any other programming language. It would be perfect. It would do everything but give me a blowjob if I believed the hype. (Or maybe I just missed something.)

I was quite eager to learn Java. I wanted to believe the hype. I really wanted to learn just one more language and be done with it. I had already learned BASIC, machine code, Pascal, assembly, C, shell scripting, make, C++ and others I forgot (like Prolog). I can be pretty lazy, but that's the ideal programmer, right? I even have some, um "colorful," constructive lazy solutions lurking in my closet. So if I learned just one more language, I could stop wasting my time learning a language and actually solve problems.

I already mentioned I was working at a dot bomb, so you can imagine what the business was like. OTOH, I had a lot of fun. The first week was great, I had to learn Java and Javascript and create a working web page to submit auction data. Oh, did I mention I didn't know HTML at this point either. It was great to be overwhelmed. The second week slowed down and I jumped into some awful code. It happened to be written in Java, but I can't really blame Java, ugly is ugly straight through. I've since seen even worse Java code that was Pascal, ported to C++ and then ported again to Java.

I learned a lot about Java in the next 9 months--completely lived Java. At the end of the 9 months, I was completely disgusted. The "company" was a joke and the Java hype was about as accurate as saying the Earth is flat. It had a few marginal improvements over C++, but in the hands of well qualified people it seemed to do more harm than good. We mostly used Java 1.1, with a little 1.2 at the end.

I quit the dot bomb and decided to take some time off. I figured that since I had already taken the plunge to learn a new language, I better learn one that could teach me more than Java had. Actually, I learned to ignore the hype, so it wasn't a complete waste. I figured I might as well learn Python finally. It had a few things that really made it much easier than C. Like when I needed to do something like:

    for x in range(100):
        print x,
        for y in range(100):
            print y,
        print

I don't remember the exact code. There was more formatting, but this sort of stuff is much easier in Python (or any scripting language) than in Java or C++.

I wasn't about to work for someone else again after the dot bomb experience. Eric and me had already decided to start our own business. We were both contractors for ARINC, so it was easy to go back to being contractors/consultants. This time we were going to work together rather than as individual hired guns. He was already consulting on a short term gig and I was going to take a break.

The stock market was still doing well and I decided it was fun to watch it. I started a project to pull down stock quotes and track portfolios. I had already decided I was going to really give Python a shot (5 years of hostility was long enough). It seemed like a good match to do the portfolio app in Python.

I think I got about 2 weeks of Python programming and learned some nice features of Python. It wasn't great, but it was usable. And GUI programming in any scripting language beats Motif. Hell, what doesn't beat Motif programming?

Stupid ARINC decides they have a lot of money to spend and we needed to hurry up and get the business up and running. Dammit, I didn't even get a real month of vacation between jobs before I gotta start again! Well, what are you gonna do when they are practically throwing money at you. It's a good problem to have.

So after about 4 weeks of moderate Python use, I decide to write the new product we were contracted to write in Python. This wasn't quite as risky as it sounds. Eric had a bunch of Python experience, so he was my backup. It was only a 3-4 month contract. How much could possibly go wrong?

Heh, don't answer that question!

Actually, the project went very smooth. We hit all the deadlines which was really good since it was a fixed price, fixed schedule contract. There weren't any big gotchas. I learned a lot about Python and really learned its strengths. I was quite impressed.

Towards the end of the contract, I was demoing the system to the customer. I did some simple action like dragging a plane being deiced at one gate to another gate and the whole app crashed! !@#$% (blush). Sorry about that... It really wasn't that big of a deal, just major embarrassment and my own disappointment that I had screwed up. It still wasn't final delivery and everything else went very well.

I later determined the problem was I had moved some code between modules and forgot to copy the import. Based on my enormous embarrassment, I pretty much vowed at that point to fix the problem. If there wasn't a solution, I would create one. Well, there wasn't a solution. I had read what Guido wrote about compiling Python, etc. I didn't care if I could only find the one bug that made the app crash, I was going to write a program to find that problem. Did I mention, not only am I lazy, but I'm also stubborn. I really didn't think you could find many bugs in Python programs. Boy was I wrong.

There have been many other less embarrassing moments that most people don't know about. I suppose it's time for me to come clean about those moments too. People made various requests for adding warnings to pychecker. I often commented to myself or privately to others how stupid that mistake was and it will only find problems in one persons code. I mean, really, who forgets to add the parenthesis when calling a method as in file.close (as opposed to file.close()). And damn if there weren't too many times to count I saw that message come out from my own code!

I spent the next 4 years or so (2001-2005) annoyed at the Java letdown. But I had my Python, I was very happy with it. I still did a lot of work in C and C++. They annoyed me from time to time, but they were still my old friends. I really liked Python and became a developer at the end of 2001 (I think). I got really involved with Python and the Python Software Foundation.

My 5 year cycle hit and it was time for me to move on again. Somehow I wound up at Google. Sometimes I still try to figure out how I got there, but mostly I'm just having a good time and learning tons. Google uses many languages, but primarily they are C++, Java, and Python. There's lot of code in all those languages. There's lots of experts in all those languages. There's lots of bigots emphatically declaring the One True Language. (I'm not implying the experts are the bigots.)

I used to say I don't like Java. I find that isn't even accurate anymore. Java has it's strengths and weaknesses. No different than Python, C, C++, Ruby or any other language that's ever been created. Different strengths and different weaknesses, but every one of them is flawed. Some flaws run deep, others are shallow. There's no shortage of people spouting how some idiosyncrasy is hugely important in the language they don't approve of, while the idiosyncrasies in their own pet language are of no importance.

Languages are just tools. Like all tools, have various intended purposes. Use the best tool for the job. In order to determine which tool to use, it's up to you to base your opinion on prejudice and innuendo. Or to base your opinion on how well a language solves a specific problem.

IMO, the hype that surrounds Ruby (particularly) Rails is overblown. So what? It helps Python in many ways. The more attention one P language gets, helps promote all the P languages. Puby is definitely a P language as long as you read it in Cyrillic. ;-)

All languages annoy me at this point. I wish they were all perfect, but none of them are. I just recently realized one reason I like Python better than Java and C++. I can change Python, I can't change the proprietary/closed languages. This obviously applies to all open source languages.

I've looked at Ruby a couple of times. I've never found it to be much better than Python. I find it to be different in many small ways. That doesn't make it better or worse, just different. People are different, some people will prefer one vs. another. That's ok.

We (the language developers) need to learn more from each other. We could all benefit by working together. I wish we had community run conferences like PyCon that catered only to the language developers. Wouldn't it be great if Perl, PHP, Python, and Ruby (and any other language) developers got together to share war stories, learn about things that worked and things that didn't. I'm not talking about a love-fest. I want to learn from other smart people doing similar things. I don't want to make their mistakes. I want to learn vicariously. I'm sure I won't agree with all their decisions, but if I could understand why they made the trade-offs they did, I can make a better decision.

I fully intend to learn Rails. I have a little experiment I hope to continue. I have been documenting what it takes to setup the same web app up and running and how long it takes. I only went through setting up the databases (Postgres and MySQL) and Rails so far. Hopefully there will be more later in 2006.

One final, unrelated thought. Maybe we should really work to get the syntax for dropping explicit self. I think Guido wants to keep it explicity in the signature. Though I recall either a do statement that allowed not specifying the object (self generally). There's also the seemingly general agreement that .attr (ie, leading dot) should reference self. Maybe we should push for these in 2.5. There is now a critical mass of Python developers with enough time to make this happen.

It's late I wrote way too much. If you read this far, I'm sure it says a lot about you. I'm not sure what, but it must say something! Now I need to do more listening, since that's what this world needs more.

72 Comments:

Blogger Jesse said...

A very nice read, and I agree with your language points, although Python is my preferred language, I know it has it's flaws, drawbacks, etc.

People need to stop over specializing, and "over zealoting". Doing both of those just limits your future and your opportunities, and drives people away.

10:44 AM  
Anonymous Anonymous said...

Python has to innovate more, to remove some of its flaws.
The .attr instead of self.attr seems a nice idea.

class A:
def a_method(x): .x = x

9:22 AM  
Anonymous Griff said...

From ARINC to Google...that's a transition I would never expect. Glad to hear you are doing well. I guess you decided against being a professional basketball player in Thailand after our failure against the Mongol hordes.

It's amazing what you find when you do searches on your employers name.

Mark

4:59 PM  
Anonymous kirsty said...

so, we were google-ing stuff . . .
like looking up google on google .
and then jen remembered about you and google .
so i googled " neal norwitz google "
and it got me here .
i'm pretty sure this is you, because we saw some stuff about dave and washington .
you know, that guy with crazy straight teeth .

anywhoo .
we say hi .
so hi .
peace out .

1:15 PM  
Anonymous Anonymous said...

Some people I know saw off the handle of their toothbrush when they go mountain trekking. It sames about one gram of weight and makes brushing your teeth so much more tedious.

The same goes for removing the explicit self. It saws off a small weight, but every time your mind needs to examine some code, it will have to generate that self, making the job more tedious.

10:20 AM  
Blogger Chuck said...

The rationale for languages that do not use an explicit "this" or "self" is rooted somewhat in the theory, which is that objects are static closures. You don't say "outerfunc.var" to get at the value of the higher-order function, so the same rationale applies to "self".

Of course python objects aren't static closures, they're very fungible structures. You can pass a different 'self' to a superclass for whatever weird reason you want, and python will let you get away with it. It's just another value. If self weren't explicit, it would have to be "magical", functions like super() would have to grow weird scoping rules, and so on. self would probably have to become a reserved word but still act as a variable in all other respects, and so on. I myself don't actually like explicit self, but it's the small price paid for python's object model.

1:26 PM  
Blogger Grzegorz Staniak said...

Regarding meetings and conferences, have a look at http://rupy.wmid.amu.edu.pl/. Looks like not only a community-run conference, but also a good place to share experiences about not just one language. I hope the guys will manage to pull it off.

11:55 PM  
Blogger Steve said...

Re: the RuPy conference, ironically I saw a post recently indicating they were having trouble recruiting enough Ruby speakers.

Re: implicit self, I think this would make code much harder for beginners to read, and make method code more obscure.

I know people say I'm a language bigot but it's not true - I just know a good thing when I see it, particularly when I've been looking 25 years.

1:32 AM  
Anonymous Anonymous said...

Self marks a variable as beloging to
a class and not to a method.
In some way it is the difference between a local and a global variable
(explicit is better than implicit).
I have an against-at-all-cost attitude in removing the self statement because in C++
this is not enforced and I have seen how hard is tracking problems
of this nature.

1:53 AM  
Anonymous Anonymous said...

So true. The same goes for lexical scoping. Every lexical scope that can create new variables should have an explicit reference to it's containing scope. E.g. every function in a module should receive a reference to the module as the first argument. Methods should receive a reference to the module in the first argument and a reference to self in the second. Nested functions should receive a reference to the outer block as the first argument (well, after the module and the self references, of course).

9:53 AM  
Anonymous <a href="http://m2.aol.com/itykil/index.html">Anonymous</a> said...

Do you can write anything else about it? Great article!

11:08 AM  
Anonymous <a href="http://users2.titanichost.com/olds77/index19.html">having gay anal sex</a> said...

Good job!

11:28 PM  
Anonymous <a href="http://users2.titanichost.com/shingro/index35.html">serena sex video</a> said...

Magnific!

11:56 PM  
Anonymous <a href="http://users2.titanichost.com/scersi/index34.html">education sex single</a> said...

Nice Article.

12:28 AM  
Anonymous <a href="http://users2.titanichost.com/t1fielde/index1.html">oslo sex shows</a> said...

Thanks to author.

12:57 AM  
Anonymous <a href="http://users2.titanichost.com/adjutes/index23.html">beautiful sex japan</a> said...

Wonderful blog.

1:35 AM  
Anonymous <a href="http://users2.titanichost.com/adjutes/index26.html">barbara amiel sex</a> said...

Thanks to author.

2:19 AM  
Anonymous <a href="http://users2.titanichost.com/shiconta/index6.html">cowgirl sex gallery</a> said...

Wonderful blog.

2:57 AM  
Anonymous <a href="http://users2.titanichost.com/gnites3/index1.html">hot christian sex</a> said...

Magnific!

3:28 AM  
Anonymous <a href="http://users2.titanichost.com/marymeno/index10.html">punch sex scene</a> said...

Hello all!

3:58 AM  
Anonymous <a href="http://users2.titanichost.com/vadhoms/index12.html">married sex dates</a> said...

Energizer Bunny Arrested! Charged with battery.

4:33 AM  
Anonymous <a href="http://users2.titanichost.com/etooking/index22.html">nun alien sex</a> said...

Clap on! , Clap off! clap@#&$NO CARRIER

5:11 AM  
Anonymous <a href="http://users2.titanichost.com/swiseny/index19.html">dirty lesbian sex</a> said...

Energizer Bunny Arrested! Charged with battery.

5:41 AM  
Anonymous <a href="http://users2.titanichost.com/pyzoid/index15.html">bride sex porn</a> said...

Suicidal twin kills sister by mistake!

6:42 AM  
Anonymous <a href="http://users2.titanichost.com/pyzoid/index33.html">bow wow sex</a> said...

Lottery: A tax on people who are bad at math.

7:15 AM  
Anonymous <a href="http://users2.titanichost.com/selli83/index7.html">adult sex style</a> said...

I don't suffer from insanity. I enjoy every minute of it.

7:48 AM  
Anonymous <a href="http://users2.titanichost.com/numdaso/index26.html">irish fucking sex</a> said...

Lottery: A tax on people who are bad at math.

8:20 AM  
Anonymous <a href="http://users2.TitanicHost.com/porada/get-high-off-hydrocodone.html">get high off hydrocodon</a> said...

The gene pool could use a little chlorine.

8:52 AM  
Anonymous <a href="http://cialis.whdot.com/index5.html">cialis potenzmittel</a> said...

A flashlight is a case for holding dead batteries.

9:24 AM  
Anonymous <a href="http://web.archive.org/web/20070818071737/freewebtown.com/loans1/loans-bad-credit.html">loans</a> said...

Friends help you move. Real friends help you move bodies

9:57 AM  
Anonymous <a href="http://users2.titanichost.com/numdaso/index9.html">japan teens sex</a> said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

10:40 AM  
Anonymous <a href="http://users2.titanichost.com/febisko/index.html">bekka phone sex</a> said...

Wonderful blog.

11:19 AM  
Anonymous <a href="http://users2.titanichost.com/topletrufus/index21.html">gif image sex</a> said...

The gene pool could use a little chlorine.

11:55 AM  
Anonymous <a href="http://users2.titanichost.com/yetzeit/index15.html">asian sex cumshot</a> said...

Oops. My brain just hit a bad sector.

12:30 PM  
Anonymous <a href="http://users2.titanichost.com/brittanyrogers/72-0411.html">all nude sex</a> said...

Change is inevitable, except from a vending machine.

1:02 PM  
Anonymous <a href="http://users2.titanichost.com/glicia80/index28.html">sex audio tapes</a> said...

The gene pool could use a little chlorine.

1:29 PM  
Anonymous <a href="http://users2.titanichost.com/reekello/index4.html">daughter gallery sex</a> said...

Thanks to author.

1:55 PM  
Anonymous <a href="http://users2.titanichost.com/tortene/index30.html">old ladies sex</a> said...

Magnific!

2:25 PM  
Anonymous <a href="http://users2.TitanicHost.com/kopelar/clonidine-bloating.html">clonidine bloating</a> said...

A flashlight is a case for holding dead batteries.

2:54 PM  
Anonymous name said...

A flashlight is a case for holding dead batteries.

3:29 PM  
Anonymous <a href="http://users2.titanichost.com/cuhozhilov/index31.html">family guy xxx porn picks</a> said...

When there's a will, I want to be in it.

4:04 PM  
Anonymous <a href="http://users2.titanichost.com/robertf/index7.html">purchase download movie porn</a> said...

Energizer Bunny Arrested! Charged with battery.

4:39 PM  
Anonymous <a href="http://users2.titanichost.com/maxeevich/index23.html">anal porn site</a> said...

A lot of people mistake a short memory for a clear conscience.

5:12 PM  
Anonymous <a href="http://users2.titanichost.com/dityroe/index17.html">lingerie nude sex</a> said...

Give me ambiguity or give me something else.

5:44 PM  
Anonymous <a href="http://users2.titanichost.com/liperwo/index35.html">australian sex movies</a> said...

What is a free gift ? Aren't all gifts free?

6:15 PM  
Anonymous <a href="http://users2.titanichost.com/dasistorama/index31.html">free simpson porn videos</a> said...

Friends help you move. Real friends help you move bodies.

6:48 PM  
Anonymous <a href="http://users2.titanichost.com/rego07/index23.html">college girl porn video</a> said...

When there's a will, I want to be in it.

7:32 PM  
Anonymous <a href="http://users2.titanichost.com/artinko/index17.html">hailey paige porn pics</a> said...

Beam me aboard, Scotty..... Sure. Will a 2x10 do?

8:13 PM  
Anonymous <a href="http://users2.titanichost.com/lindafmosley/index24.html">dogs impacted anal glands</a> said...

All generalizations are false, including this one.

8:46 PM  
Anonymous <a href="http://users2.titanichost.com/tereritoa1/index7.html">full sex sue</a> said...

What is a free gift ? Aren't all gifts free?

9:26 PM  
Anonymous <a href="http://users2.titanichost.com/eynol/index28.html">porn video of american idol contestant</a> said...

Oops. My brain just hit a bad sector.

10:01 PM  
Anonymous <a href="http://users2.titanichost.com/dentouj/index15.html">health class sex</a> said...

Nice Article.

10:33 PM  
Anonymous <a href="http://users2.TitanicHost.com/turtra/ibuprofen-liquid.html">ibuprofen liquid</a> said...

Suicidal twin kills sister by mistake!

11:14 PM  
Anonymous <a href="http://users2.titanichost.com/bybonte/index13.html">cello sex baby</a> said...

I'm not a complete idiot, some parts are missing!

11:56 PM  
Anonymous <a href="http://users2.titanichost.com/unareq/index34.html">photo sex arab</a> said...

What is a free gift ? Aren't all gifts free?

12:42 AM  
Anonymous <a href="http://users2.titanichost.com/mezers/index30.html">brutal hardcore sex</a> said...

Thanks to author.

1:30 AM  
Anonymous <a href="http://users2.titanichost.com/deswef/index31.html">casual sex australia</a> said...

C++ should have been called B

2:11 AM  
Anonymous <a href="http://users2.titanichost.com/tedethe/index1.html">free goat sex</a> said...

Beam me aboard, Scotty..... Sure. Will a 2x10 do?

2:51 AM  
Anonymous <a href="http://users2.titanichost.com/simpleplayer/index21.html">internet porn blocking</a> said...

640K ought to be enough for anybody. - Bill Gates 81

3:41 AM  
Anonymous <a href="http://users2.titanichost.com/sobermi/index30.html">indonesia sex porno</a> said...

Lottery: A tax on people who are bad at math.

4:35 AM  
Anonymous <a href="http://users2.titanichost.com/clydej/index12.html">watching porn bristol</a> said...

What is a free gift ? Aren't all gifts free?

5:24 AM  
Anonymous <a href="http://users2.titanichost.com/xcalomi/index17.html">jason stucky sex</a> said...

The gene pool could use a little chlorine.

6:05 AM  
Anonymous <a href="http://users2.titanichost.com/ramisew/index22.html">position for sex</a> said...

Magnific!

6:45 AM  
Anonymous <a href="http://users2.titanichost.com/hegory/index31.html">antonella barbosa porn</a> said...

Lottery: A tax on people who are bad at math.

7:22 AM  
Anonymous <a href="http://users2.titanichost.com/sidspros/index1.html">teen sex storys</a> said...

A lot of people mistake a short memory for a clear conscience.

7:57 AM  
Anonymous <a href="http://users2.titanichost.com/whitedenster/index34.html">black transsexuals porn</a> said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

8:36 AM  
Anonymous <a href="http://users2.titanichost.com/MarcellaDurant/index21.html">12 volt sex</a> said...

Lottery: A tax on people who are bad at math.

9:20 AM  
Anonymous <a href="http://users2.titanichost.com/cationie1/index33.html">paris sex ultra</a> said...

Please write anything else!

10:00 AM  
Anonymous <a href="http://phentermine.43i.net/563-061107.html">medical information on phentermine</a> said...

Thanks to author.

10:45 AM  
Anonymous <a href="http://phentermine.43i.net/160-061107.html">buy phentermine cheap online</a> said...

If ignorance is bliss, you must be orgasmic.

11:35 AM  
Anonymous <a href="http://phentermine.43i.org/674-061107.html">phentermine cash on delivery</a> said...

The gene pool could use a little chlorine.

12:20 PM  
Anonymous <a href="http://users2.titanichost.com/nimytre/index19.html">humor on sex</a> said...

Build a watch in 179 easy steps - by C. Forsberg.

12:57 PM  

Post a Comment

<< Home