Windows vs Unix or how to underdevelop a kid Pub Share

Trying to answer the question: Should we keep on building freakishly complicated web portals or just adopt composition-friendly DSLs ?



I was a Windows developer for a long time. Well, that means I used to write programs for Windows, using Windows. Then I was a Unix developer for a long time. I wrote programs for Unix, using Unix.

Now I am a developer. I write programs, in a mix of languages, that run on a mix of technologies, using a mix of technologies.

In Windows, the thing to have is a clickable. You create clickables: programs that people start and run by clicking on them or other things (documents). Everyone uses a mouse, to open... windows (what else), click on buttons and maybe enter some text in a field, from a keyboard.

In Unix, the thing to have is a command or a composable. You create commands that other people use to start your program, which may return with a result... or not (i.e. a pizza delivery server). You interact with the system (I tried an X once - it sucked, so I wrote my own) via a terminal, typing shell commands, which naturally compose then into bigger functionality or other shell commands.

The Windows type thinking then is natively monolithical: you can't really compose or re-use mouse clicks and buttons. One thinks in terms of "I have this GUI as a set of clickables and I want to reuse it to do this other thing", which is the same thing as giving a 5 year old prefab houses and a hammer.

The Unix type thinking is natively componentized. This 5 year old gets Lego blocks. There are tons of lego blocks that any Unix developer knows, like sed/awk/wc/grep/find. Those open an entire world of possiblities.

Find me all the scala source files in the current directory, which define classes starting with User and count how many lines of code they have - then sum this up.

The Windows kid, will probably take a leave of absence, come back and spend a few hours messing with the Explorer, some Notepad, Excel spreadsheets, probably open up VisualBasic and write a new clickable and with a lot of sweat can give you an approximate answer (approximate because everytime you copy paste things around you probably loose a bit... or a byte).

The Unix kid, fond of his Lego blocks, rearranges them in a few seconds, and builds a new program:

$ wc -l `find -name "*.scala" -exec egrep -l "class +User.*" {} \; `

razvanc@Razie3 ~/w/racerkidz
$ wc -l `find  -name "*.scala" -exec egrep -l "class +User.*" {} \; `
  179 ./app/controllers/UserStuff.scala
    4 ./app/model/BasicTypes.scala
  454 ./app/model/User.scala
  637 total

I am sure that's probably the worst way to do this, but it works and actually the main point here is that these Lego blocks can be re-arranged in a miriad of possibilities, to build anything your imagination... well, imagines... I guess.

Just by moving things around, you change it to count the number of files with the given trait:

$ find -name "*.scala" -exec egrep -l "class +User.*" {} \; | wc -l

razvanc@Razie3 ~/w/racerkidz
$ find  -name "*.scala" -exec egrep -l "class +User.*" {} \; | wc -l
3

Oh - making this reusable? Just put it in its own container and let the arguments flow:

countClass.sh:
find  -name $1 -exec egrep -l "class +${2}.*" {} \; | wc -l

QED - he now has a new building block. Notice that the individual lego pieces used may look complex but are very simple - I don't know all the switches to find or egrep, just like 2-3 for each. These work on any unix version and any shell even. Yeah, I use them on Windows too (see cygwin).

If you want to know more about find just type man find in any browser.

For sure, there are ActiveX and OLE and COM components, but no obvious way for someone to make them sing. There are portlets and embeddable GUIs, but they don't really interact. You need to be a developer really, learn programming languages and interact with all kinds of unrelated things like code editors, debuggers etc to glue these components and make something out of them.

In the end, the Unix kid is trained to be much more efficient by building reusable blocks and much more imaginative in re-combining them. The glue is what really matters and here it is simple, strait forward and easy to use by anyone.

In Windows, there now is a PowerShell and an F# that somewhat emphasize composability - I am really curious if that is enough to change mentalities... it would be for the better.

If you want to feel the power though, there is cygwin - not the easiest thing to install, but works very well once installed with the basic stuff. I use it daily - it brings a wiff of the Unix efficiency and simplicity onto the much better equipped to deal with beureaucracy Windows, the home of Office.

Out with the old

The best thing to come out of Microsoft that I have seen in the past few decades, was Popfly - a really nice for its time mash-up and game creating environment, from smaller blocks, complete with actions, behaviors and shapes etc. They have discontinued it for a few years now. Their inability to work that capability into the OS itself - I see it as a huge failure of Microsoft, of both their technical talent as well as their vision.

That, in my mind, would have up-handed the scripted Unix significantly. I think a lot more people find it easier to think graphically than via abstract algebraic constructs. Especially kids, eh? But the Workflow Foundation doesn't cut it...

Kids, our future developers... my kids loved Popfly - they were like 8 and 10 and were both playing with it, having fun and understanding stuff. Not since it was discontinued... there are some other platforms emerging now, but they're not that interested anymore... that's what gave this blog its title.

In with the new

The new world revolves around the web - where the actual OS becomes more and more irrelevant. I am afraid though that the mashups and componentized approach are not emphasized and supported enough in today's frameworks... there's not a lot of focus on the glue.

Don't forget the flipside of the coin: the Windows kid can do stuff immediately, because there's things to click and he has a mouse. The Unix kid needs a bit of guidance to discover man and what he can do... first time I saw a Unix terminal, I tried 'help'... and some other stuff and then gave up!

This is why Popfly was an exercise in awesomeness... but the question remains unanswered: which kid is underdeveloped?


Was this useful?    

By: Razie | 2013-11-06 .. 2014-06-25 | Tags: post , functional , dsl


See more in: Poor Razies Almanack Subscribe

Viewed 935 times ( | History | Print ) this page.

You need to log in to post a comment!