Abstraction, Communication and Great Software Developers

Grady Booch interviewed by Software Engineering Radio highlighted the essentially needed qualities of a valuable/good/great software developer:

1. Being a good abstractionist

2. Being a good team player with good communication skills

Who is a good abstractionist?

A good abstractionist is one who knows how to abstract an idea and can implement the so created abstraction using a programming language. Note that what is in bold here are necessary requirements (i.e. “knows how to abstract” and “can implement it”).

So what is “abstraction”?

Put in simple terms, an abstraction is a simplification of something that may be complicated. For example, a man is a simplified view of a complex biological mass. A computer is a simplified view of a collection of components that act together (CPU, storage,…). A CPU itself is an abstraction of some other details. The same concept applies to software as well. For example, a word processor may just be a word processor for you. But the people who implement it see that a word processor is a complex integration of multiple software components together. One such component may again be an abstraction of several other “sub-abstractions”. Hence we see that we can think and talk of different levels of abstraction.

Prof. David L. Parnas (still alive) presently at University of Limerick in Ireland who is respected for his initial research and hence formulated software engineering principles about 30 years ago which are still valid and set the foundation for modern development, describes the meaning or properties of “abstract” as follows:

1. Not vague, theoretical or highly mathematical; abstract means – expressing a general property.

2. Abstract implies a many-to-one mapping.

3. The abstraction represents many things equally well.

4. The abstraction models some aspects of the real things, but not all.

5. Eliminating detail is the approach: The interesting issue is which details should be eliminated.

Eliminate the details that are likely to change. If you could understand the above clearly, David Parnas has more goodies for you. The above was captured from the paper on “A Procedure for Interface Design”.

If you couldn’t understand, don’t panic and you will feel comfortable with my simple explanation.

Being a good team player with good communication skills

I have seen people who oppose, but this turns to be true if you are into legitimate software development. If developers cannot understand and cannot explain themselves clearly, what good can you expect in the software they create? If they cannot communicate, they won’t be good team players too. Specially when the project is large, having poor communicators put the project in risk not only because they don’t understand what is required to be done and don’t get the questions that springs in their minds clarified, but also because they become a painful burden to other team members.

This does not suggest that we need to know all the grammar and the related of English language and practice them with perfect correctness. English is such a painful language with lots of unnecessary complications. This holds true for our own mother tongue as well. In reality, all the natural languages used by us have unnecessary components (But I have heard that Sanskrit was an exception, wasn’t it?). What matters is sympathetic communication. And for that purpose, one should be able to read, write and speak well. Even a reasonably written reply to an email counts. In other industries, communication skills may not be a great issue, but in software, there’s no choice. There’s nothing strange in refusing the applications of highly (technically) skilled people with poor communication skills even by our own country’s software firms.

To be a good developer

Your knowledge on latest Microsoft tools or Java Enterprise Edition (or any similar technical soundness) will prove to be useless unless you enrich yourself with the ability to abstract, implement the abstractions and communicate well. Spending time on English will improve your communication skills. Abstractions? A good technique is to embrace software design patterns (Learn and then make sure you code as well. Also see if you can combine patterns and analyze the consequences).


7 Tasks You Shouldn’t Use a GUI For

Here are a few tasks that you might want to consider using the command line for.

1. Resizing images

Unless you are doing some sort of cropping there is no reason to load up Photoshop or the Gimp. A simple command will usually suffice for almost all your image resizing needs.

convert -resize 300 image.jpg image-small.jpg

If you finding yourself doing lots of image resizing during the day, this command could potentially save you a LOT of time. You can even do mass image resizing.

2. Adding a Drop Shadow to an Image

I found myself spending a ton of time adding drop shadows to images. Using a simple command I was able to create drop shadows in seconds.

convert screenshot.jpg \( +clone -background black -shadow 60×5+0+5 \) +swap -background white -layers merge +repage shadow.jpg

Note: You must have Imagemagick installed for this command to work. Debian/Ubuntu users can use apt-get install imagemagick.

Obviously, I don’t expect you to memorize this command. To shorten it use an alias.

3. Splice Together an MP3

If you want simple MP3 splicing this command has your back:

cat 1.mp3 2.mp3 > combined.mp3

4. Clone a Hard Drive

DD is one the most simplistic and powerful image applications out there.

dd if=/dev/hda of=/dev/hdb

5. Burn an ISO to a CD

Why open up K3B or some other program just to burn an ISO? Map this command to an alias and get burning.

cdrecord -v speed=8 dev=0,0,0 name_of_iso_file.iso

Note: You need to get the info for the ‘dev=’ part by running ‘cdrecord -scanbus’

6. Video Conversions

Let’s say you want to convert an AVI to an Mpeg file:

ffmpeg -i video_origine.avi video_finale.mpg

Or convert an Mpeg to AVI:

ffmpeg -i video_origine.mpg video_finale.avi

There are all sorts of things you can do with ffmpeg.

7. Replace Words in a Text File

No need to open up a GUI text editor when you have sed.

This command from Eric’s Wendelin’s blog will replace all instances of a color in CSS with another one.

sed ’s/#FF0000/#0000FF/g’ main.css

Send Mail Through Gmail with Python

Good system admins get to know scripting languages well and sometimes use them for all kinds of purposes, from scripts that do backups to complex automated tasks. Often times it would be nice to get an email notification when the script finished or completed OK. Cron does a good job of sending emails when scripts run into errors or problems, but sometimes it is necessary to get custom email messages sent from the script itself. Python makes sending email alerts a breeze.

The Code

import smtplib

