which programming language is best to learn?

Yesterday on Twitter, @Sara_Mooney asked:

If you had to pick one of the following to learn, which would it be & why? Perl, PHP, Java, JSP, Python, or Ruby?

I’ve dabbled in perl, PHP, and Python, but that plus a 140-character limit makes for an unsatisfactory answer, so I asked my software-engineer, has-coded-in-40-languages husband, Grant Gould, for a better one. (You may remember him from the Notes from a Techie Patron guest post series.) So, Sara, here’s your better answer:


Selecting a language to learn depends, foremost, on three things:

  1. The set of tasks you are contemplating — do you want to build a website, a desktop or phone application, toys, useful work, …
  2. The resources available to you — your own prior experience, knowledgeable peers, classes, etc.
  3. Your temperament — Where do you fall on the continuum from doing abstract, mathematical thinking for fun to hands-on try-it-and-see-if-it-explodes?

With that in mind, let me briefly consider each language on the list:

  • Perl — I’ll say it outright: perl is a terrible language for newcomers. While there is a great deal of dispute as to perl’s general suitability as a swiss-army-knife language for experienced developers, very few people still argue that beginners should go anywhere near it. PRO: Can do anything; CON: Not for beginners.
  • php — php is a really convenient language for writing dynamic web content. If you already know HTML and just want to write relatively simple database-backed web applications, php is a fine choice. The language itself is reasonably clear and ergonomic and integrates directly into HTML, which can be very convenient. PRO: Convenient for small (3-10 page) web applications, lots of good online tutorials; CON: Only really useful for writing web pages. Becomes unwieldy for large sites.
  • Python and Ruby — These languages are really very, very similar. Both are real, general-purpose programming languages created with clarity and ease of learning in mind. Each has a framework for writing web applications (django and Rails respectively).
    • Python is slightly more “mathy”. It is also an older and more mature language with somewhat more tutorials and online lessons. Django is designed around relatively hard-core developers and high-performance websites, and can be intimidating to learn. PRO: A sound introduction to programming fundamentals; unparalleled online resources; CON: No easy way to write simple web applications.
    • Ruby is slightly more “pretty”. It is newer and has a bit of a reputation as a hippy language. Many people consider Rails the quickest way to learn how to build a database-backed website. PRO: Ruby-on-Rails is the quickest zero-to-website tool out there; CON: A little younger and (IMO) less elegant than python; fewer and lower-quality online resources.
  • Java is a very powerful language from the tradition of the “systems programming” languages (C and C++, for instance). It is well-suited to enormous projects and can be quickly learned by experienced engineers. But its galloping complexity makes it a tough language for beginners. Java is probably your best choice only if you (1) have access to a real class with feedback and graded projects, and (2) intend to develop something big and long-lasting. PRO: Almost unmatched for large-scale, long-term development; A solid foundation for hard-core engineering; CON: Big, complex, hard to learn.
  • JSP is an attempt to put a php-like syntax on top of Java. Opinions differ widely. Generally php will be a better choice unless you need high performance or need to integrate with some unusual components like a custom data source of some sort. PRO: Lets you hang with the Java people, whose parties probably have better catering; CON: lipstick on a pig.
  • Javascript is a scripting language for writing dynamic web pages. Most things that can be done with Javascript can be done with server-side languages, but only Javascript will deliver the sort of seamless speed and interactivity that people love these days. However most websites with Javascript also have much larger chunks of back-end server code written in some other language — the javascript is the icing, not the cake. PRO: You’ll probably eventually want to learn it anyway; CON: Widely hated. Involves you in horrible microsoft-apple-mozilla standards flamewars.

In summary:

  • If you are a hands-on person and want to write a tiny little dynamic website quickly, use PHP.
  • If you want to write a less tiny but still small dynamic website, use Ruby.
  • If you are an abstract thinker and want to learn how to program, use Python.
  • Only learn Java, JSP, or Javascript if your circumstances make them appealing for other reasons.
  • Give perl a miss. Even among professionals few people are more than lukewarm about it.

By the way (and back to my own words here, not Grant’s): I am both highly mathematical in my thinking and totally inclined to build something and see if it explodes. (I find perl self-indulgently unreadable, PHP workmanlike and useful, and Python lovely.)

