Software Engineering

My lecture this morning was on project management. Specifically how it applies within the games industry. So I was pleasntly surprised to find an almost identical post over at Coding Horror.

The name “software engineering” is apt enough. Computer Science is about creating pretty little algorthims ( don’t get me wrong, I use BubbleSort all the time).

Software engineering is about getting a given piece of software to work, no matter what the code looks like. 

Jeff says:

But software projects truly aren’t like other engineering projects. I don’t say this out of a sense of entitlement, or out of some misguided attempt to obtain special treatment for software developers. I say it because the only kind of software we ever build is unproven, experimental software. Sam Guckenheimer explains:

To overcome the gap, you must recognize that software engineering is not like other engineering. When you build a bridge, road, or house, for example, you can safely study hundreds of very similar examples. Indeed, most of the time, economics dictate that you build the current one almost exactly like the last to take the risk out of the project.  

I agree. Let me explain.

It has “engineering” in the title for a reason. You don’t need a fully qualified engineer to fix the gas boiler ( though thats what they’re called in the UK). You do need an engineer to build the world’s longest rail tunnel. Thats why its engineering. Thats the semantics

Also, like engineers, we tweak things constantly. My lecturer gave the example of the motorway just down the road. They built it in a marsh. But the thing is that you can’t build in a marsh. So they froze, yes froze, the ground with freon and built on top of that. Thats engineering.  

Thats why its like real, civil enginering. 

As far as unproven, experimental software goes, I’d like to give an example. I get project management software, a trial version. I test it to see if i’d be willing to shell out for the full version. I don’t like the program. So i take the basic idea ( “keeping track of development schedules”) and build a better project mangment software tool, with the all the cluncky bits stripped out. Both programs will work and do the job of keeping track of development schdules. One will be better than the other becuase end user input has been taken into account.  

My point is that. Most of what we as software developers do comes from the real work. Surely Pharaoh must have had project management in his time? The challenge is create something better than the previous iteration. So we port proven tasks, in this case project mangement, to the computer, while still being ready to improve on the product. Engineers build a bridge once and have to wait till the next bridge comes along to apply what they learnt on the last one. We write software that evolves, yes evolves. Snapshots of the  same bit of software take in the middle and the end, will be completely unrecodnizable. So in this sense, we do write experimental programs.

So, in response Jeff, it depends on your point of view.  

Engagement

What Scobe says is right. Its not simply the size of the audience, but the level of engagement that matters.

Scoble explains:

Well, I’ve compared notes with several bloggers and journalists and when the Register links to us we get almost no traffic. But they claim to have millions of readers. So, if millions of people are hanging out there but no one is willing to click a link, that means their audience has low engagement. The Register is among the lowest that I can see.

Compare that to Digg. How many people hang out there every day? Maybe a million, but probably less. Yet if you get linked to from Digg you’ll see 30,000 to 60,000 people show up. And these people don’t just read. They get involved. I can tell when Digg links to me cause the comments for that post go up too.

Which explains alot. This should become a new benchmark for advertisers. The Digg example is good. But what about Google Adwords/Adsense? or Yahoo Directory? Or Microsoft Adcentre? It would be useful to know the stats of the service you’re about to use. What is the likelyhood that your average ad gets clicked? Of Ads similar to yours getting clicked? So as an advertiser ( I’m speaking hypothetically now), I can see which service is the better investment since I need hits, and I need them now.

So how do we measure engagment? Statistics for one. The more detailed, the better. Contextual information for another. The circimstances surrounding your ad getting clicked. i.e if a number of ads before yours were clicked, why was the user still searching? And so on. All this has to be considered in terms of the total audience of that service for a given day or week.

Programming Rules of Thumb – On Comments

Duncan Merrion, the original author of the seven rules, left a comment on my previous post :

The secret to investing is “buy low, sell high”. (Also, the secret to carpentry is “measure twice, cut once” ) – this doesn’t mean if you only do this you will be a successful investor (or carpenter) but rather that if you are a successful investor (or carpenter) you will do this as a habit.

This is what i was aiming for with the 7 secrets article – although much subsequent reading (it was written about 5 years ago) has convinced me that hungarian notation is not a good thing at all, and the comment often, comment well paragraph needs to be rewritten but I still stand by the article as a whole.

