What’s up with Windows developer tools being written in perl?

Date:September 27, 2016 / year-entry #204
Tags:other
Orig Link:https://blogs.msdn.microsoft.com/oldnewthing/20160927-00/?p=94395
Comments:    29
Summary:It's socially acceptable.

Worf noticed that a number of developer tools are written in perl and wonders what's up with that.

Simple: Perl is a socially-acceptable form of Visual Basic.

In other words, just like how Visual Basic is a great way to throw together a quick little GUI program, perl is a great way to throw together a quick little developer tool. In both cases, the language is loose enough to let you get away with a lot of sloppy coding techniques, and a lack of discipline can result in an unreadable mess.¹

The difference is that whereas people look down on Visual Basic programmers as talentless hacks who couldn't code their way out of a paper bag, people look at perl programmers as wizards who can perform miracles with their arcane incantations that to the uninitiated are indistinguishable from line noise.²

¹ I'm not saying that the developer tools are an unreadable mess. Just that it's easy to write an unreadable mess in perl.

² You can tell I'm an old timer because I said "line noise". Kids these days have never experienced line noise.


Comments (29)
  1. Ray Koopa says:

    I can tell you from years of experience with involved companies that even VB.NET programs are unreadable SOP (spaghetti-oriented programming) mess because the developership which utilizes this language has its origins in sloppy VB6 code.

    Wish that VB.NET never existed – it just supported those pasta* loving companies in continuing their unworldy programming “standards” (hey, that’s a nice way to describe their code. I should write it down) with additional thanks to the VB6 to VB.NET converters.

    *Referencing Spaghetti code again. Wanted to write noodle-loving companies first, but that sounded wrong.

    1. Antonio Rodríguez says:

      On the other hand, during 15 years I have engineered, developed and supported a suite of e-learning programs written in Visual Basic 6 weighting in around 300.000 lines of code. Except for a couple of early non-OO, badly designed modules, which I threw out and rewrote from the ground a few years after the start of the project, it was completely structured and had a logical structure.

      But that application was not your garden variety VB program. I agree that VB lets you a lot of bad practices, and, as Raymond points, it takes discipline to avoid them. There are (or used to be) a lot of wannabe programmers publishing sh**y freeware applications written in Classic VB which crash when they don’t like the color of your physical walls.

      As for why VB is seen as a “language for people that can’t program” where Perl is a “language for wizards”, well, once more you have found the anti-Microsoft bias: “Unix is cool, Windows is for the mass of ignorant people”.

      1. TimothyB says:

        Nowadays the language of choice in that area is JavaScript. (I love the way James Mickens describes it. Thanks Raymond, for linking him in your blog.)

        And the “line noise” reminded me of the punchline of a User Friendly comic. (I, too, am an old timer.)

        1. Dave says:

          Or Python. Python has infinite geek coolness, but it’s quite easy to write complete crap in it. Although I think that generalises to almost any language, the easier it is to use, the more likely it is to attract people who will write crap. PHP, FoxPro, VB6, all spring to mind.

      2. Never heard “language for wizards” in Linux forums. The general opinion is “write-only language”.

        1. Antonio Rodríguez says:

          Well, the result is the same: code that can not be maintained. Either because it has the structure of an spaghetti dish, or because it is obfuscated beyond hope. Either way, you can’t understand what the code does, and the better you can do is to patch it until the bug evaporates, and cross your fingers so the patch doesn’t introduce new bugs somewhere else.

          But, even given the similarities, common lore says that Perl programmers are cool, while VB programmers are fools that don’t know their tools. That’s where the anti-Microsoft bias enter scene.

        2. smf says:

          All languages are write only in the hands of the right (or wrong) speaker.

          They get bonus points for throwing in a killer twist at the end that makes you re-evaluate all that you have read so far.

        3. Tanveer Badar says:

          I, Tanveer Badar, want to register my protest about perl getting all the credit. It is equally possible to write unmaintainable code in C#. My life for the past 3 years is a testament to that!

        4. Tom West says:

          For me, Perl is just a little too much like strapping an unlicensed nuclear accelerator to my back. Just a tad too easy to cross the beams.

    2. John says:

      Like there aren’t devs out their writing hack programs in C#. Choice of language alone != skill of a developer or quality of code.

      1. Ray Koopa says:

        Of course not. But the fact alone that you add “C#” to a Bing or StackOverflow query to get more sophisticated results about a raw .NET question already shows the reputation VB.NET has in general.

    3. DWalker says:

      “Wish that VB.NET never existed”. Well, you can wish that, but I’m glad your wish did not come true. Some people write well-performing, easy to maintain, non-spaghetti, OO code using VB.NET.

    4. DWalker says:

      “…because the developership which utilizes this language has its origins in sloppy VB6 code”

      Not all of the developership; don’t lump everyone in the same boat!

  2. Rob K says:

    Now you’re just trolling! A big difference between Basic and Perl is that a design aim of Basic was to prevent people from writing code that was hard to understand (make it hard to do the wrong thing) whereas Perl was created to allow Larry Wall to get stuff done (make it easy to do the right thing). Bad programmers write bad code, no matter the language or tool. Good programmers write good code, and seek good tools to make writing good code easier.

    1. Joker_vD says:

      1987 – Larry Wall falls asleep and hits Larry Wall’s forehead on the keyboard. Upon waking Larry Wall decides that the string of characters on Larry Wall’s monitor isn’t random but an example program in a programming language that God wants His prophet, Larry Wall, to design. Perl is born.

  3. JoeWoodbury says:

    There’s a joke in there about perl before swine.

  4. Simon says:

    > people look at perl programmers as wizards who can perform miracles with their arcane incantations that to the uninitiated are indistinguishable from line noise

    I disagree. True, Perl has an association of competence and cleverness – but most people I know look at Perl programmers as people who should be given a nice long-sleeved vest and a padded cell… to protect the rest of us.

  5. The days I have to delve in to VB6 code at work are the days my mood takes a turn for the worse. Some of it hasn’t been touched in over a decade and the original developers are long gone. It doesn’t help that I’m not a VB programmer; my high level language background is C. I can follow VB code and work out what it’s doing, but modifying it is painful.

    It’s not that VB6 is unique in its tendency to be an unreadable and unholy mess, you can write awful code in any language. It’s just that VB6 makes it a lot easier for people to write unreadable and unholy code that still runs and does mostly what they wanted.

    1. DaveL says:

      I often wonder if the fundamental reason for sloppy code is linked to how easy it is to “develop” with it. In other words, is rapid code development more likely to result in a long term unmaintainable mess?

      1. DWalker says:

        I think that VB and VB.NET, like Excel VBA, allows some people to write code to automate repetitive tasks, or otherwise “Get things done” even if the people writing the code are office workers and not professional programmers.

        VB, VBA, and VB.NET have helped save a lot of people a lot of time, while allowing non-professional programmers to (very likely) make some mistakes, and write code that sometimes is not up to professional standards. Like everything else, it’s a trade-off.

  6. smf says:

    “people look at perl programmers as wizards who can perform miracles with their arcane incantations that to the uninitiated are indistinguishable from line noise”

    No we don’t, damn kinds with their love of git.

  7. Tor says:

    I like how you answer random comments from five years ago.

    On an other note, I always found it tricky to run Perl programs on Windows. Not impossible, but a little messy. There was the ActivePerl installer that was supposed to “just work”, or there was Cygwin, but they tended to conflict with each other. Then you had to fiddle around with PATH. Are things better now?

    1. __klg says:

      Not that I do much work in perl these days, but Strawberry works just fine for the little things (eg, parse excel, make report, email report).

    2. Chris Iverson says:

      Depends on how you run it. You can run the linux perl binary using the new Windows Subsystem for Linux in Windows 10, so, in that environment, it’s identical. *shrug*

    3. zboot says:

      You are assuming that this post was written recently, and not written 5 years ago but only posted now.

  8. George says:

    Frankly, you seem to see a lot more love for us Perl-users than I see on line. It is true, as somebody says, there is a reason that nobody ever organized an “obfuscated Perl” contest. But the Ruby coders regard us as dinosaurs, the Python users regard as gunslingers, and FP and Lisp people consider Perl as beneath notice. Or so it appears.

    I was pleasantly surprised a few years ago to find how nicely ActivePerl worked for me. To be sure, I was not working with Windows objects, just using DBI, text-bashing and HTTP stuff. And as I recall, I have even been able to understand what the code meant and did when I went back to look.

  9. alegr1 says:

    So what. Last week, I wrote the whole SrcSrv source indexing script for Git as a plain CMD file, and it just took 250 lines, counting comments and blank lines. While the existing Perforce indexing script shipped with WinDbg is 400 lines of perl, plus ssindex.cmd is another 960 lines of perl.

  10. JDG says:

    Hmm, I’ve never thought of PERL as a UNIX-y or console-y equivalent of VB6. I think in order to be *able* to write PERL code you need a much greater grounding in the basic operation of the system, and to write developer tools in PERL, you have to have a deep understanding of the underlying processes involved in compiling code, parsing languages, etc. PERL makes it easy to write spaghetti code, but I don’t think of developers who choose to use it (and perhaps lack the discipline to write clean PERL code) as being “bad developers” in the way that VB6 has created a reputation for. You’re comparing seasoned veterans with plenty of knowledge & experience who are just choosing the tool that lets them get it done fastest with people who are just entering the world of programming and are learning how to do basic things for the frist time.

  11. JamesNT says:

    Visual Basic .Net is a wonderful language. I am equally skilled in VB.Net and C# (which I know doesn’t say much but walk with me here) and I can’t, to this day, decide which is my favorite.

    VB is wonderful. Many of us cut our teeth on it. And I’ll never understand the hate of VB. Those that hate on VB are, in my not so humble opinion, elitist jerks or uneducated at best.

    JamesNT

Comments are closed.


*DISCLAIMER: I DO NOT OWN THIS CONTENT. If you are the owner and would like it removed, please contact me. The content herein is an archived reproduction of entries from Raymond Chen's "Old New Thing" Blog (most recent link is here). It may have slight formatting modifications for consistency and to improve readability.

WHY DID I DUPLICATE THIS CONTENT HERE? Let me first say this site has never had anything to sell and has never shown ads of any kind. I have nothing monetarily to gain by duplicating content here. Because I had made my own local copy of this content throughout the years, for ease of using tools like grep, I decided to put it online after I discovered some of the original content previously and publicly available, had disappeared approximately early to mid 2019. At the same time, I present the content in an easily accessible theme-agnostic way.

The information provided by Raymond's blog is, for all practical purposes, more authoritative on Windows Development than Microsoft's own MSDN documentation and should be considered supplemental reading to that documentation. The wealth of missing details provided by this blog that Microsoft could not or did not document about Windows over the years is vital enough, many would agree an online "backup" of these details is a necessary endeavor. Specifics include:

<-- Back to Old New Thing Archive Index