« Old dog, new tricks | Main| Some days the jokes just write themselves »

The Truth as I See It: Part 1


This post is part one in a series.

Choice of programming language is always a hot topic in the Yellowverse.  Precisely because we have so many options available to us, language zealotry can be the stuff of endless debate.  As we look forward to the next evolutions in Notes/Domino, there will be even more choices, some of which will completely and forever change the way applications should be built.

Personally, I've always been confused by arguments over language choice.  Usually some pragmatist will step in and say something like "you should use the best language for the job at hand," and I inevitably find myself thinking "isn't the definition of 'best' precisely what's at issue here?"  After all, how do you decide what's "best?"  You need a measuring stick to evaluate all the subtle differences between behavior of various languages in context.  A quip like "for each language according to its abilities, to each project according to its needs" doesn't really help us understand how to weigh those abilities and needs.  (Incidentally, that's the same underlying problem with "from each according to his abilities, to each according to his needs.")

So what should our measuring stick be?  That is, as developers, what should be our main priorities when evaluating one language (or platform or framework or toolset) over another?

Most developers set their priority to the most obvious option: productivity.  People prefer to code to what they already know, because it means they can see immediate results.  If you can write something in 2 days with Lotusscript, but would need 2 weeks to do it in Java, then your decision is likely to be based on whether you're willing to take an extra 8 days to get your result.

Other possible priorities include: performance, standardization, portability, availability, simplicity, popularity, usability, longevity, stability, and plain ol' laziness.  Believe it or not, I think every one of these is a great criteria for evaluating available options.  Languages and toolsets can dictate a lot about...

whether the software will scale
whether or not it meets industry standards
whether it runs on a variety of systems
whether it can run in your desired context
whether it involves a lot of code or a little
whether you can find people who are skilled with it
whether it creates a positive user experience
whether it will still work in 5 or 10 years
whether it's likely to fail in unanticipated circumstances
whether you have to work hard to get your result

In the 17 years I've been doing software development and systems design, I've decided that my number one priority is: maintainability.  This probably flies in the face of what readers here would think.  I have a history of showing demonstrations and tutorials that have a lot of detailed steps to follow.  Given that I've spoken at Lotusphere 4 times on user interface design, one might think that I would hold the resulting experience of the software as the most important issue.  That's not the case.  It's more like 2nd or 3rd on the list.

For me, nothing is more important than having someone else be able to open up the code, go "ah, okay... that's how this works" and be able to make adjustments to meet future requirements while keeping the fundamental design in place.  That's one of the reasons all the Lotusscript I write these days is in OO.  (And make no mistake, writing object Lotusscript is pretty much writing in a different language than writing procedural Lotusscript.)   I have always had positive feedback from other developers that working with a class base I created is a lot like simply working with the native product classes.  Well-designed contracts for your classes make it very easy for them to be understood and used by other people.

Domino. unfortunately, has a long history of being a hack-tastic platform when it comes to maintainability.  Many basic concepts of code reuse, abstraction and consistently fly out the window on the platform.  You can't pick just one language, or one dev standard, or one abstraction model.  That's one of the reasons it's hard for people to get into Domino development from scratch.  You use Java in an agent, but not in a view event.  You can use Lotusscript in a view event, but not in a view column.  You can use @Formula in a view column, but not in an onKeyPress event.  You can use Javascript in an onKeyPress event, but not in an agent.

Over the coming weeks, I plan to post a series of articles on writing maintainable code.  And I'm going to combine this with another series I've been meaning to do on emergent technologies on the Notes/Domino platform -- specifically Xpages and Expeditor -- by talking about how these new capabilities provide us with new dangers and new opportunities to create solutions that last.

I hope you'll tune in and participate.

Comments

1 - I wonder, sometimes, how much experience you've got coding big things in other tools. I've never met one that wasn't "Hacktastic" when got down to it. Even Java, which is fairly rigid in how most people use it, CAN be used in a million different hackable ways.

2 - Looking forward to it, and particularly interested in noodling around how XPages, etc, will make some things easier and others more difficult (for 'easier' and 'more difficult' feel free to insert more relevant terminology for a given situation)...

3 - @1 - "I wonder, sometimes, how much experience you've got coding big things in other tools."

I'll freely admit: very little. A few smaller things here and there, but nothing even remotely on the scale of what I've done in Domino.

Does that change my ability to evaluate whether a given piece of code on THIS platform is an unmaintainable mess? Please rest assured, I intend to give copious examples of what I'm talking about.

I even intend to use an approach of yours as a negative example. Emoticon So there. Emoticon

4 - @Nathan - I think its interesting going this direction after just posting your hack of modding UNID's to get a free do-it-urself hash table lookup for documents.

See, any platform has its hidden code, its backword hacks, and its oddball workarounds.

Visual Studio can be a nightmare in terms of figuring out where the code is that does what you want. That's pretty much all objects (not quite, but nearly) and yet the class structure it pre-builds for you and the IDE lend themselves to tucking bits of code right on the UI.

Javascript can be notoriously bad for it. Perl? Gack, its like reading regex. Anything built on the J2EE platforms?

The real issue is that people want to compare "Domino" as a development platform when in fact its closer to a operating system. It has services (smtp, indexing, caching, memory management, hardware isolation, directory services, etc..) and it has file storage, network access, and so on. You build within it. If you step back and squint a little, its fairly easy to see a comparison of a "DOMINO" server with a "Linux" server (if you include the packages in the linux drop).