Ok. I’m sure we can all find somthing to trash about  someone else’s philisophy, specially when it comes to programming. I myself prefer doing the user interface first. That gives me a clear idea of how my how my data structures will work.Not that ialwyas do that. The UI and the data classes usually evolve at the some time. I find a probelem i one that requires a twaek in the other. Not everyone would agree with that. Some would have it that as a process: one does the data, the other does the UI and still another ties it all together.  So esentially we al have our own philosphy. This can and oes change moving programming language. Visual Basic 2005 is nearly english. All you have to do is pick the right variable and function names and you’re most of the way to self documenting code. C/C++ and even C# to an extent have different syntax to Vb2005 and require more commenting. But on the whole, comments are extremely useful. There are times when a function or a procedure is simply too complex. This is especially the prblem in C/C++ as the amount of things you can do on a simgle line is far greater than VB. In VB you van have a series of function calls that return data to the next function

i.e x= Function1(function2(function3())).

Not that that is the best way of doing it. But that is what sometimes happens. If you change it to sothing more readable. I’ll take Pythagoras as an example :

 a = calculatedistance(Squarepoints(getpointsBC()))

And viola: readable code. And to an extent, self documenting. What are the points being retunrned. What distance is it getting. Why? All this can be put into the comments. The code surrounding this line might well explin it. so its a 50/50 solution that changes from programmer to programmer. It might be helpful siomply to add comments once the program is completed for others to read ( or for you to read come maintanence time).

Duncan metions some of this in his post that he reffered me to. So, as he puts all the above:

Additionally the source code is only self-documenting to someone who has a good knowledge of the programming language that the source code is written in. However it is often the case that the person who has the best understanding of the problem space (be they a business analyst, end client or whatever) does not have sufficient developer experience to be able to read the code itself.

A good comment states the intent of the code to which it applies in the language of the problem domain but does not describe the computation operations being performed.

I completely forgot the other reason he gives for comments. The fact that the expert in the problem sapce, as he puts it, needs tro be able to understand what the code is doing, rather than the code itself. A Mathematitian would express Pythagoras as a(squared) = b(squared)+ c(squared). Although the function names above are descriptive ( since the function names are there to remind us of the job they are doing, rather than their internal workings), the above mentioned math geek would have to be told that htta’s what this line of code is doing- commets. Thus a mathematitiance would undersand Pythagoras as:

a^2 + b^2 = c^2. \, 

The math geek is happy becuase he knows whats going on and can make sure the function works .

All the seven Rules needs is a title change and a change of perspective: they are tips, not royal decrees (or NFL rules). The article highlights seven areas that programmers find helpful in certain situations. We could go into enormous detail about the ins and outs of progrgramming and turning out good code. But, with alittle updataing ( the article is five years old), it’ll do the article a world of a difference.

Programming Rules of Thumb (Updated)

The facts is there arn’t any, as I found in this excellent post. Kudos to WordPress (again) for their dashboard which directed me to this post.

Back to the post. I can’t agree more with it. The reply to The Seven Secrets of Sucessful Programmers is nothing short of a no brainer. All the seven Rules needs is a title change and a change of perspective: they are tips, not royal decrees (or NFL rules).The Seven rants highlights this differnce of perspective.

The Seven Rants post is rather good, condensing and updating the gist of Code Complete.

Don’t take me wrong. I don’t think there’s anything evil in trying to convey hard won lessons in little capsules. Otherwise, i wouldn’t be writing these musings in the first place. It’s just that i dislike oversimplifications; they go hand in hand with the notion that programming is just something to be done by underpaid coding monkeys, or that it should be as easy as clicking around with a mouse.

Which is, belive it or not, somthing that most people outside the programming world think. I’ll ask around and get more on this but, thats generally it. The truth is the total opposite of that. Programming is far, far from easy. Found that out myself last year. Both my projects for Semester 2 had so many bugs in them that I couldn’t bother fixing them. The programs should have worked like dreams ( one of them did, nearly) but didin’t for no reason I could ever figure out.

I was wondering myself about commenting. Self documenting code gets even easier to write in Visual Basic 2005. Why bother commenting?

In my experience, the need to explain what a snippet of code is doing with a comment is a sure indication of bad coding. Good code is self-explanatory and needs few, if any, comments. Otherwise, you did something wrong, be it bad naming or poor function breakdown. Not to mention the issue of keeping comments and code synchronized during rewrites. So here’s my secret number 2: comment seldom, write self-documenting code instead. This will make your programs not only easier to understand and maintain, but of better quality.

Of course, aside from naming variables and bad code, Visual Basic takes care of most of this for you. Indenting is automatic by default. Exceptions are easy to handle. Scope is done by default. Its pretty good. Its the coding part that brings you up short time and time again. Even for the simplest subroutines it can take a while. I once wrote a Pythagoras Function ( to work out return right angles). I had to get my high school textbooks out and give WikiPedia a look. It took time to get the code right to work in all cases.

