I Use Ugly Languages

Here is a list of languages that I’ve found myself considering for upcoming projects:

  • Perl
  • PHP
  • C++
  • Shell
  • Erlang
  • Prolog
  • Tcl

I’ve always thought that I was interested in elegance, but I find for the stuff that I’m thinking about that it’s easier to get started with something without concern for elegance and then grow it organically from there.

I find that the languages that let me “get started” with the least amount of  mental effort are the ones that have a focus on getting things done quickly but aren’t ones that any one thinks of as beautiful or elegant.

As a result, I don’t know that any project that I do will end up as “good” code. I’m a little terrified of that. But is it better for me to get started and end up with messy code, or to not start because I want things to be correct or good?

I recognize that for many this would be a false dilemma, that is, that they can think and work in a more elegant language without trouble. And I feel like I want to be able to work in a language that looks and feels cleaner. But when it comes to getting things started, I find that the tricks that these languages allow give me a boost somehow toward starting initial creation whereas prettier or more “correct” languages cause me to feel blocked.

Maybe that’s because I feel like I have to be more structured to use the “better” languages, whereas these other languages will let me just pour out code that does something, and then work around and try to clean it up after I’ve got something out there.


Here is a comment I posted on Hacker News to clarify some thoughts:

Here are the alternatives that I have seen posited as being cleaner / more correct for the ones mentioned:

    Perl -> Python
    PHP -> Ruby
    C++ -> Java or Go
    Erlang -> Haskell
    Tcl -> Python or Scheme
    Prolog -> Lisp
    Shell -> ?

These aren’t so much my designations, as what I’ve seen in various references on the internet over the years.

Confer for citations of peoples elegance / cleanness opinions:

    Tcl war usenet posts
    Perl vs Python wars
    C++ - Paul Graham's article on what languages solve,
    Rob Pikes reasons for creating Go.
    Erlang - Damian Katz "What Sucks about Erlang"
    Prolog - see above (re prolog syntax in Erlang)
    Tcl - Eric Raymond's comments on Tcl and Perl vs Python
    Shell - no citation, but I think defensible

In almost every case I would face the mental blockage mentioned if I were to try to use the language to the right, compared to the one on the left side.


11 thoughts on “I Use Ugly Languages

  1. Languages that can give you both ease of setup to quickly get started in a project, but power to organize your code in a meaningful, structured way are the best ones in my opinion. C++ and PHP are perfectly capable languages for creating elegant and structured code. You just have to be careful to refactor things as you go and not let it become a mess of spaghetti code (which can be easy to do in all of these languages, but for that matter, any language at all). A mediocre programmer hacks together a working program and moves on to something else. A good programmer hacks together a working prototype, makes a few unit tests, and then looks at the structure that naturally emerged; while it’s fresh in his mind he refactors variable names, object definitions, scopes, and makes it more elegant before moving on. Don’t blame the language too much for ugly code.

  2. I get where you’re coming from. Part of why I think the Ballmer Peak works is because it lowers our inhibitions, like our fear of doing things badly. Maybe choosing an ugly language lowers your inhibitions in a similar way–you know it’s going to come out ugly, so you’re not afraid that what you’re doing won’t be beautiful “enough.”

    On the other hand, I do believe you can structure code well in any language–though some resist it more than others.

  3. I’ve always found PHP to be a somewhat inefficient language (in terms of developer productivity), but very powerful and actually quite nice when you use it the right way. The problem with PHP is its community, or lack thereof. There’s just no good help anywhere, and you have a really good chance of finding support or 3rd-party libs that either don’t work, are poorly documented, or are heavily insecure.

    Thankfully, the Symfony framework guys have been putting a lot of effort into this, and I applaud that. I hope someday, PHP can be thought of not as an esoteric, dead language, but as a useful and efficient language specifically designed for backend web engineers.

  4. C++ and shell are really ugly, but Perl is only ugly for ignorants. The others are just a question of taste and style.

  5. Ugly code can be written in any language. You might as well say “I paint with ugly brushes”. Some of my most elegantly crafted and highly maintainable code has been in PHP and Perl.

  6. You have no idea what an ugly language is until you’ve written IBM RPG (Report Program Generator). The paradigm is 1950’s tabulator. Makes COBOL look charming.

  7. I find it difficult to sketch or write ideas in a moleskine because I feel like everything needs to be perfect or somehow profound to do the notebook justice. I have no problem when using cheap or scrap paper. It’s of course a purely mental block. It sounds like you have a similar lack of inhibition with languages that perhaps have less emphasis on elegance and convention. I’d say rise to the challenge and force yourself to write in one if these “elegant” languages for a while. See how it affects your coding – at the very least you’ll learn some new approaches.

  8. Having written entirely too much Perl code, I have to disagree with webreac. Perl is fundmentally ugly. Perl 6 is somewhat less ugly, but I’ve switched to Python, which is substantially less ugly.

    However, I am not a big fan of non type-checked languages. I’m reading up on Scala.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s