Anyone have anything to add to this from a library-tech perspective?

Advertisements

Guest post: Notes from a techie patron, part 2

(Part 1 was yesterday. Onward and upward!)

WorldCat

Recall that book record I showed earlier, http://grab.by/4LEJ. FRBR nuts will note that in fact there is not one but three copies of this book in Minuteman. The other two were first editions indexed without the subtitle. At one point the one copy with the full title had 80+ holds, while the two with the partial title were in stock. Situation Normal, All FRB’d Up. This is a job for (cue music) WorldCat!

WorldCat finds them all correctly, and with a decent UI to boot, but introduces three new problems:

  • No way to actually get the book. Yes, there’s a clickable link to buy it from Amazon but no way to actually obtain the book in library fashion.
  • I can "friend" libraries, which I think is meant to give them pride of place in my search results. But I can’t friend the Minuteman. I could friend every single one of its member libraries I suppose… more than once, since some of them are in there twice… and randomly do or don’t include branch libraries…
  • The library results are to physical library buildings ordered by distance. Libraries from which I cannot borrow, but with nearby physical presences, rank ahead of libraries that are subsets of My Library (the Minuteman). This is an almost perfect storm of stupid, because the links themselves go into the Minuteman catalog — but add a completely useless restriction by site! For this reason I have to go to the fourth page of search results to get to the actually available copy that I can borrow — and then only if I happen to know that Mount Ida is part of My Library.
  • It seems like we might try to understand the forgoing by acceding temporarily to the "consortium" versus "library" distinction. But this is not true. There on page four is "Merrimack Val Library Consortium."

In conclusion, WTF? I really like WorldCat — it looks like a site created by modern, competent people to serve actual, tested use-cases. But as soon as you get under its skin, it’s just pervasively weird.

The worst thing is that WorldCat makes me care less about the things I could be doing (eg, a guerilla mashup of the Minuteman web app to make it less bad). I can see that all of the hard technical problems have been solved; the remaining problems are presumably of more aggravating flavors. It’s in some uncanny valley between competence and uselessness.

Things I don’t care about (but maybe should)

Andromeda is always telling me about the comprehensive range of services that are provided by a physical library — services that range far beyond the simple curation of bound volumes — that I should care about. And I feel bad for not caring about them. But to be honest these days I only use physical libraries for two things:

  • Picking up or dropping off bound volumes that I have requested online
  • A quiet place to work

The first of these could be done better in almost any structure other than monumental civic architecture — mailboxes and coffeehouses come to mind. The second of these is actually an outstanding use of a library, except that they almost always turn out to be closed, plus the whole no-food-or-drink thing. I wrote much of this post sitting at a restaurant table for exactly those two reasons.

(Moreover, the Death of Shushing means that it is often quieter at Starbucks than at the library. Some day when I finally lose my mind and go postal, noise-triggered bombs will correct this problem.)

Other information services

But perhaps I should be using those Other Information Services. I find it hard to believe that anyone would actually find it a superior use of their time to answer the sorts of vague questions that google does not answer already ("I read a textbook in 2002 or so that drew a causal connection Chinese brainwashing practices in the Korean War and between modern management theory…" "The phrase ‘failure-generating tendencies’ appeared in a book that I read in the last five years…")

Other patrons seem to make heavy use of some other information services — in particular the ability to play World of Warcraft on library computers (see above about shushing, noise-triggered bombs) or to employ modern communications media such as carving gang signs onto the restroom doors.

Physically local bound volumes

The Art History stacks make a great place to work because nobody ever goes there. But if the only purpose the bound volumes are serving is noise insulation, why not stick them in a warehouse and get some curtains instead?

Moreover, my requests seem to take just as long whether the physical object I’ve requested is in Somerville or Southampton. I can simply find no reason to care what bound volumes are located in which pieces of civic architecture (which makes it all the more aggravating that WorldCat seems optimized to tell me this uniquely dull piece of information).

Strange DRM’d e- and audio-books

I am technologically inclined and I can’t make head or tail of these things. They all seem to want special-purpose applications with little or no cross-platform support. And half of them are abridged.

But I guess they must be popular with somebody, right?