Pure programming is a rare thing. Programmers work with real world concepts ( abstracted, maybe)  and getting computers to do the same is essentially our job. And we need every good tool that we can get our hands on .

Another blog to add to my blogroll.

Update: Here

YouTube or GoogleTube?

Saw this yesterday on CNN. Again Google is expanding, trying to justify such a high shareprice. And I like the idea. Google, worlds most powerful seach engine and No.1 adsite buys YouTube worlds mostwatched video site. google needs ads, Youtube needs funding etc – an alliance of convinience unified by a common goal and purpose. Both of which are to do with Web 2.0. Scoble has a good write up here. He has an interesting analisis why Youtube is more popular than Blinkxs ( and I too had to triple check my spelliong of the name):

Also, the home page is WAY overbearing. Too many moving things. And one design principle I learned in college: pick ONE thing and make that twice as big as anything else on the page. YouTube wins here. Why? Because your eye needs something to enter the page with. If everything is the same size, as it is on Blinkx, your eye feels uncomfortable. Doesn’t know where to look.

He also make this interesting point. Coming from him as a student and connisour of new age media ( blogs, podcast vblogs and the like), its interesting:

Blinkx has lots of big-name videocontent. Movies. TV shows. Etc. YouTube has lots of “small-name” videocontent. Kittens. Goofy videos. We’re all looking for different kinds of content. Stuff to impress our friends with that they probably won’t have seen. Here’s a hint: your friends and family have probably already seen the latest Lost. But they haven’t seen the latest cute kitten video. Microsoft makes this mistake too (remember IE 4 with ActiveDesktop? What was there? Big name media companies. No small guys. I wonder if Microsoft will learn that it’s the small guys that make an experience different and interesting?)

Never thought about that. Again this is how the market regulats itself. Both ends of the market need satisfying. Youtube gets it nearly right with its mix of videos from the crowd. Those that dont get the mix right end up in the cold.

 Microsoft is too big to end up right out there becuase its product range is so broad so s to ward off blows easily but the effect will show on individual products (examples, anyone?). Microsoft also has the money to throw at the problem. Youtube didn’t have that then yet did a great job. my compsrison is unfair due to different business models and operating enviroments (you too, scobe), but its valid nonetheless. 

With google behind Youtube, I’m looking foawrd to hearing of new features ( purely to shake my head in amazement at thier

 

Unglamerous Side of programming

I visibly cringed reading this post (via Jeff Atwood). I just skimmed it, but the pain is still there.

He expanded it into a list of posts that I’m going to read later. So consioder this a note to self.

Somehow they forget to tell you the truth about testing when you start programming.

Jeff is absolutly right:

 if you can pass that testing gauntlet, you’ve definitely earned your stripes as a seasoned software developer.

My broadband should be back by the 16th of October so I’ll resume regular posting.

Windows Vista: Memory

No wonder. No wonder all my memory is gone when running Vista. Turns out that Vista preloads alot of stuff that it thinks you might need. in other words, its trying to give you more bang for your buck ( or rather your RAM). Jeff Atwood explains this rather well in a follow up post to the one I touched on earlier.

Which is quite fine, until you decide to actually use all that preloaded memory for somthing else. Vista won’t even let me play a DVD for goodness sake. I suppose I should try Readyboost when I get another USB key ( the other one is kind of busy at the moment).

Now all I need to do is persuade someone to lend me their internet for a few hours to download Vista RC1.

CSK

I’ve been working with the Commerce Starter kit for the past few weeks, mainly getting used to themes and getting the pages to look just the way I want. No code changes actually done, but a few planned. At least till I checked the CSK website and they have a afew major changes to the kit. With particular thanks to Spooky for bringing us all up to date on all this. I wait on tender hooks for RC1 to be released.

Couldn’t Resist

This will probably be my last post for a while as I leave tommorrow morning and way goes my broadband. I’m sure I’ll win my row with BT…

Just to point out this that I completely agree with. Simon makes a lot of very valid points – I never read the licence agreements anyway ( Unless they’re short andf sweet).

Doc Searls has an interesting post on Net Neutrality here. Perhaps I should point this out to BT? I’ll need to digest it a bnit more, though.

Back Online

My broadband is still out, though I’ve got s dail up account that is sooooo slow. I’m currently on holiday in Perth for the weekend and am using their rather expensive broadband/wifi. Still fighting with the phone company over whatever was done to the line.

It’ll take me a month to get back up to speed. Scobe has certainly been busy and I’lltake my cue from him meanwhile.

I have a deluge of email to sort through as well as a pile of books…

Just to let you that I’m stil alive and well.