fromaddr = ‘fromuser@gmail.com’
toaddrs  = ‘touser@gmail.com’
msg = ‘There was a terrible error that occured and I wanted you to know!’

# Credentials (if needed)
username = ‘username’
password = ‘password’

# The actual mail send
server = smtplib.SMTP(‘smtp.gmail.com:587’)
server.sendmail(fromaddr, toaddrs, msg)

You will want to use this with an already existing script or a script where you want to add email alerts. For example:

# A big task

if task.completedOk():
# Insert email code here, explaining that
# the task is done and some details about it

Or perhaps you wanted Python to send you an email if the server room gets too hot:

# Get temp

if temperature > 70:
# Insert email code here

Sending Mail Through Gmail with Perl

The Code

use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
Hello   =>      ‘smtp.gmail.com’,
Port    =>      587,
User    =>      ‘username’,
Password=>      ‘password’);
$mailer->datasend(“Sent from perl!”);

Adding Custom Shortcuts to Gnome

The motto with Linux is customization right? So lets customize the shortcuts in Gnome to make them do what we want them to do.

If you are looking for a list of default Gnome shortcuts check out, All the Best Linux Cheat Sheets.

First open up the gconf-editor


Then in gconf go to appsmetacitykeybinding_commands

You will see commands ranging from 1-12. These are your custom command aliases. Select one that is not in use. Lets say command_1

Then type in the command that you want ran.

No on the left side of gconf go to global_keybindings.

Find the corresponding run_command_ and double click.

In the value you will type in your shortcut for example, <Control><Alt>S

Now for this example Ctrl+Alt+s will open up the gnome-system-monitor.

Just remember to try out the shortcut before you override it. You probably don’t want to assign a shortcut to something that is already used for something more important. There are also some preset shortcuts you can set in SystemPreferencesKeyboard Shortcuts.

Gnome Sticky Notes Applet Minimizes When Clicked

Recently I started using Sticky Notes Gnome applet for reminding myself for certain tasks. Before that I used to use Tomboy Notes which has some nice features too but it is somewhat inclined to use as a Notes database and not as a Sticky Notes app. I also tried XPad which is very much like Sticky Notes but I prefer the feel of this Gnome Sticky Notes applet.

Sticky Notes applet has only one problem when used with Compiz engine – It gets minimized automatically whenever you click in empty space on desktop, which kind of beats the purpose of the application that is it should always be stuck to desktop. Luckily I found a workaround for the problem. It is applicable only for Compiz Desktop Effects are turned on. For Normal Metacity decorations, Sticky Notes behaves as it should.

If you wish to have Sticky Notes always stuck to the desktop :
1. Open CompizConfig Settings Manager from System > Preferences.
2. Enable the plugin Window Rules.
3. In “Skip Taskbar“, “Skip Pager“, “Non minimizable windows” fields, addclass=Stickynotes_applet“.

Skip taskbar – Hides application window from taskbar. Skip pager – Removes the window from pager, alt+tab windows selection. Probably you need this option. The last option “Non minimizable window” is the real workaround for the problem which restricts minimization of Sticky Notes.

You can’t minimize Sticky Notes any more by clicking on applet. To minimize notes, toggle desktop by pressing “Ctrl+Alt+D“. If you are one of those who want to have notes always on desktop even if “Ctrl+Alt+D” is pressed:
1. In general settings of CCSM, untick “Hide Skip Taskbar Windows” which minimizes windows which are not shown in taskbar.

I would love to hear if you know any better Sticky Notes like application for Gnome.

Mac Style Menu Bar For Ubuntu

Have you used Mac before? If yes you know how beautiful top panel menu bar looks. If you haven`t used Mac yet don`t worry, I will explain what it is. Mac has central menu bar place on the top panel which is shared among all the applications. The menu bar usually contains menus such as “File”, “Edit”, “Help” etc. as you may already know.

The good thing about this is all applications share the same place for rendering their  menubar and no matter which program you are accessing the main menu bar always apears in top panel in Mac. The red arrows show this place on top panel.

Its possible to have similar menu bar in Ubuntu by using package “gnome2-globalmenu”.

If you are wondering why to use this kind of menubar, reasons would be :

  • Suppose that you have 5 applications open. Then these programs will have 5 different menubars of thier own. By using globalmenu at a time only one menu bar will be visiblereducing clutter.
  • In the same scenario you might click the wrong menu item (happened with me a lot of time before), so unintentional clicks can be avoided.
  • It looks sexy.

Installation :

In terminal,

sudo aptitude install gnome-globalmenu


Once installed, you would want to make some changes to top panel to get more unified look.

Right click the Ubuntu logo from top panel -> “Remove from the Panel”.

Right click top panel -> “Add to Panel” -> “Main menu” -> Add.

Right click just to the right side of Ubuntu logo and add “Global Menu Panel Applet” from “Add to Panel” menu.

The globalmenu should be working now if not continue reading.

Troubleshooting :

  1. Globalmenu doesnt show up : Logout and press “Ctrl+Alt+Backspace” to restart gdm. Relogin.
  2. Still not showing : Make sure ~/.gnomerc contains uncommented line “export GTK_MODULES=globalmenu-gnome”. If its commented remove the “#” and follow the fix1.
  3. Globalmenu isnt well aligned : Notice globalmenu applet has the seperator to its left. Drag this according to your taste.
  4. Menu is shown in GTK applications as well as on panel : right click menubar on top panel -> preferences -> General settings tab -> untick “Show local menu in a window”.
  5. Firefox and some other applications are not supported by globalmenu as of yet.