Tech-inzichten door Niek de Greef. Reflecties op technologie, software development en de impact van digitale innovaties op cultuur en maatschappij.

The problem with software

Software does not wear and tear. It does not break. It does not fade, evaporate or oxidate. Software is not affected by its environment. To update software to its changing environment code needs to be changed, by humans.

Another challenge is we can not proof that the software is programmed correctly. Testing helps, but: program testing can be used to show the presence of bugs, but never to show their absence (Dijkstra, EWD 249).

Software has become complex beyond comprehension. It resembles a dynamic system. Small changes in input can give major changes in output. Code is built on code and turns from structured material into amorphous mass. And we constantly change the input as well as the code.

So we must move to a different model for creating and maintaining software.
What we do today is gather requirements. From the requirements we build the software.
Then we test the software by translating the requirements into test cases (ideally – linking requirements to test cases is not such a generally adopted practice even).

Why not turn requirements in code, automatically? Instead of teaching programmers to create code, we should teach them to generate code. Then we can change the requirements, and regenerate the code. Or it can change/regenerate itself.

A recent article in The Atlantic discusses a coming software crisis. The remediation that is described in this article is to apply formal methods. This basically means we do not code but create a formal, mathematical model of the problem space. This model can then be turned into code. This code can be proven to be correct. The article explains how the existing formal methods, like TLA+, are still immature and there is still a lot of skepticism in the market on its applicability.

Formal methods have been around for a long time, but they never developed beyond an academic context. Translating more complex problems into formal models has proven to be very difficult.

For now, we will have to do with the current discipline. Which could do with more discipline.
Programmers often (must) start coding before understanding the problem, and having a comprehensive idea about the solution. They are caught up in the detail of programming. And modern languages (Java or JavaScript) do not make that easier. These nitty-gritty programming languages leave a lot of detail to be handled by the programmer – making it even more difficult to oversee a program’s complexity.

Also, a higher level of reuse should be encouraged. Every day in software you see programmers solving problems that have been solved for decades. Time pressures, and inaccessibility of existing code make programmers build yet another sort routine, search algorithm or data access mechanism. The building libraries of abstract, generalized libraries should become a common discipline among development teams.

Adopting a microservices approach (not necessarily the technology) will further help separating functionality, making the software system more flexible and therefore change-able.

I am a big proponent of coding for longevity but that is a very controversial opinion these days. But delivery speed is more important than delivery quality. Because things change so fast. Yes, this is true, but we oftentimes can not tell which code will last for decades and which code is quickly obsolete. So we’d better increase the quality of what’s delivered. And invest in methods and technologies that can help improve quality.

Google’s Documentation Style Guide – helping the writer in the developer

Google have published a style guide for their developers.

It’s a nice guide for all writers of non-fiction.

Some cute things:

