Free Newsletters
Technology & Business Daily

InfoWorld
Log-in | Register
STRATEGIC DEVELOPER  

Separating code from its environment

Programming environments shouldn't be tied to specific languages

By Jon Udell  
March 30, 2005
 

Programming languages and environments are an abiding passion of mine. I'm always on the lookout for a better mousetrap, and lately I've been working with three relative newcomers: the PHP (PHP: Hypertext Preprocessor)-based plug-in architecture of the WordPress blogging engine; the Ruby on Rails framework; and Mark Logic's XQuery-based Content Interaction Server.

Free IT resource

TechNet: More ways to know it, share it, and keep it running.

Sponsored by Microsoft

Free IT resource

Attend the SOA Executive Forum: Breaking SOA Bottlenecks SOAExecForum.com/may2007

Sponsored by InfoWorld

Each of these languages does very different things for different reasons, and their associated environments are likewise very different. But in each case, the language is tightly bound to its environment in ways that I often wish it wasn't.

Exhibit A: WordPress. The WordPress engine is written in PHP, so of course you write plug-ins in PHP, too. Except … why? The things that a WordPress plug-in has to do -- perform regular expression searches, read and write XML, create or traverse in-memory data structures, compose HTML forms -- are things that I already know how to do in Perl, Python, Java, JavaScript, and a bunch of other languages. Relearning all these skills in PHP feels like a massive waste of time and effort.

Exhibit B: Ruby on Rails. By way of background, Ruby is an open source, dynamic, object-oriented language with roots in Perl, Python, and -- like all modern dynamic languages -- Smalltalk. I've only scratched the surface of Ruby, but when I recently started a project that required a Web-based interface to a SQL database, I reached for Ruby on Rails, because I'd heard it's a great way to automate the tedious chores of Web development. If there is another object-relational mapper that is as powerful and yet as lightweight as Ruby on Rails, I haven't seen it. And yet when you open up the files it magically conjures, you're expected to write Ruby code inside them to do all the routine stuff. Granted, if I knew Ruby better I'd want to do that, but why can't I leverage what I already know in other languages?

Exhibit C: Mark Logic's Content Interaction Server. If you check out the experiments on my blog, you'll see how I'm using this XQuery engine to make XHTML content come alive. The environment, in this case, is an XML database married to an app server, and the language is XQuery. It's a wildly powerful combination. In XQuery, XML is a native data type. The central XQuery construct is FLWOR (pronounced "flower"), which expands to "For, Let, While, Order By, Return." FLWOR is analogous to SQL's SELECT statement, and it's a unique feature of the XQuery language.

But what about the basics? When my code threw an exception, I looked for a way to handle it.

Instead of the expected try/catch syntax, the official XQuery docs recommended an awkward use of if/then/else. I checked with Mark Logic, and it turns out they've implemented try/catch -- and maybe that'll even find its way into the XQuery standard. But should XQuery have to re-implement every standard control idiom? Should it have to re-create all the standard libraries?

Languages and environments have always been fellow travelers. At some point they'll begin to part ways. Domain-specific languages will continue to flourish; they're the future of programming. But they'll target fewer environments. The most obvious of these are the JVM and the .Net Common Language Runtime, along with their class frameworks. It'll take another turn of the evolutionary crank, but we'll get there.





 


 
Jon Udell is lead analyst and blogger in chief at the InfoWorld Test Center.

  More of Jon Udell's column
  Jon Udell's Weblog

Newsletter Check out all of our free newsletters!
Enter e-mail address:




 

TOP NEWS:


»  Four quick tips for choosing an IM security product
71 percent of businesses will invest in real-time messaging this year. If you're one of them, be sure to protect your enterprise

»  Forrester analysts ID hot IT jobs
Research group finds 16 IT roles with a promising future

»  Nvidia claims 10 hours of HD video on Tegra chip
The Tegra 600 and 650 can be used with hard disk drives and are designed partly for mobile Internet devices

»  Database vendors add Google's MapReduce
Greenplum and Aster Data Systems will support Google's programming technique, developed for parallel processing of large data sets across commodity hardware

»  Network management: Tips for managing costs
New technologies, changing requirements, and ongoing equipment maintenance and upgrades cost money, but there are ways to manage expenses

»  EMC targets SMBs, branch offices with new low-end storage
Celerra NX4 highlights include thin provisioning, snapshot technology for data recovery and backups, and Web-based console for management of storage volumes




Virtualization: A Step by Step Approach to Success
Your virtual machines can be up and running in a matter of minutes. HP and Citrix have integrated XenServer with HP ProLiant servers and management tools, powered by hardware-assisted Intel Virtualization Technology to enable high- performance, cost-savings solutions for server consolidation and disaster recovery. Sponsor: HP

»  Click here to view this Webcast
  Planning For A Disaster
This new, comprehensive Solutions Guide is your one stop source for Disaster Recovery. In it you'll learn how to reduce the likelihood of a disaster and to create a rock solid business continuity plan should you face a disaster situation. Sponsored by Equallogic

»  Click here to download now

- Special Advertising Partners -
WHITE PAPERS
 

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
INFOWORLD MARKETPLACE
 
» BUY A LINK NOW
 

FIND PRODUCTS AND COMPANIES
» COMPLETE PRODUCT GUIDE



TECHNOLOGY INDEX
• Applications
• Application Development
• Security
• Networking
• Wireless
• Platforms
• Hardware
• Data Management
• Storage
• Web Services
• Business
• Telecom
• Professional Services
• Standards

TECH WATCH 


What's the 411 on GOOG-411?
Just as Google has become synonymous with "performing a Web search," 411 is understood to mean "information" -- as in "what's the 411?" I was thus surprised to discover, from a billboard, no less, that the king of search is taking on the ...

Apple HTML source reveals 'iPhone Extreme'
"This one's a stretch..." reports AppleInsider. Um, yeah. Reporting on HTML code sightings of product names could be called a stretch, but iPhone Extreme has a ring to it. Now, that sounds like the product Apple should have released first, rather ...

COLUMNISTS

Unified under law
Ephraim Schwartz's Column and Blog (InfoWorld) - In the litigious world we live in, deploying a unified communications platform in your enterprise could...
» MORE COLUMNISTS

MORE INFOWORLD BLOGS


Open Sources 
Product Management
When I joined MySQL four years ago, there was quite a lot of debate about product management. We didn't actually have ...

Zero Day 
Botnet herders tending smaller flocks
New research backs up the theory that botnet operators are keeping their networks smaller in a continued effort to keep ...



• Advice Line
• Database Underground
• The Deep End
• Enterprise Mac
• Geeks in Paradise
• Grid Meter
• The Gripe Line
• InfoWorld Daily
• Inside IT
• IT Troubleshooter
• ITXtreme
• Open Sources
• ProdBlog
• Real World SOA
• Reality Check
• Security Adviser
• SMB IT
• The Storage Network
• Tech Watch
• Virtualization Report
• Zero Day

ADVERTISEMENT


RESOURCE CENTERadvertisement 

GOVERNMENT IT & POLICY
'If you don't go after the network, you're never going to stop these guys. Never.'
From the State Department, All the News for Inquiring Minds
TechPresident, the Internet Citizenry's New Consensus Taker



Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS  CAREERS   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist