Posts Tagged ‘Programming’

Java is the new Cobol, of course. How else can it be? Enter Eclipse Xtend.

Saturday, November 5th, 2011

I just saw an announcement of a new programming language from none other than the Eclipse group, you know of the Java IDE fame. A very quick scan of this new language, called Xtend, it looks like they’ve borrowed a bit from Groovy, something from Scala and maybe something from CoffeeScript. The fact that this language is directly supported by Eclipse IDE is a huge advantage, and that may be to the detriment of Scala which still hasn’t got a great IDE support yet. I think this move by Eclipse may also be a preemptive strike against JetBrain’s Kotlin. If the community picks up on this then I expect initiatives like Redhat’s upcoming Ceylon programming to struggle in gaining any foothold.

I’ve been wanting to write a post on how I thought Java just wasn’t good for programmer productivity, seeing this announcement encouraged me to finally post it. I did something with JBoss Seam a few months back, took a step back to look at the code and thought to myself what a waste!. I can’t believe anyone in 2011 would want to create new code using JSF for example, it simply feels wrong.

From the moment that I renewed my focus on functional languages, I find pure Java code to be an eyesore, the web tooling around Java are simply atrocious compared to what you can do with functional languages like Ruby, Clojure or Scala. Clojure way well be the most elegant of the lot, I like it so much that I’m increasingly considering doing more hacking than I’ve done in years.

Competition is a good thing. But I’m wondering if Xtend is a more of a Groovy clone and if that could be such a good thing for the wider programmer community. I haven’t written a single line of code with Xtend yet, this is just a spontaneous reaction, in fact a post I had drafted about Java as the new Cobol, but refreshed in the light of this announcement by Eclipse.

The traditional IDEs should go on a “diet” program

Saturday, July 9th, 2011

These days I do a lot of rapid prototyping, turning around small but fully working apps fast is my equivalent of PowerPoint slides. As you do this, you realise just how much of a resource hog the integrated development environments (IDEs) have become (always have been?). And there is really no good excuse for this. Sure, computers are getting faster and cheaper, and the traditional IDEs seem intent to make sure you never realise the benefits of that.

I’ve worked with many popular IDEs over the years, the ones I’ve used most are Eclipse and IntelliJ IDEA, and Microsoft Visual Studio (memories of Powerbuilder and Borland IDE are still there). The one constant thing I’ve noticed with IDEs is that user waiting time is steady, it is getting longer in some cases, not shorter. Aside from code refactoring features there’s nothing fundamentally new to these tools. Somehow you always need the top of the range computer to run traditional IDEs, and if you’re running anything else at the same time such as a word processor, or a database then you might end up spending a lot of time waiting for your computer to give you control.

Why are traditional IDEs lagging behind (actually hindering) the performance gains afforded by the hardware evolution? I think one possible cause is that these IDEs are still failing to become truly modular. Various efforts to tune the IDE into understanding the user role remain too timid, you get a little less clutter on the toolbars and windows here and there, but the start/stop time and various frequent activities remain painfully slow, because the stuff is just too heavy for no particularly useful reason. This topic actually ties in to my rant about virtualisation still failing the desktop power user, more on that on another blog posting.

On the other hand, text editor centric IDEs are quite nippy. Take TextMate, Emacs, VI, you get to work much quicker and spend most of your time doing work rather than waiting for the tool to complete some task. These tools do offer code completion and search, what you really miss is perhaps the refactoring and interactive debugging capabilities. And I think those aspects are becoming less relevant, test-driven development in a good agile process makes debugging unnecessary for the best part of the development lifecycle. If these practices are combined with something like behaviour driven development increases the odds of producing good quality code. The programming language really helps if it’s less verbose, in that sense I’m starting to think of Java as the new Cobol really. Languages that are based on functional programming are such a tremendous help in thinking clearly, writing less code and spending less time with infrastructure stuff.