On semicolons (I never know when to use) not much help (https://developers.google.com/style/semicolons)

Where to use semicolons is often a matter of judgment. Use them judiciously.

In the resources section the style guide refers to Apple’s and Microsoft’s style guides. (https://developers.google.com/style/resources)

Other companies’ style guides, such as the Apple Style Guide or the Microsoft Manual of Style.

Anthropomorphisms, which I like especially in documentation (makes them read like a novel, if done well), however not recommended by Google (https://developers.google.com/style/anthropomorphism):

Examples

Not recommended: A Delimiter object tells the splitter where a string should be broken.

Recommended: A Delimiter object specifies where to split a string.

Just one I did not understand (https://developers.google.com/style/headings):

Things to avoid in headings

Don’t use the following in headings:

Enjoyable.

Should you learn how to code?

Everyone in IT should know the basics of programming. (Also you should have installed some Linux distribution on your laptop. Even if its your laptop, it increases your understanding of the complexities of managing a platform.)

Program something

Program a crappy little program, you will understand more about the challenges of the programmer.

Derek Sivers wrote a nice article about why you should learn programming. https://sivers.org/prog
For him learning to code means self reliance and basic understanding are the main reasons.

Also experience the joy of building you own computer. I helped my son when he built his gaming computer. I learned at least as much as he did.

What language to start with

Derek recommends to start with HTML and CSS. Well, yes, agree of if you are interested in programming web sites. But HTML is such an ugly programming language. It’s like staring programming with BASIC. Before you know you think GOTO is a great flexible feature. While it actually is kitsch. I would rather start with Python, php or Java.

Build something useful in a very short time. Make it ugly. It doesn’t matter. Improve it step by step. Or start something new.

I like exploring programming languages.

 

I recently played with php. Built a small website showing photo’s from google images using random keywords.
Using MAMP.

Then played with python, programming an interface between Kindle and Evernote. Used Pydev.

Did some Javascript and node-RED.

A lot of Rexx programming. 

And Erlang.  That’s a hard one if you are not familiar with functional programming languages.

I learned a ton. I am always amazed what you can learn FOR FREE on the Internet.

Programming: a profession

Programming, a profession not a monkey task

A few years ago an IT manager said to me: for this programming job, I should be able to hire any monkey from the street.

I told him such an attitude would very quickly ruin his application, if not his entire business.

For an organisation that relies on software so heavily, allowing unmaintainable code to enter your applications is like accepting a loan your will never be able to pay off. You are building up an insurmountable technical debt. You can only hope you have some superb programmers around when the bugs hit the fan.

Programming profession

But for us programmers the problem is also about professionalism.

Coding is a profession. Good programming is a skill.

Some organisations want to have code done for 5$ per hour. Or so. Less than you would pay for a plumber. You would trust a plumber for that rate, why leave a programming job to someone for that rate? You are simply not serious about the problem at hand if you hire like that.

Democratization – the amateur and the pro

There is a tendency to underestimate the importance of skill.
Programming is democratized. That is good. Coding is not something mythical either. Amateurs can do it. Do it well. And enjoy it.

But for the problem in my organisation I need a pro.

Photographing is democratized. But for my wedding photos or for my business brochure I hire a professional photographer. Because he has a number of things extra, which I would summarize a craftsmanship and experience.

If you want stuff done you want good craftsmanship. A specialist you can talk to.

And by the way, ideally they should be at your desk and you at their’s. This is where outsourcing often goes off the track. Too little interaction.

Go pro

Cheap programming may work for throw-away apps. But not for high quality solutions that need to work be maintained for a couple of years or more. That stuff is built for the future. For maintainability.

By an expert.

The roots of modern computing explained in EWD51 – Multiprogramming and the X8

Dijkstra’s EWD 51 is a structured educational coverage of the workings of semaphores in communicating processes and with IO devices. It is the first part in a series of three articles called MULTIPROGAMMERING EN DE X8″ (Multiprogramming and the X8), EWD54 and 57 describe part 2 and 3.

if then else

The X8 is the Dutch research computer for which Dijkstra and hos team developed the operating system, and he was able to test his now famous concepts for multiprogramming. 
In a way it is the formal part of the talk that Dijkstra held and was transcribed in EWD 35.

EWD 51 extensively discusses the mechanisms of semaphores, the conditions, and (hardware) implications. That is the summary. To give more would be pointless, and you’d rather read the entire article. (The article is in Dutch – I could provide a quick translation if you are interested. Please let me know through a comment on this post, or send me an email)

The Dutch language used in this article is highly interesting. Dijkstra invents concepts for which no words existed before (seinpaal/semaphore as computing concept to start with) the abbreviations P (prolaag/pass – probeer te verlagen) and V (verhoog/increase), critieke secties / critical sections, ingreep-flip-flop / interrupt-flip-flops, luisterbit / listener bit, doof-horend bit.

The article could still  function as a modern introduction into the topic and still be applicable to today’s computers.

So far ahead, so clear, so up to date still.