BT

Moving away from exclusive use of OOP and Curly Brace Languages to reduce code waste?

by Sadek Drobi on Oct 03, 2007 |
Bob Warfield argues in his recent blog article that at least 70% of code is written to build components which would be taken for granted by the client because every comparable product offers them as well, e.g. forms, UI, database connections, messaging, data feeds, caches… He views this code as "wasted" because it does not add any competitive differentiation to the final product.

And for this reason it is condemned to be very average because it wouldn’t matter for the business anyway. Warfield calls it “a tax on innovation.” Programmers are "constantly reinventing the wheel" building the same components over and over again and often from scratch. This issue has also been raised by Albert Wenger who believes that there is a need for a new platform providing out of box features whereas Warfield advocates for facilitating code reuse.

Warfield is aware that “programmers hate to reuse code because they hate to read and understand" it. He argues however that this is not inherent to the nature of programmers but rather due to the fact that employers “rarely invest in letting their developers learn” and to extensive use of C-driven languages. Warfield believes that these "Curly Braced Languages" do not help to reduce the code waste and to facilitate its reuse. They are all descendants of C which was created to build Unix and which is considered a Systems Programming Language characterized by its ability to create “most difficult types of software, such as operating systems” and to “get down to the finest levels of detail without making any assumptions.” However, these Curly Braced Languages are commonly used to build Application Software:

So what happens with my Curly Brace Language when I want to do Application Programming instead of Systems Programming? […]It can talk to your hardware, but scarcely knows your operating system. […]Without an Application Framework, Curly Braced Languages can’t do much except write, “Hello, World.”

Even though these frameworks are “supposed to be standardized so everyone can reuse that code", they are numerous and hard to learn. In the same time, these frameworks do not really provide solutions for the code waste since they do not provide features for building the 70% of components which are undifferentiated. Albert Wenger also believes that today’s industry is “using tools that simply were not made for the job.” According to Warfield, to reduce the waste of code and to improve its reusability, it is necessary to “forget the Curly Braced Power Tool perspective for a minute” because these tools are to be used for building components which would create "the proprietary advantage"

The “70% of functionality that is undifferentiated” could be build using simpler, service-oriented approach that would minimize the potential learning burden is the code components were to be reused. Warfield believes indeed that SOA is more conducive to code reuse than OOP which is “ about controlling the fine grained behavior of objects in intricate ways” and makes many things “happen implicitly and in many and varied locations” resulting in a less readable code. In the second part of his post, he elaborates on the advantages of moving away from using a single, Curly Braced, Language:

Those languages are too low-level. There is no support there for multi-tenancy, web pages, security, scaling, or any of the myriad of problems one encounters when building a Web 2.0 or SaaS business. You have three choices: write all of that yourself and pay the 70% overhead tax or become a Polyglot Programmer and minimize the overhead by choosing the best tools for the task and leaving your Curly Braced Power Tools safely in the workshop only to be brought out when some highly custom proprietary work needs to be done.

Warfield refers to the idea of polyglot programming developed by Martin Fowler and Niel Ford and gives the example of some “smart companies” which, in his opinion, have already adopted this approach: Facebook, Amazon or Google that have created “their own Component Architecture Frameworks or Core Technology”.

One can argue that C++ isn’t really the language of Google; rather, MapReduce, BigTable, and the Google File System are their language.  C++ is just the assembly code used to write the modules that these other platforms mash up.  In fact, it makes sense to think that C, Java, and C++ are all just portable assembly languages.  

Warfield believes that this kind of approach enables companies “to focus a much greater proportion of its resources to create a proprietary edge for itself.” Moreover such a language agnostic approach makes it possible for these vendors to build a platform that would offer solutions to reduce the innovation tax, a platform Albert Wenger would like to have, “created from the ground up to enable modern web sites and applications.” 

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

A hunch with some sloppy thinking by Dean Schulze

Warfield doesn't present any evidence to support his assertion that 70% of code is "wasted" or duplicated across applications. He just made up the number, apparently.