The emergence of web browser based IDEs such as Mozilla ACE might provide a serious challenge to the traditional IDEs, and that would be a good thing.

Programming language review whirlwind

Monday, May 9th, 2011

Every once in a while you get a chance to evaluate various technologies for their suitability to a job. I’ve reached one such time, and the task is about taking a fresh look at the programming language and platform for this particular project, pick the most adequate. I’d forgotten how much fun such a journey can actually be.

In this initiative, I got inevitably drawn on the popular functional languages that many in the open source community thrive on. I’m glad I got to do this, it made me realise that I was drifting away from some of my earlier and most consistent mantra: reducing waste, fighting off verbosity in the way we build solutions.

The languages that I’ve evaluated and compared in this initiative were: Ruby (and its ecosystem), Scala, Groovy, Python, Haskell, Erlang. Why didn’t I do this earlier? It’s simply crazy not to have done so earlier and often. I’ve now learned my lesson, I’ll be doing this regularly from now on.

When architecting solutions, writing ‘no code’ is the nirvana. This being the real-world, fighting off verbosity and tedious repetitive stuff is the most efficient way to solve problems. Functional languages provide the best platforms for addressing modern computing needs.

Information Systems Architect should write solid code, Part 2, how?

Thursday, April 8th, 2010

In an earlier post, I stated that an Architect should write solid code. I’ve also tweeted about this, pointing out that an IT architect who doesn’t code cannot be trusted. To illustrate my point, I chose a fictitious test case organisation, Trotters, where Kermit works as an Architect. I described some of the consequences when someone like Kermit is far removed from code. If you are interested in this discussion but haven’t read my earlier post, I invite you to do so here.

In this post I will discuss some of the ways that Kermit could write code to make the architecture practice more effective in his organisation.

To begin with, here are some more (bold) statements – I could always prove the points at a later stage.

  • If you can draw diagrams, you could also provide framing code base that realise the diagram
  • If you cannot create code representative of the diagrams that you are drawing, then either:
    • you are unsure how to do this (no further comment on that), or
    • your ideas are not fully fleshed out yet (so you are not done), or
    • you are reluctant to get into the details, for some reason
    • In any case, this is a problem.

Writing wireframe code goes much faster than writing long documents, and it harmonises interpretation much more efficiently. Text and diagrams leave a lot of room for interpretation, every programmer is likely to interpret things his/her own singular way.

Code is the most efficient way to convey ideas to programmers. Architecture code should be embryonic, a starting point for a solution. Architecture principles help when they define some ground rules for composing solutions out of components, the boundaries and contexts of these compositions and the special conditions that should be guarded. All this can be expressed much faster in wireframe code, than in complicated text.

How should Kermit go about this?

To simplify I will focus on web application as the solution domain for Trotters. Kermit and the team are working with object-oriented (OO) design and development concepts, they standardise on UML notation. They could be programming on Java or .NET platform, that doesn’t matter here.

Here is a simple guidance for Kermit:

  • UML supports drawing component diagrams. Kermit has probably designed a layered architecture diagram. Therefore, Kermit can create equivalent UML artefacts in code by designing classes for relevant components using the most appropriate realisation path.
  • Components in a layered architecture will typically interact via interfaces. Kermit can create (mostly one-to-one) interface classes between each connection points in the architecture. OO design skills are necessary to do this right. This is a first test of Kermit’s ability to say it in code. This can be further refined when for example using a concept such as design by contract, of which ample free resources can be found on the Internet
  • Boundary conditions and constraints: modern programming languages like C# or Java offer an array of features to deal with constraints. (similar concepts are fairly trivial in other languages) In addition, boundary conditions and constraints can be expressed in test harnesses, in turn included in the codebase as part of a continuous integration setup. Such productivity measures are invaluable and they often teach teams aspects of the solutions that might not be trivial, let alone described in text documents.
  • Enforcing architecture: this aspect is made trivial when considering the development environments (IDEs) available to programmers these days. These IDEs ship (or can be complemented) with code analysis and validation tools. The most recurrent patterns and errors can typically be verified with little or no effort, thanks to the richness of the validation rules that are available for these tools. An organisation like Trotters, as discussed in part 1, is typically weak in this area, and that is a shame.

