Wednesday, April 6, 2016

Mass Producing Software

Before about 1900, if you wanted to make something, you needed to know how to make the whole thing yourself. If you wanted to make a car, you had to be a car maker. Then along came mass production, and you only needed to be a door maker, so long as there were other people who knew how to make the rest of the car and you could figure out how to work together.

People who work in car factories today don't know how to make cars. They know how to make parts of cars. It's a lot easier to learn to make a door than it is to learn to make a whole car. Besides that, door makers use tools that are designed to be really good at making doors but which can't be used to make steering wheels. 

In software development, scripting is like mass production. A scripting language is a tool that can be designed to be really good at making one part of a computer program, even though it can't be used to make other parts of the program. It's also much easier to learn and much easier to use, so you don't need to be much of a genius to make really good programs.

I've created or helped develop scripting languages at various times in my career. Designing good scripting languages was difficult though. And users still needed to learn the specialized language and type in commands correctly. Then along came Blockly.

BOOM! Blockly simplifies the creating of scriping languages and makes using them 100 times easier.

Here's a calculation I created that does a simplified version of a calculation that was needed in a securities trading system I worked on at my last job, using a scripting language I created using Blockly. It calculates the number of days after a securities transaction before the securities are delivered and paid for. Even if you're not a computer programmer, you can probably look at this and understand what it does. Let's call this Way A. Give it a try.


Here's a program written in a general purpose, text based language, that does the same thing. Let's call it Way B.

settlement_days:function(inputs){
   return 
      (
      validate("boolean", inputs.cash_client) 
      || validate("security_type",inputs.security_type) 
         === "money_market" 
      || validate("security_type",inputs.security_type) 
         === "treasury_bills"
      )
      ? 0 
      : 
         lt(validate("date", inputs.transaction_date),802497600000
         ? 5 
         : 3
}

Some people love doing Way B. Let's call them WayBers. For them, there is no greater happiness than staying up all night typing computer code. WayBers make up about 1/10 of 1% of the population. Mostly they don't get invited to parties. A lot of them are still single by the time they are 35.

A lot more of us are WayAers. We want to finish working on our company's software by 5:00 so we can get home, have dinner with our families and watch the game.

There's a great effort being made just now to get WayAers to learn to write programs using Way B.

It ain't going to happen.

If you want WayAers to write software, you need to do it using Way A, which is the way we make cars and everything else. Once we figure that out, the lion will lie down with the lamb, all the people of the world will come together in harmony, and we will be mentally and spiritually at peace. Or not. But at least we will be able to get our work done so we can go home and watch the game.

No comments:

Post a Comment