Smart about languages

The ever-quotable Sean McGrath penned another of his trademark aphorisms this week: "The library IS the language." By "library" he means the great edifices of reusable code that are, in their modern form, delivered as the core Java and .Net class libraries. Mastering them is a challenge that can take years, McGrath wrote. Mastering programming languages, he suggested, is comparatively trivial.

In principle that's true. In practice we are not quite there yet. Recently, for example, I've done a lot of programming in a pair of languages I know fairly well by now: Python and JavaScript. I'm using them in tandem because Python is great for general-purpose service delivery and JavaScript is the magic wand that waves AJAXian features into existence.

Combining the two languages is a useful strategy as clients and servers become more equal partners. But it's a challenge to keep track of the subtleties of these languages, and an even bigger challenge to corral each into its own mental compartment.

This interwoven use is complicated by the fact that each language has its own virtual machine and its own libraries. That isn't necessarily a given. For example, both of these languages have been implemented on the .Net Common Language Runtime. Andrew Clinick led Microsoft's development of JScript .Net (back when that was a live project). Jim Hugunin leads Microsoft's development of IronPython now. Clearly it's possible for both languages to share common .Net -- or indeed Mono -- services.

Such an arrangement would make some things a lot easier, especially if the shared engine were ubiquitously deployed both server-side and client-side. At the end of the day I don't care whose string, XML, database, communication, and graphics libraries are the sexiest. I want to learn one set of them that I can count on to be virtually everywhere and that I can rely on to do most of what I need.

My latest project, the InfoWorld explorer, uses Python and JavaScript along with a pair of common sublanguages: XPath and regular expressions. The first incarnation was heavily AJAXian. Then I ported it to a more conventional, server-based Web architecture. Porting isn't quite the right metaphor, though, because both versions use the same four languages. It was more like a shift of emphasis from client to server.

To the extent that data manipulation was encapsulated in XPath queries and regular expressions, I was able to reuse it. Because Python and JavaScript wrap different APIs around these subsystems, though, I had to do some common things in different ways. Common services that are similar, but not the same, can be a blessing and a curse.

All programming languages present subtleties that I must constantly relearn. To minimize friction, I standardize on common idioms where possible. So for example, I added map and filter functions to JavaScript in order to emulate Python's built-ins. It can be amusing to create these kinds of illusions, but there are better uses of brain cells. The fact that JavaScript's library lives inside the browser, and Python's lives outside, is merely a historical accident. If I could erase that distinction tomorrow, I would.

Today the ratio of languages and libraries is still roughly 1-to-1. But the numerator will grow faster than the denominator. We don't need more of the same old ways to say the same old things, but we do need new ways to say new things.

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Jon Udell

InfoWorld
Show Comments

Brand Post

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Aysha Strobbe

Microsoft Office 365/HP Spectre x360

Microsoft Office continues to make a student’s life that little bit easier by offering reliable, easy to use, time-saving functionality, while continuing to develop new features that further enhance what is already a formidable collection of applications

Michael Hargreaves

Microsoft Office 365/Dell XPS 15 2-in-1

I’d recommend a Dell XPS 15 2-in-1 and the new Windows 10 to anyone who needs to get serious work done (before you kick back on your couch with your favourite Netflix show.)

Maryellen Rose George

Brother PT-P750W

It’s useful for office tasks as well as pragmatic labelling of equipment and storage – just don’t get too excited and label everything in sight!

Cathy Giles

Brother MFC-L8900CDW

The Brother MFC-L8900CDW is an absolute stand out. I struggle to fault it.

Luke Hill

MSI GT75 TITAN

I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?