Once expressed in code, the following become enabled:

  • Efficient two-way feedback on the architecture: programmers can immediately spot any issues and raise them for resolution with the architect. Kermit’s ability to communicate in code will come in handy, as he is able to grasp implementation issues quickly and can improve his design in the process
  • Enforcing architecture principles: nearly every modern programming environment offer tools for validating code and testing boundary conditions.
  • Platform constraints are immediately brought to light: with architecture code, architects and programmers are immediately confronted with infrastructure constraints. This makes it possible to analyse the situation, convey feedback quickly to all stakeholders before anything is really built. This helps in reducing gaps in expectations across all groups.
  • Guarding against basic mistakes or repetitions: there are elements that are typically common to every solution in a given business domain. There is no value in painstakingly recreating such elements, as that would only expose Trotters to unnecessary mistakes (typing, errors or omissions due to human factors, learning the hard way).

An easy argument could be to claim that Kermit, as an architect, does not have enough time to delve into programming details. Another easy argument would be to claim that should Kermit delve in code, he would be overstepping his role (micro-managing?), or that the programmers’ creativity could be hampered. Such arguments are easy to bring up, it is very tempting when one knows nothing better to do. But such approach is misguided, in most cases. First of all, I argue that an architect can write solid code much faster than he/she can create useful documents with legible text and diagrams. A second reason why I think this is misguided, is that the tools and techniques available today are amazingly powerful and simple to use, not using them to their true potential equates to disservice to the organisation. As a way to illustrate this last point, I’ll take a totally unrelated example: as I look over the shoulder of some people using Microsoft Word, I’m often amazed to see how they go through the pain of manually formatting documents by inserting spaces and page breaks. These people don’t seem to be aware of features that were in the product since version 2.0! (the first I’ve used). That is the point. And this example is actually nothing compared to the inefficiencies caused by programmers and architects enforcing early 90′s work processes with 2010 generation of tools and techniques.

To summarise, if you can express architecture principles in diagrams and text, be sure to also express them in solid code to reduce communication gaps. I call this: say it in code. Users typically don’t relate to design documents (architecture is part of design in this context). Often case, design documents would pass approval gates without users noticing faults or shortcomings in them. And this should be expected, precisely because users hire architects for their solution skills and experience. Architects shouldn’t expect that users could validate solution architecture, which is what normally happens a lot – again I’m using the term users in a broad context here. On the other hand, once solutions are shown to users, they can more effectively provide meaningful feedback. So, Architects should express technical solutions in solution, and code is the closest form that can be less immune to human interpretation induce deviations.

So far, I’ve focused on the application architecture aspect of the Architect role, in my simplified view. Looking at the broader architect role, including business analysis and infrastructure design, saying it in code will involve other aspects that I won’t analyse too much here for a number of reasons. This posting is already quite long, I’m still trying to keep it short enough yet complete in its illustration. In future postings, I will tackle these other architect roles.

In the next instalment I will explore the limits of this concept. If I get more time, I will develop the concept further for Trotters by showing specific examples of the type of code that Kermit would be writing to help his organisation (eat your own dog food idea).

GO, a case for a new programming language

Thursday, November 12th, 2009

With the advent of Google Go, there’s a renewed debate on whether we needed a new programming language. Actually a case can be made, for a niche player or an organisation with the right momentum to develop and maintain a new programming language.

No programming language will ever be fit for all purposes. Microsoft, among others, understood this and catered for it as they created C# and many variants of CLR compliant languages. As the technology platforms evolve, it should be natural to factor in the lessons learned and try a new approach.