One potential solution Warfield offers is for developers to reuse code via cut and paste. The fallacy in this idea is that it takes time to find the appropriate code, read and understand it, make any modifications needed, and then test it. I doubt there is any long term savings to this approach.

Warfield seems oblivious to the progress that has been made in reducing "undifferentiated" code over the years. If you have written ODBC code by hand you know that JDBC takes an order of magnitude less code than ODBC (maybe 1.5 or 2 orders of magnitude less). JPA cuts that by probably another factor of two or three.

As far as the SOA approach Warfield proposes, since when has SOA been easy to implement?

Warfields premise is unsupported, his analysis is sloppy, and his proposals are superficial. This is one of the lamest articles I've seen in a long time.

Re: A hunch with some sloppy thinking by Valentin Rusu

Completely agree.

It's amazing that, after saying "programmers hate to reuse code because they hate to read and understand it", ha adds : "Facebook, Amazon or Google that have created “their own Component Architecture Frameworks or Core Technology". Isn't he suggesting to continue reinventing the wheel ?

Poor article by Dean Jones

I'm surprised to see such a poor article come up on InfoQ, where the standard is generally pretty good. It does demonstrate a truly staggering level of ignorance:

- he claims that Java and C# allow you to "talk directly to the hardware", demonstrating that he is unaware that Java and C# run on VMs

- he claims that "a staggering amount of work goes into recreating" UI components, demonstrating his ignorance of UI toolkits

- he states that "caches and similar contrivances get recreated over and over again as traffic builds up on your web site", demonstrating his ignorance of the large number of caching solutions available

- he claims that "C, in its day, was far simpler than Algol or PL/I or even COBOL. C++ was simpler than the overblown Ada", suggesting that he is not even on nodding terms with these languages

- he confuses completely orthogonal concepts (open-source vs object-oriented)

He even includes a seemingly invented statistic ("70% of the Software You Build is Wasted") without referring to research that would back it up. I'm just surprised that he hasn't put in any graphs to back up these spurious assertions.

I hope he's just a sales or marketing guy who has made the mistake of writing on a topic outside his area of competence. I sincerely hope he's not a coder or involved in any decisions related to coding.

Re: Poor article by Sadek Drobi


- he claims that Java and C# allow you to "talk directly to the hardware", demonstrating that he is unaware that Java and C# run on VMs

Well personally, I see his argument is about focusing on the “why” rather than the “how” in the programming language level, rather than about having a VM that abstracts the real hardware. I guess that most of his argument, no matter I agree with them or not, are bound to the context and cannot be taken literally out of that context.

- he claims that "a staggering amount of work goes into recreating" UI components, demonstrating his ignorance of UI toolkits

I guess that what he argues about is not library reuse, as libraries are hard to learn, but platform solutions that come with a context. For example take Rails that abstracts all persistent and a lot of other “for granted” mechanism to let you focus on your domain.

- he states that "caches and similar contrivances get recreated over and over again as traffic builds up on your web site", demonstrating his ignorance of the large number of caching solutions available
The same as above.
He even includes a seemingly invented statistic ("70% of the Software You Build is Wasted") without referring to research that would back it up. I'm just surprised that he hasn't put in any graphs to back up these spurious assertions.
I guess that the number here is not important. I guess we can agree on how huge code waste we have because of reinventing the wheel. Rather, we can read the number as an observation of his own experience.

Re: A hunch with some sloppy thinking by Sadek Drobi

It's amazing that, after saying "programmers hate to reuse code because they hate to read and understand it", ha adds : "Facebook, Amazon or Google that have created “their own Component Architecture Frameworks or Core Technology". Isn't he suggesting to continue reinventing the wheel ?

Facebook, Amazon and Google are platforms with a lot of applications. They did “their own Component Architecture Frameworks or Core Technology" to avoid reinventing the wheel, and they interface to these platforms in the language level using DSLs and not by OOP library and api interfaces. He says that they already adopted the approach of polyglot programming.

Re: A hunch with some sloppy thinking by Sadek Drobi

