Software Engineering Vs Programming

When I was growing up,  Software Engineer and Programmer seems same term to me.

Now after working a couple of years as a Software Engineer I think I can distinguish between the two terms. 

Programming is a small part of Software Engineering. 

Software Engineering include

  • Understanding Requirement 

  • Designing Software

  • Organising code 

  • Testing Software 

  • Collaborating with other software engineers

Writing good code is essential skill for being a Good software engineer but you can not neglect others skills as they are equally important for building good product.

I read something similar in Software Engineering subject during my graduation, but none of the above make sense than. I think reading about software engineering is not the great way to learn about it instead build a lots of software and you will get a grasp of software engineering.

What text books do not tell you about Software Engineering is :

Understanding Requirement:

  • Understanding requirement is easy but always keep in mind that its going to change in future.
  • Question everything, until it make sense to you.

Designing Software & Organising Code:

People don't pay much attention about organising code when writing software but its not healthy for software health. When Software grows old, non-organised software is difficult to take care off.

Keep It Simple  

To check if you are doing it right, think with perspective of a person who does not know anything about your software. Now if you can still navigate through the software without anyone's help than you are doing it right else you need to step back and make your software simple enough to be understood by all.

Testing Software:

Nobody can teach you the importance of testing until you realise it and it may be too late when you realise its importance, therefore its important to learn from the mistakes of others.

Like all other engineering department , software engineering is also about building product. Civil engineer design bridges, buildings and then act upon and make it happen. Similarly we design software and write code to make it happen. But the main difference is the change in requirement we get every now and than. People take it for granted that changes in software is not a big deal.

If your software is not automated tested than your software will surely break in future with all the inevitable change in requirements coming.

Collaborating with other software engineers:

Text books don't tell you that you will be working with other people on same software. Collaborating with others is essential and you can not run away from it. Collaboration helps deliver better product if people working together are passionate about the product.

Its always better to have different opinions and healthy discussion on possible solutions.

To all Software Engineer out there, lets collaborate and make something awesome. cheers :) 

Creating an ember cli component addon for javascript library

Create addon with generator command

ember addon <addon-name>


ember addon ember-cli-holderjs

Add bower dependency

 create blueprint to install dependency
 ember g blueprint <addon-name>


ember g blueprint ember-cli-holderjs

Two files will be created

installing blueprint
  create blueprints/.jshintrc
  create blueprints/ember-cli-holderjs/index.js

Edit blueprints/<addon-name>/index.js

Add afterInstall hook to add javascript library package to bower.json