In fact many already maintain Domain Specific Languages (DSL) without necessarily thinking of it as a programming language. Martin Fowler, @martinfowler, talked eloquently about the subject on his blog. In the Java world for example, template engines provide a really powerful method for organisations to become even more productive. With the right architecture, a lot of development and testing time can be cut if developers and architects can set up a good infrastructure to leverage the power of these tools.

If anyone can come up with a new programming language and be successful with it, Google can. When Chrome came out we were wondering the same thing, whether we really needed a new web browser. Now then? Another really interesting thing about Google GO is that the architects made a very clever choice by making it easy to learn for C or C++ programmers. This lowers the learning curve significantly, even good Java developers will be able to pick up GO quickly. Some of the concepts of Google GO seem to be inspired from Objective C, another big win there because Objective C has some really elegant constructs.

So there you GO, building on proven concepts, just like C# did when it came out, Google is bound to deliver the goods. I expect this language to grow fast because it can potentially leverage existing libraries. The adoption will be easier when appropriate tooling start to emerge. I foresee an approach like Google Web Toolkit, as a path to building bridges towards existing language platforms or runtime engines. If the compiler is as efficient as advertised, GO might just give Google a kind of unifying language that helps reduce software engineering effort by taking away deployment platform concerns. Microsoft is busy with a similar approach, their Oslo project and LINQ efforts are indications of the sort of goal that can be sought. I can’t way to start playing with it a bit.

Project Volta: Microsoft is quietly redefining web application development

Monday, January 14th, 2008

Microsoft might be up to something that would really boost programmer productivity. What took them so long? I suppose the tools are maturing, I bet Open Source has been of tremendous help, programmer productivity tools are getting so much better.

Anyway, Microsoft appears to be incubating something that is long overdue: a tool that makes it possible to design and build web application coherently ignoring the front-end/back-end chams, then deal with component deployment on web tiers much later. The potential productivity gains are obvious, this could herald a small revolution on its own. With all manners of aspect orientation and dynamic scripting languages available, this is clearly the next logical evolutionary step.

At first, specialist front-end developers might look at this with suspicion, but the model is definitely sound. At some point the hype will kick in. Check it out: http://labs.live.com/volta

Modality obsolescence

Saturday, December 1st, 2007

Now that we have got all manners of multi-core and kernel mode programming I think modality should be on its way out. Few things are less irritating than an un-responsive computer, computers should always respond full stop. With GUI systems, modality is often the cause of computer freezes, regardless of the ‘root cause’ of the issue. It’s the lack of modality in Unix system command line interface that make them mostly manageable and more resilient.

In the early 90s Microsoft Windows programming involved creating well … ‘windows’ and ‘dialogs’ in C++. The same thing could be achieved with Visual Basic and various other development platforms. Dialogs could be modal or non modal. You relied on the underlying messaging system to orchestrate functionality between modules. The whole concept was fairly simple, the complexity really came from the high number of APIs and libraries to code against. With C++ the other half of complexity came from the challenge for programmers to write code that truly reflected what they really had in mind and what they really ought to know about the tools and platforms being used, a gigantic ‘expectation’ gap. Writing my first dialogs and seeing ‘hello word’ was an exciting moment. Microsoft Windows and most graphical user interface systems still build on the fundamental concepts of ‘modal’ and ‘non modal’ dialogs and windows.

Looking back I think modality’s raison d’etre was and still is to try and preserve the integrity of the data being manipulated. You wanted to be sure that the program’s context is in a predictable state before proceeding further. This is inherently a sequential concept that ought to be left behind soon. In a true parallel computing world I would expect hardware and software modules to be even more self-contained, able to ‘move on’ if some desired state was not reached. This should rid us of computers totally freezing under certain conditions. This might never happen with silicon chips based Moore Law abiding platforms. Perhaps nano technology would help if it departs completely from ‘old’ models. Off to learning a bit about nanotechnologies then. Who knows.

Easy coding doesn’t cut it if you’ve got “business autism”!

Friday, July 20th, 2007

One thing remained invariant about programming: it’s not easy to design good software.