One potential solution Warfield offers is for developers to reuse code via cut and paste. The fallacy in this idea is that it takes time to find the appropriate code, read and understand it, make any modifications needed, and then test it. I doubt there is any long term savings to this approach.
If you are referring to the “Open Source” part, when Warfield talks about open source, it is a simple observation that a lot of code is reused there in this manner, but he clearly argues that there is a big limitation to this approach.
And if you are referring “Software Developers are Producers Not Consumers of Code”, he clearly argues that such an approach is not enough realistic in today’s business context. And the core of his article is precisely about how to facilitate the code reuse.
Warfield seems oblivious to the progress that has been made in reducing "undifferentiated" code over the years. If you have written ODBC code by hand you know that JDBC takes an order of magnitude less code than ODBC (maybe 1.5 or 2 orders of magnitude less). JPA cuts that by probably another factor of two or three.

I agree with you, yet you are still manipulating tables and lines. Other ORM tools exist, but they still need a lot of your attention for persistence and database details and issues.
As far as the SOA approach Warfield proposes, since when has SOA been easy to implement?

It depends on your view of service orientation. Service-orientation, especially using simpler approaches to it like Rest, provides a more readable and simpler code. I think that it tends to be simpler when you think about SOA in a more technology agnostic way.

Re: Poor article by Sadek Drobi

I hope he's just a sales or marketing guy who has made the mistake of writing on a topic outside his area of competence. I sincerely hope he's not a coder or involved in any decisions related to coding.

I don't guess that he's just a simple sales or marketing guy writing a topic outside his area! :) see www.thewarfields.com/BobResume.htm

Re: Poor article by Dean Jones

Hello Sadek,

I had some trouble understanding your points, so apologies if I've misinterpreted what you are saying.


Well personally, I see his argument is about focusing on the “why” rather than the “how” in the programming language level, rather than about having a VM that abstracts the real hardware. I guess that most of his argument, no matter I agree with them or not, are bound to the context and cannot be taken literally out of that context.

He unequivocally states that Java and C# allow you to talk directly to the hardware rather than to the OS. Irrespective of context, or whether he's talking about about "why" rather than "how", this is at best a misleading characterisation of these languages, and at worst is simply not true.


I guess that what he argues about is not library reuse, as libraries are hard to learn, but platform solutions that come with a context. For example take Rails that abstracts all persistent and a lot of other “for granted” mechanism to let you focus on your domain.


If you choose to implement a web application directly onto Java, say, without using one of huge number of frameworks available to make this job easier, then you will have to write a lot of code that has already been written. The problem is, however, that the article gives absolutely no evidence that this is happening on anything like the scale claimed, or that this is a problem that is especially associated with the use of C++, Java or C#.

I guess that the number here is not important. I guess we can agree on how huge code waste we have because of reinventing the wheel. Rather, we can read the number as an observation of his own experience.


If you ignore the number, then yes, it's trivially true that some people write code where they need not. However, this is always going to be true, regardless of the language this they are using. This is not because people are using "the curly brace languages" but because there are always some people who will do a bad job.

The problem with this article can be boiled down to two points:
1. no evidence is given to support the basic assumption (70% of code is wasted)
2. almost all of the arguments that are made in support of the inference made drawn this assumption (that this wastage is somehow related to the use of C++, Java and C#) are factually inaccurate.

Other than that, I thought it was alright :-)

Dean.

Re: Poor article by Aaron Erickson

I agree - there is a lot of assertion and questionable premise in this article.

The conflation of "having a curly brace" with "too low level for application programming", not only ignores mountains evidence to the contrary, but is scarily wrong. Choice of start and end block delimiters do not a language make.

The ignorance and propaganda meter on this one ... wow!

Re: Poor article by Sadek Drobi

I agree - there is a lot of assertion and questionable premise in this article.

The conflation of "having a curly brace" with "too low level for application programming", not only ignores mountains evidence to the contrary, but is scarily wrong. Choice of start and end block delimiters do not a language make.

The ignorance and propaganda meter on this one ... wow!

