Thursday, 16 July 2015

I am 25 years old and I am programming for the past 6 years. Here are my take aways on Software Engineering

Engineering is hard. Engineering a good software is a team effort. More often programmers think that their ideas can be transformed into code within a week which the users will absolutely love. Then they can roll on a Ferrari which is bought from a portion of the money from a major acquisition. In reality, things go wrong more often. Software Engineering is a craft and if practiced well one can reap the benefit from it. 

I used to think programming as just an activity in which you sit in front of the computer, pick a language (mostly Java) and do what ever you want with it. But as soon I started to work with a team, I realised programming is different from engineering a software. You need to be wary of several  techniques, processes and concepts in order for this to work properly. I am practicing Agile and Extreme programming practices for the past 2 years and it seemed to help me to be better engineer. Here are some of the key points from my experience.

Use Version Control

Now a days this has become the de-facto standard of all the projects in the industry. But to those who haven’t used it, seriously consider using it. I have used SVN and Git. I would like to stick to Git in future until I find a better alternative. Thanks to Linus.

Be Versatile

Learn at least two programming languages, one scripting language and assembly language of atleast one architecture (X86, PPC). In my career, so far I have worked with Java, Ruby, Python, Erlang, Objective-C, Swift, JavaScript, shell script, also have written and debugged x86 assembly code.

Use the right tools for the right job

For programming in java I mostly use Idea IntelliJ editor since it has refactoring and better code navigation features. And for scripting I mostly use Atom editor and vim. I am still learning Emacs.

Have lots of tools and framework under your arsenal

In your career, you will reach a point where you have to make decisions about what software components to use to build your software. This is mostly taken care by architects, by I strongly believe we as Software Engineers should be more informed and should make such architectural decisions.

 What relational database would you pick - Postgres, MySQL, Oracle or Microsoft SQL server ? 
 Which No-Sql database would you choose - Redis, Mongo DB, couch DB or Neo4j ?
 Which web platform would you choose - Play, Dropwizard, Sinatra, Ruby on Rails, Django, Flask or Node js?

It is important for a software engineer to know why one software component is better than other. This will help us choose the right one based on our needs. Some of the developers will have the urge to write everything from scratch. I would strongly urge you use tried and tested frameworks and libraries that will save you a ton of time. If nothing fits your need, don't be afraid to write one.

Learn concepts

It will also help you to know 

Operating system concepts such as scheduling, paging, memory management, virtual memory, context switching, stack frames etc.
Distributed system concepts such as CAP theorem, eventual consistency,  clock synchronization, network partition, distributed caching etc.
Networking concepts such as TCP/IP, Virtual LAN segments, WAN, DNS, ARP, SAN, NAS, DHCP, HTTP, SMTP etc.
Database concepts such as Indexing, Sharding, Query planning etc.
Language concepts such as Compilation, Assembling, Garbage collection etc.
Programming concepts such as procedural programming, Object oriented programming, functional programming etc.
Mathematical concepts such as algebra, statistics, probability, calculus etc.
Graphics concepts such as rendering, graphics pipeline, GPUs etc.
Data structures and algorithms. 

Follow processes

Be it Agile, lean, XP or whatever, follow it. Practice continuous delivery/ continuous integration. Use tools like Jenkins, Go CD, Travis CI, TeamCity etc.

Test your code

Don’t rely on manual testing for the most part. Try to test your code with code. You can write unit tests, integration tests, end to end tests and/or functional test to improve test coverage. Believe me tests helps a great deal than you think.

check out some of the testing frameworks like JUnit, Jasmine, Cucumber, Appium, Selenium etc.

Attend conference at-least once a year

Try to attend a conference around your place atleast once a year. This will motivate you and put in touch with the community around you. I attended Functional Conf  last year in Bangalore, India and it has been a eye opener for me.


Even though there are more things to do to become a good engineer, I am leaving you at a logical point here. Hopefully my perspectives will change in the next 5 years and I will try to writeup another post on this. Till then keep learning.

Tuesday, 3 June 2014

Prompt Strings - A Best Friend Forever

Hi I am a prompt string. I live in Deva's (My Master) System. It is me that you see as a prompt in the shell. My work is to show useful information that the master requires without distracting him.

I am completely configurable right from what information I give to what color I appear.  But most people tend to underestimate my capabilities and leave me naked. So I came to speak for myself.

Here is how I look in my master's system.

\e[0;31m\h-\u (\w)\$\e[m

I know, I may appear a little intimidating. But worry not, I am going to dismantle and describe myself. Before that, let me explain what I am capable of. Here are some of the stuffs I can show.


  • Date/Time in different formats
  • Host Name
  • User Name
  • Name of the shell and its Version
  • Current working directory ($HOME is denoted by ~)
  • Number of jobs currently managed by the shell
  • Git information
  • Results of custom commands


This is not an exhaustive list. My capabilities are limited by your imagination. Enough chit chat, lets discuss about my building blocks. The Shell do not recognise me by the name prompt string. They call me PS1. My siblings are identified by PS2, PS3 and PS4. I'll talk about them later.

Here I will take different forms and then explain you what makes me look what I am.

\h shows the hostname of the system (beast)
the hyphen (-) is just a static text shown as it is
\u shows the current username (devarajn)
\$ shows a # if the effective UID is 0, otherwise shows $






\d shows the current date in the default format
\w shows the current working directory (~ denotes the home directory)
the space in between is retained in the prompt as well
the dollar symbol $ is a static text as well. (This is different from \$)

you can also play with cool characters such as  ☠ ✂ ☆ ✈ 
But be sure to enclose them in \[ <non printable character> \]

Lets have some fun with colors,






\e[0;31m \e[m gives me red color
\d \w$ in between is same as before.

0;31 can be replaced by other color codes such as 0;30 0;32 0;33 0;34 0;35 0;36. You can replace the 0 with 1 to get the lighters versions of the colors.

Colors can also be set using tput. You can find a detailed list of building blocks here

As you know, I am PS1, the primary prompt string. I have a few siblings

PS2 - Continuation Prompt String, used when the command extends to multiple lines. Default is >

PS3 - Used as a prompt for the select command

PS4 - Prompt string that is used when you execute a shell script is debug mode using set -x. Default is +

Tools may come and go, languages may become obsolete, Technologies may become forefathers. But I shall sail with you throughout your journey. Don't take me naked.

Best Friend Forever
PS1