afterInstall: function(options) {
    return this.addBowerPackageToProject('holderjs', '2.9.0');

Generate component

ember g component <addon-name>


ember g component ember-cli-holderjs

This will create following files

installing component
  create addon/components/ember-cli-holderjs.js
  create addon/templates/components/ember-cli-holderjs.hbs
installing component-test
  create tests/integration/components/ember-cli-holderjs-test.js
installing component-addon
  create app/components/ember-cli-holderjs.js

Edit addon/components/<addon-name> according to your need.


import Ember from 'ember';
import layout from '../templates/components/ember-cli-holderjs';

export default Ember.Component.extend({
 layout: layout,
 didInsertElement: function() { {;

Edit  addon/templates/components/<addon-name>


<img data-src={{src_url}} alt='holderjs image' class={{class}} />

update package.json dependencies

"dependencies": {
    "ember-cli-babel": "^5.1.3",
   // Add ember-cli-htmlbars for compiling templates
    "ember-cli-htmlbars": "0.7.9"

Add dummy app

update index.js

/* jshint node: true */

'use strict';

module.exports = {
  name: 'ember-cli-holderjs',

  included: function(app){
    // Include library js file + '/holderjs/holder.min.js');

update bower.json, add devDependencies

"devDependencies": {
    "holderjs": "2.9.0" // Javascript library 

update tests/dummy/app/templates/application.hbs


{{ember-cli-holderjs src_url="holder.js/132x128?text=Upload Photo"}}

Check if addon is working properly

Run server:

ember server

Browse : localhost://4200

Don't over concern your rails project

Rails Concern is a good feature, don't make it evil . John McDowall has written an excellent article about how we are misusing rails concern. 

Rails concern are not meant to make your fat model skinny, its meant for making your life easy when you want to include, extend  and use included callback ( all the same time) in a module.

`Skinny Controller and Fat Model` is not enough for writing quality code. Fat Model is pain for maintenance and enhancement. Its nightmare for new developer on the project.

We use Code climate to keep a check on code smell.

Code climate complains when your model start becoming fat and simple option to shut code climate is to pull out some methods related to same logic and dump in a module or concern and code climate gives you green signal.

Even though code climate says your code quality improved but in reality you have just deteriorated your code quality. According to code climate team `Pulling out methods from model to some module is not refactoring ` but code climate is not smart enough to catch this. I think that's why they quote :

Any application with an app/concerns directory is concerning.”

 Solution for writing quality code is to follow Single Responsibility Principle . 

 - Model should be responsible for defining validations, callbacks and methods directly related to class.
- Avoid Callbacks
   - only use callbacks for preparing object.
   - after_* callbacks are Bad. Once model is saved, purpose of model is done.

- Add Service(plain ruby) object whenever you can, to solve a particular problem.

Resolve OpenSSL::SSL::SSLError on Yosemite

If you are using rvm installed ruby on Yosemite OSX and getting error :

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

then reinstalling ruby with `--disable-binary` may fix this Issue.

rvm reinstall 2.1.2 --disable-binary


Ruby installed with packaged binary in rvm has OpenSSL path: /etc/openssl 
Path of installed openssl is : /usr/local/etc/openssl

To check openssl directory:

> irb
> require 'openssl'

Deploying Ember Cli App

Now deploying ember-cli is no more a challenge, ember-cli-deploy Addon is good solution for deploying ember-cli apps but why settle for good solution when you have awesome solution out there .

Yes, you read it right. Thanks tedconf for building front_end_builds and ember-cli-front-end-builds .

Front_end_builds :

Rails engine to manage front end builds and deployments

  • Admin interface lets you easily view, rollback and activate different app versions
Admin UI look like this :


Easily deploy your Ember CLI app to a front_end_builds Rails backend.
The deploy process involves:
  1. Creating a build of your ember-cli app
  2. Uploading your assets to S3
  3. Notifying your Rails backend with info about the new build

I used these gems for deploying ember-cli app and I highly recommend everyone to try it.

Add handlebar helpers in ember cli project

Updated for ember-cli 1.13.8

To add handlebar helper, create file under 'app/helpers/' directory

If your helper name is 'if-first' than your file will be like 'app/helpers/if-first.js'

Remember to use dash in helper name so that it will be loaded automatically, for more info read .


Check for first element in each loop.


import Ember from "ember"
export default Ember.Helper.helper(function(options)  {
 if(options[0] === 0){
    return options[1];
    return options[2];

then use it in your handlebars template

{{#each items as |item index|}} 
<div class={{if-first index "active item" "item"}}>

You can also pass  parameter to helpers like:

 {{#format-date date}}

 and collect parameter:

 export default Ember.Helper.helper(function(date) {
    return moment(date[0]).fromNow();


Letter To Ruby Conf India Organisers

Disclaimer: This article consist of my brutally honest review about Ruby Conf India 2015, If you are prone to depression, heart attack while reading criticism, please STOP reading this letter now  and move on.

I know organizers worked hard to organize this event and I thank you for that but this does not mean I am happy with the way it was organised. I have complaints, so do lots of people I know. Someone has to raise voice, for now I am taking this responsibility.

1. Why Discriminate ?

I was given accommodation in Justa-panjim while most of the conf attendees were in Cidade-goa, those two hotel are incomparable. Justa-panjim didn't have enough water for bathing, forget about swimming pool, beach.
I didn't had complained if everyone was given accommodation in Justa-panjim, Yes I am being jealous here..!!! I paid conf fees(lite tickets.. yes thats how early I booked my ticket.) and I deserve to be treated equally , why discriminate ?

2. Where's Ruby ?

In some of talks, I was wondering if this is ruby conf. If I go to ruby conf, I expect talk related to ruby and not about Hadoop, web component etc. If I want to know about Hadoop , I will go to hadoop conference.

3. Talks or Tutorials ?

You can teach how to write your own Active Record and use React in Rails project (without knowing why to do that) in 20 minutes, but it does not help anyone. I don't know if you actually care if someone learns from your talk or not. If you do care then you must know that I am attending conference to know about your experience of writing new Active Record, why you needed new Active Record and what challenges you faced, similarly I am interested in knowing why and when I should use reactjs in my rails project and what made you use reactjs instead of writing rails views ?

Lastly I want to mention 2 talks which I enjoyed
i)  Aggrobot - go fetch me an aggregation By: Shadab Ahmed
ii) Talk by Bryan Helmkamp
Hoping to see talks like these in future ruby conferences.