Agents == Shell Scripts
Documents == Files
SMTP == SMTP
NAB == (various directory and user systems availabe in linux)
ACLS == File Rights

You can go on and on and on that way. So yeah, you can bury a lot of code in wierd places in Domino. But don't compare it with Java -- that doesn't even have a data storage mechanism of its own. Its hardly comperablel. You can compare Lotusscript with Java or C ---but in fact its closer to Javascript.

I think if you open the requirement wide enough to include all of the things a Domino server provides -- or if you narrow your scope to include just the scripting languages that are a fair comparison, you'll find Domino code comes out quite favorably.

5 - Sounds fun. I've always wanted to write a similar article... maybe one day when I get off my butt and actually make my own blog...

IMHO the biggest barriers to developers learning the N/D platform is (1) you HAVE to learn multiple languages to be able to build a fully-capable app and (2) they are "new" languages for most:

@Formula - a must, obviously, if for no other reason than views. Since views are your main lookup mechanism into DB data (and view are UI mechanisims in many cases as well) you've simply got to know them. @Formulas rock in many ways. They're ultra-terse (arguably as good as cutting-edge languages like Ruby in that regard). But it's not OO and code reuse gets clunky quick.

LotusScript - Most of your Notes-client UI hooks only work with this language. Better learn it if you want to write Notes client code.

If you're only developing for the web, you can ditch the LS requirement and replace it with Java (or Javascript in many cases once 8.5 is out).

6 - Agree fully on maintainability.
Its not domino specific. I've seen no bigger Java project, which does not suffer major parts, that have serious maintainability issues, though its exactly understanding of design patterns and those frameworks like spring that really have a huge potential in supporting this maintainability thing.
And: Self-written Multi-Threading stuff did cause difficult to track issues in 3 out of 3 projects that were having such. And in 3 out of 3 cases there has been allways a developer who declared self-written multi-threading stuff as actually being simple, "once you have grasped the concept". Its clearly not. Emoticon
Java/J2EE/EE5 has a potential to make code that tackles complex problems more maintainable. Of course not automatically. It requires experience and awareness of maintainability issues from developers/architects.
The main reasons for maintainability problem in Domino projects are from my experience:
a) history -> projects from 98/99/00 often use really smart (without irony) hacks, that are difficult to reverse engineer today, because they are not needed anyway as there are simpler ways to tackle the problem.
b) the many Admins and noobs recruted for some software development adventures. Experienced Domino developers do nearly allways think a lot about maitainability. Ocasional developers can't for obvious reasons. Still to many responsibles for software project management are not aware of the subjects importance and complexity.

7 - Very interesting discussion. Simplicity and maintainability is often in the eye of the beholder. There are many aspects to those two concepts: lines of code, ease of debugging, extensibility, built-in and external libraries. I've met plenty of people who don't want ANY Java code (for example) at all, no matter how simple or powerful it might be. Because they just don't know Java.

The only way you can have choice at all is to learn and understand multiple languages. Otherwise the world gets broken down to "this one language I know, and all these others I don't know". In that case, the one you know will always win.

8 - I agree with @1, you can write procedural java code, so it's not a language thing. In terms of when to use what, sometimes it just comes down to experience. I think that having the ability to code in different language means that it is easier to pick (based on experience) the correct tool - most of the time. And I agree, give me readability over brevity every time. Maybe thinking about the developer interface with as much care as we do with the user interface would be a good goal.

Looking forward to the next post Mr Balls!

Emoticon

9 - I think you include extensibility in maintainability but I like to call it out explicitly. I use extensibility to mean extensible in ways not anticipated by the designer/developer as opposed to maintainability by factoring out the things that change via patterns etc.

Looking forward to the series.

10 - @Andrew, sure, anything can be used badly. I didn't read that particular section of the post the same way, I guess, because to me Nathan was simply describing how Notes/Domino has chunks of code in about a million different places within its IDE, and many of those different places require different languages, and that leads to a maintainability challenge. I can build up my own unnecessarily convoluted (since we're talking about stuff that's difficult to maintain) class structure in plenty of O-O languages, but the code will all still be in classes and it will be in that particular language. If it's a web project, it will have JavaScript, CSS, and HTML elements to represent the front end, and maybe Java or perl or python on the back end, with a SQL database to talk to. Sure, that's a few moving parts. But I would argue that it's much easier to find the relevant code in that environment than in a complex N/D system (caveat: yes, I know all the tricks to get around the issue, and so do we all, but that doesn't mean there is no issue to begin with).

11 - @7 - Where did I compare Domino to Java? I only pointed to an article where someone else was talking about languages as related to the JVM, because Julian brought it up in terms of languages. Are you expecting a series in which I say "in Domino you do blah blah and blah, where in Java you'd just do blah?" If so, you're going to be disappointed. That's NOT where I'm going with this. My reference to well-designed classes is merely one small example of the point/counterpoint I have in mind.

12 - { Link }

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Search 

Disclaimer 

Welcome to Escape Velocity!

Opinions expressed here by Nathan T. Freeman are not necessarily those of his employer. However, there's a decent chance they are, so check with them if you really want to know.

But really... do you need that kind of validation? Are the opinions expressed here in doubt?

MiscLinks