:) curly braced is an adjective, used to refer to a group of programming languages that has a lot more of things in common than their curly braces. It is like saying c-based, or c-descendents! And the fact that they have curly braces is not the problem here (even if I think that it affects readability). I guess that the problem is their inherited properties that forces a very imperative style of programming compared to other families of programming languages like Smalltalk and Ruby. Yes C descendents are rather closer to the machine because they operate on "how" rather "what"! I program with C# often, and I am very happy that they introduce some functional programming properties that operate on a higher level of abstraction.
I am pretty surprised by these defensive reactions about "curly braced language», whereas I thought that drawbacks of these languages and their style of programming are getting somehow obvious today.

Greetings from the source! by Bob Warfield

Greetings!

Dean Jones was kind enough to write me a comment on my original blog, which I've responded to. It covers a lot of this, but I want to get my 2 cents in here too.

As some of you have suspected (and discovered easily on the Internet), I've built a lot of software and run a lot of software development organizations. I ran Borland R&D in its heyday with Delphi and Turbo C++, for example.

As to my assertion that 70% of code is wasted, you're absolutely right, it's a guess. But when you recall that by "wasted" I mean it isn't adding any proprietary value to your product, and that it performs a function every competing similar product has to perform, it isn't hard to believe the statistic. Most people I've talked to in the Valley tell me I'm too generous and the waste is higher.

I don't see anywhere in my article where I've advocated cut and paste reuse, unless you think of open source as that. I don't. I see it as adding modules and components to a system, but I suppose some might try to cut and paste it.

I also don't see where I've been oblivious to the reduction in "undifferentiated" code. Heck, I've admitted that Open Source has helped out greatly. It used to be a lot worse. Java has been a boon for OS portability to give another example. But it still isn't enough. Developers are still writing a lot of undifferentiated code.

While I mention SOA, I don't view it as a panacea or even the answer. A 'service oriented mentality' OTOH, is an important step. What I do advocate is polyglot programming where you chose from more than one language instead of only using the lowest common denominator to do everything. In each area, there is a language that fits best for the task at hand. We're partway there as most people do use SQL for databases and there are certainly langauge qualities in HTML, JSON, XML and many other things.

But consider for a moment. Many famous large web sites use a lot of PHP or Python. I could write another post about problems with those languages and annoy another group of people. But, I don't really want to annoy anyone. The "P" languages do a much better job of making it easier to do the web side of things even though their performance is poor next to curly braced langauges. To give one polyglot example, why doesn't it make sense to use the PHP's and Pythons to do the web side, Java/C# to do the performance intensive business logic, and SQL for the database? There are plenty of examples of big successful applications that do exactly that rather than do everything in one language. There are plenty of others out there, like Martin Fowler, advocating essentially the same thing.

Cheers!

BW

PS You can write device drivers in Java, Sun offers a toolkit for it. You can't get much closer to hardware than a device driver!

Re: Greetings from the source! by Dean Schulze

If you want to quit wasting 70% of your efforts on software, you’re going to have to discover a way to reuse code–preferably reusing code that (Gasp!) other people wrote anyway. Getting back to the service oriented perspective, true code reuse benefits from the service oriented perspective.


Your article is a lot of musing followed by these two sentences as a vague hint at a solution. It's just vapor.

In the real world reuse is accomplished by using an existing framework, rolling your own framework, or cut and paste.

Your article suffers from a dubious premise. Every car on the road has an engine, transmission, and 4 wheels. These are undifferentiated parts and are interchangeable. They add a lot of value to your car, however.

Undifferentiated code is the foundation on which you build your differentiating features. Those features couldn't work or even exist without that foundation. Minimize the undifferentiated code, sure. But your vapor offers nothing.

Re: Greetings from the source! by Sadek Drobi

Every car on the road has an engine, transmission, and 4 wheels. These are undifferentiated parts and are interchangeable. They add a lot of value to your car, however.


I’ve never heard about a Car factory that fabricates its wheels... What adds the difference is the customization, which is much more than being a normal wheel. That’s exactly what the article says. You get a kind of a domain specific language for customizing and parametrizing the already invented wheel to fit best your business model.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

13 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT