by spolsky · 13y ago · 0 comments
At the time, Fog Creek consisted of three people and one summer intern. We couldn't afford to rewrite all of FogBugz in some other language... even if there was a language (in 2003) that was reasonably portable between Windows and Unix, which there wasn't. (Yes, we considered PHP. That would still have been a full rewrite, and PHP on Windows was crappy and increased the system requirements in a way that our customers wouldn't have liked).
Yeah, a Lexus is better than a Camry, but not everyone can afford Lexuses. So saying "you idiot, why are you driving that crappy car, it's obviously crappy" is not particularly insightful... the question is, if you can get 90% of the bang for 10% of the bucks, that's a pretty good decision as a startup, even if it seems strange.
What's more interesting about the reaction is that so many average programmers seem to think that writing a compiler is intrinsically "hard," or, as Jeff wrote in 2006, "Writing your own language is absolutely beyond the pale." To me this sounds like the typical cook at Olive Garden who cannot possibly believe that any chef in a restaurant could ever do something other than opening a bag from the freezer and dumping the contents into the deep fryer. Cooking? With ingredients? From scratch! Absolutely beyond the pale! Compilers aren't some strange magic black art that only godlike programmers are allowed to practice. They're something you learn how to create in one semester in college and you can knock out a simple one in a few weeks. Whatever you think about whether it's the right thing or not, if you think that a compiler is too hard to do as a part of your day job, you may want to invest some time in professional development and learning more about your craft.
I haven't written a compiler since I took the course... but I've written a lot of interpreters. And as the course will teach you, they are used everywhere, for a lot of things, even things you wouldn't expect. An HTML renderer, for instance, is basically an interpreter for the language called HTML, interpreting it into graphics commands. (Adding JS to the mix complicates things, but that's a decent understanding of a straight-up HTML renderer.)
For something a little less formal, Jack Crenshaw's "Let's Build a Compiler" is a good introduction: http://compilers.iecc.com/crenshaw/
Compilers aren't black magic, but anyone who's never written one seems to think they are.
Given that languages have developed quite significantly since 2006, if you had to make the same decision in this day, what would you do?
I learned more about the fundamentals of programming in one semester of compiler design than I did in the rest of 4 years of courses. It ought to be a requirement for any comp. sci. degre, IMO.
Java, of course, is so careful to protect global namespace that all kinds of "patterns" for disguising global state as something else emerged (woohoo "Singletons"), resulting in tools to find them and force them to be further disguised.
Another interesting thing (recall PG's aphorism that any sufficiently complex project contains a half-assed implementation of Lisp) is that designing ridiculously complex declarative syntaxes ("data") isn't considered beyond the pale on many projects (or at least it's allowed to happen through carelessness), but creating a properly defined language is.
This actually predates PG - it's known as Greenspun's Tenth Rule[0]
> We had a large code base in VBScript that only ran on Windows, and almost no developers.
So you roll your own language to improve things?
> Yes, we considered PHP.
I don't think you did.
> That would still have been a full rewrite, and PHP on Windows was crappy and increased the system requirements in a way that our customers wouldn't have liked.
Full rewrite into a cross platform language which only went on to improve and would have been far more backwards compatible [with a small eventual migration to php5]. I'm sorry but the fact you can't write a decent install script or manual to get your system working in different environments is not reason enough to roll your own language. Yes developing the compiler didn't take long but now you have a zero'd recruiting pool, a slower debug loop and an eventual fragmented maintenance nightmare. Oh and by the way, saying "PHP on Windows was crappy" is not particularly insightful...
> Cooking? With ingredients? From scratch! Absolutely beyond the pale!
It is when you're working at McD's though, and that is what Jeff everyone else was trying to tell you.
> What's more interesting about the reaction is that so many average programmers seem to think that writing a compiler is intrinsically "hard,"
We didn't react because we're average and think writing a compiler is hard, we reacted because you went against every common sense principal of software development there is. Any idiot who completes a degree can build a compiler / code generator, that doesn't mean its a good idea for your next web app. But go ahead, call us "average" delude yourself more, everyone who doubts you is just stupid because, well you're just such a godlike programmer.
I don't get it, its obvious, you're an MS flake, because of that you didn't want to use the logical choice, PHP, so you did something stupid. And now you can't just own it, instead you going around insulting everyone who calls you out. The best developers own their mistakes and learn from them, the bad ones flail around, blame the language, system, or other people.
Please dont write posts like that on HN.