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:
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.
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
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
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 .
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.
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.
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.
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.
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.
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).
Do you can write anything else about it? Great article!
Good job!
Magnific!
Nice Article.
Thanks to author.
Wonderful blog.
Thanks to author.
Wonderful blog.
Magnific!
Hello all!
Energizer Bunny Arrested! Charged with battery.
Clap on! , Clap off! clap@#&$NO CARRIER
Energizer Bunny Arrested! Charged with battery.
Suicidal twin kills sister by mistake!
Lottery: A tax on people who are bad at math.
I don't suffer from insanity. I enjoy every minute of it.
Lottery: A tax on people who are bad at math.
The gene pool could use a little chlorine.
A flashlight is a case for holding dead batteries.
Friends help you move. Real friends help you move bodies
actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
Wonderful blog.
The gene pool could use a little chlorine.
Oops. My brain just hit a bad sector.
Change is inevitable, except from a vending machine.
The gene pool could use a little chlorine.
Thanks to author.
Magnific!
A flashlight is a case for holding dead batteries.
A flashlight is a case for holding dead batteries.
When there's a will, I want to be in it.
Energizer Bunny Arrested! Charged with battery.
A lot of people mistake a short memory for a clear conscience.
Give me ambiguity or give me something else.
What is a free gift ? Aren't all gifts free?
Friends help you move. Real friends help you move bodies.
When there's a will, I want to be in it.
Beam me aboard, Scotty..... Sure. Will a 2x10 do?
All generalizations are false, including this one.
What is a free gift ? Aren't all gifts free?
Oops. My brain just hit a bad sector.
Nice Article.
Suicidal twin kills sister by mistake!
I'm not a complete idiot, some parts are missing!
What is a free gift ? Aren't all gifts free?
Thanks to author.
C++ should have been called B
Beam me aboard, Scotty..... Sure. Will a 2x10 do?
640K ought to be enough for anybody. - Bill Gates 81
Lottery: A tax on people who are bad at math.
What is a free gift ? Aren't all gifts free?
The gene pool could use a little chlorine.
Magnific!
Lottery: A tax on people who are bad at math.
A lot of people mistake a short memory for a clear conscience.
actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
Lottery: A tax on people who are bad at math.
Please write anything else!
Thanks to author.
If ignorance is bliss, you must be orgasmic.
The gene pool could use a little chlorine.
Build a watch in 179 easy steps - by C. Forsberg.
Post a Comment
<< Home