My library’s facebook page

http://www.facebook.com/pages/Minuteman-Library-Network/10540764811

Look, fellows. If you have time to spend on "digital outreach", why not spend it making your actually existing website less dire? I know everyone and their dog has a facebook page now, but is that really the most valuable thing?

Guest post: Notes from a techie patron, part 1

One of the recurring themes of my library science education has been that I see conversations about information all the time — some at school from a library perspective, and some at home from a computer science perspective; as a dot-com-era engineering school graduate married to same, I have a social circle dominated by software engineers. I often find radically different assumptions about the uses, roles, and limitations of technology in these spheres — the sort of differences that derail conversations for half an hour as you hash out why it is you can’t talk to each other, and the derailment ends up more rewarding than the initial conversation. Many of these conversations, of course, are with my software engineer husband, Grant Gould, who has written a guest post for this blog. It’s long, so it’s in two parts; part 1 below.

Caution!

I am not a typical library patron. Taking my views and preferences into account is neither helpful nor in all likelihood appropriate for professional library-types. This is only one data point, and an outlying one.

What is and isn't my library

What isn't my library

Before I complain about my library, I should establish what is not my library, because there are a lot of red herrings.

http://grab.by/4LDa

This is not my library: it is closed. In fact if you don't get home from work before 6, there's not much there at all.

https://i2.wp.com/www.somervillepubliclibrary.org/images/spl_sign3.jpg

This is not my library: it has fewer than 10% of the books I look for.

http://grab.by/4Lua

Is this my library? I like the sound of "virtual"…

http://grab.by/4LtM

This is not my library: I am unauthorized.

(Note that if you log in as "guest" you can get a real treat… some great best-of-the-mid-90's web design, "not currently compatible with IE7"…)

My library

http://library.minlib.net/search/ is my library. It has most books that I look for, is always open, and I appear to be authorized to use it.

Library professionals may argue that this is not really a library at all — it is a consortium of some sort. I disagree with this analysis: It is for my purposes more of a library than any of the various other not-my-libraries on offer. It is hard to see how it is less a library than the West Somerville. More broadly, it does a better job of meeting (this) patron's information wants; it has the library nature.

Why my library annoys me

If you make much use of my library (http://library.minlib.net/search/), you will discover a number of things. First of all, it wants me to pick up my books somewhere — and not somewhere convenient, either. I don't understand why they need more than a kiosk at a coffeehouse somewhere, but my books go to the big not-my-library that is closed weekends and most evenings.

Anothing thing that you will notice is that the user interface is terrible. In fact it is weirdly terrible. Consider this screen, and ask yourself what you would do if this were a book you would like to read later:

http://grab.by/4LEJ
(Ed. note: The image is too wide for my blog theme; you can see the whole at http://grab.by/4LEJ, though this gets the point across.)

  • You cannot bookmark this link, because it will just send you to the library's login page instead. (Ed. note: I pointed out the permalink you can sort of see here, which helps, but can’t be directly bookmarked in the way a URL can.)

  • In fact if you linger on this page for more than ten minutes, you will be redirected back there! This is an intentional feature — viewing source shows:

    
    
    
    <noscript>
    <meta http-equiv="Refresh" content="600;URL=/search/" />
    </noscript>
    

    Way to vandalize my browsing session there, guys! (I hypothesize that this was a "security" feature for viewing this page from a public terminal. No, really, stop laughing!)

  • "Save to My List," "View My List," and "Clear My List" all refer to a "wish list" feature, which sounds awesome — but the wish list is cleared at the end of your session or any time you open a new tab. Hope you didn't put anything hard-to-find there!

  • You can also — actually persistently! — save a search. Unfortunately "save search" is no longer available when, as in this screenshot, you have narrowed down your search to a single item.

  • The actual way to save it is to request the book and then click a "freeze request" buttom. But — requests cannot be frozen if the book was available. If the book was available, you have just requested it, exactly what you did not intend.

By the way — anyone recognize this visual style? Those beautiful bevels? If you were doing web design in 1998, you do!

https://i1.wp.com/mln.lib.ma.us/dbs.gif
https://library.minlib.net/screens/reading_history.gif

Stay tuned for part 2!