Over the last two decades barriers to entry have come down dramatically. Good tools are now available very cheaply, sometimes free as in free beer. Beginners’ can find loads and loads of easy guides to learn from and sample codes to copy/paste. Web site development has known a similar rapid evolution, culminating in toolkits like Ruby On Rails, Django, Symfony to name a few. There’s a lot of good news for those who want a piece of the action, build their own web site cheaply and quickly. That’s the extent of the good news.

The not so good news is that easy tools don’t make up for unimaginative design. I’m stretching the definition of design here, I know it’s a wide topic. You have to have a good grasp of the problem at hand, you have to have a good approach to solving it, then you’d need to make the right choices while executing your action plan. This is absolutely not a given, the abundance of tutorials and guidebooks is not enough to help one resolve specific issues. In a sense every problem is unique in its context, there’s a tendency to draw parallels between completely unrelated environments or problem domains. The one sure recipe you could apply to a wide variety of problems is know-how and experience. These are mostly available in human beings, not in codes or books.

What often happens is that reality is given distorted views by men in a rush to get quick results. With all the O’Reilly books around people think it’s easy to run development projects, estimations come easily: once you’ve seen a “hello world” example you’re ready to take on anything. Given the right amount of pressure even very knowledgeable people would yield to such simplistic views sometimes. Once you’ve got a bad solution out you are starting with a wobbly legacy, you and your organisation could be in for a roller-coaster ride. That’s when you realise that Ruby On Rails, Twisted Matrix or Django are not the answer you were looking for. By that time lots of money has been spent, damage is done, trust and confidence are in tatters. You’d think people learn from such mistakes, you’d be wrong. What happens next is that someone new comes along and start recommending yet another silver bullet, this time DSL or Ontologies is the answer to all ills. Organisations take the plunge again, not wanting to be left behind.

In IT a good solution starts with a good problem statement within a given context. To give an example i was once out window shopping, checking out the latest digital televisions in a shop. The shop assistant offered to help, I told him that I was comparing the price/value ratio across the various brands and pondering if it was worth shooting for the highest specs. Assuming that I was a total newbie, he suggested to me: this model over there is my preferred one, I’d recommend it to you because it’s got this easy on-screen setup menu. This remark made me smile because the shop assistant didn’t realise i wasn’t worried about the setup at all. I actually had spent hours reading up (boring) technical documentation about HD-TVs offering in the market, I knew what I was looking at. Once the device is setup you often keep it that way and enjoy the rest of the experience. Spending big bucks for an easy setup was not a good answer. This man was not likely to solve my problem, he simply didn’t understand what I needed yet he was offering a “good solution”. I call this business autism, each party is in his own bubble unable to communicate properly to the other. This kind of situation is probably very common in IT projects, I’ve experienced it many times and often look for signs that it is occurring before talking solutions.

Surely the frameworks mentioned are good at solving certain categories of issues. No doubt that in .NET and Java world you will also find good frameworks such as Spring, Struts, JBoss Seam or Atlas. What is wrong is rushing out and implementing these frameworks without carefully considering the problem domain and even the solution domain. If people would spend a little more time listening very carefully to their users or clients, they’d save a lot of frustration and waste during projects and beyond. Not having the right listening skills or solution solving skills is hugely detrimental to a successful IT endeavour.

A lot of shortcomings can be addressed once identified. Business autism is very difficult to diagnose, the inmates are running the prison. Help can only come from outside, if it comes at all.

Google Mashup Editor illustrates what DSL initiatives ought to strive for

Saturday, June 2nd, 2007

Google created a set of custom tag libraries and an editing tool, all this rely on back-end service through public API libraries. The construct is familiar enough, except that most organisations fall short of creating a solid toolkit correctly (the tag libraries and the development tooling part). Before I explain why I’m making a parallel with DSLs some preamble is in order.

DSL (Domain Specific Languages) is all the rage these days. The IT industry is addicted to acronyms, TLAs are the favourite (TLA = Three Letter Acronym). If you look beyond the hype, you’ll see that some of them do have value potential. One such TLA is DSL, companies on the fringe are focusing laser-sharp on it. The little i know about Intentional Software tells me that they’re very active practising DSL for their clients. It’s a smart move for any seriously ambitious company today, considering the amount of waste generated by IT. Just like people are worried about Global Warming, companies should be worried about Global IT Waste (GIW, my own TLA for today).

One of the rich tenets of DSL is that your teams would create a special-purpose language (a programming language a-la-IKEA if you like, but your very own) that befit the specific business you’re in, beautifully simple, flexible, functional, fit for purpose. Such language becomes the foundation for your programming toolset, hopefully shortening the turn-around time to produce valuable software while providing all the flexibility you’d ever want. Most of your focus would then be on building and maintaining glue-code, logic that binds your specific constructs with vendor solutions out there (vendor here include Free Open Source Software just the same). If you can imagine what I’m talking about here then this is the closest thing to software development nirvana.

Therein lies one of the problems, nirvana is not easy to reach therefore it’s just not trivial to execute DSL right. The clever move is to not so much see it as an end goal, but rather aiming for it as a continuous tuning exercise achieving greater levels of refinement steadily. Chances are that you and your organisation would reach your own nirvana and won’t even recognise it.

Microsoft has a lot of smart people that understood the potential for DSLs and they are cranking out tons of products and practices that help organisations with DSL. I am begining to see why they distanced themselves from the OMG’s UML evangelism, it’s a mind game that is best played with focus and purpose. It might not be very obvious to all today but I would bet that Microsoft’s efforts will ultimately achieve many of their goals [assuming they stay the course, not go revamping their frameworks and librairies every 15 months].

Really good DSL initiatives are set for the longer term, the value grows almost exponentially as the initiative matures. The reason is that it’s a tuning game, you don’t succeed in one step unless your business is simple or trivial. All of this is counter intuitive for many, most companies approach IT endeavours on a per project (hence per budget) basis and sometimes driven by middle management musical chairs. If you’re going to change executive direction/team every other year then there’s little point in adopting DSL. If you’re gullible product marketing would have you believe otherwise, fair enough, define “correctness”.

IT today has matured so much that really good programmers can achieve unheard of productivity. DSL works well for such people and the [preferably] stable organisations that employ them. If acronyms like BNF, LR, LALR sound strange to you then you’re probably not ready to seriously embrace DSL. Do yourself a favour, ignore DSL and your life would be easier. If you think that object modelling is enough to qualify what you’re doing as DSL then I’d say suit yourself.

One way to look at Google Mashup Editor is that they’ve created a kind of DSL so that folks could quickly create mashups with Google’s products and services. It’s likely to be addictive for those that try, it will make you think… So far I wasn’t buying too much into all the fuss suggesting that Google was challenging Microsoft. But Google has been steadily making many of the technical moves that makes me envy them. I have to give it to the analysts for their foresight, Google is on to something really big and they have the right approach to technology.

If you are one of those companies wondering why your IT teams struggle so much to deliver what you want, or that IT is “just not living up to your expectations”, I suggest you take a tour of Google Mashup Editor, find out about DSL as discussed in this context and tell me what you’ve learned. If you’ve read this and followed my advice I’d love to hear from you, right here. Go on then, I’m patient.

Linus Torvalds Outburst Sparks Fierce Debate: Does Open Source Software Need Specs?

Sunday, October 9th, 2005

Specs are useful when written by authoritative people and with specific goals. You need specs to solve issues like interoperability, defining metrics so that all stakeholders are aligned on what was built (or what is going to be built, as is often the case).

When specs are aimed at some political agenda, then Linus’ point is relevant. I guess in this industry, specs have often being driven by political agendas rather than solving particular problems.

More on this topic: Linus Torvalds Outburst Sparks Fierce Debate: Does Open Source Software Need Specs?