Skip to main content

· 3 min read

I am not a great programmer, but i love coding and trying my best to become a good coder, there are few things i got to know when i made a research on how to become an efficient programmer.

1. Search for a problem that's really annoying you that's tractable to being solved by some way of automation.

 2. Made a Google search for programmatic solutions to these kind of problems. Make a research on which languages are most commonly used and scalable to satisfy your wider needs. In all ways.

  3. Start trying to solve the problem by breaking down the problem down into smaller and smaller chunks and trying to find ways of implementing a solution in the language which you have chosen from the above step

4 .Code all the time, continuous practice whenever you have time. Keep trying to solve your problem- where you get stuck, follow people who seem to know what they're doing on github,stackoverflow and post their solutions. Ask whatever questions may be even if its not practical on stack overflow(If you don’t care about vote downs). Buy and read lot of books. Get over the "monkey-see-monkey-do" approach, especially when getting issues. Learn from your issues  by going fixing the immediate issue  to learning what class of conditions the error deals with.

5.Subscribe to online education sites like Codecademy, Peepcode, Udemy, CodeSchool. Copy, imitate, fail, bang and scream the desk. Smash your keyboard if code you wrote does not work, try again. Feel the elation of getting a small chunk right.  

  1. Every problem has (n+1) solutions,where n is the number of solutions that we try and 1 is that we have not tried. Every developer love that feeling when they’ve been coding something for a while, and it finally works. Yes, it is daunting. Yes, the learning curve is ridiculously steep. But you will only learn by doing and not being afraid to get it wrong.Whenever you write code always try to comment, so that other users who use your code will have an idea on what have already written. When you find a technique that works  or solve your problem generalize it and keep your own utility library.This makes yourlife and others easy.

 7. Learn to refactor your code.Whenever you get time try to improve the code.Whenever you Get confused with all your changes,  pick up git,tfs,svn or another version control system. Collaborate on others projects. Refactor again with what you've learned.  

I’ll finish with two quotes:

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”- Brian Kernighan

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”- Rick Osborne

· One min read

Well, I have decided to write on technologies finally. It was one of the good sessions from the SQL meetup held at Microsoft Sri Lanka this month. I learned some useful and simple SQL functions in SQL Server 2012.

SQL Server 2012 introduces many new rich built-in functions that offer more solutions to common T-SQL challenges. Some of the main functions which I am going to write about are:

Conversion functions

  • PARSE (Transact-SQL)
  • TRY_PARSE (Transact-SQL)
  • TRY_CONVERT (Transact-SQL)

Date and time functions

  • DATEFROMPARTS (Transact-SQL)
  • DATETIMEFROMPARTS (Transact-SQL)
  • DATETIME2FROMPARTS (Transact-SQL)
  • SMALLDATETIMEFROMPARTS (Transact-SQL)
  • DATETIMEOFFSETFROMPARTS (Transact-SQL)
  • TIMEFROMPARTS (Transact-SQL)
  • EOMONTH (Transact-SQL)

Logical functions

  • CHOOSE (Transact-SQL)
  • IIF (Transact-SQL)

String functions

  • CONCAT (Transact-SQL)
  • FORMAT (Transact-SQL)

In SQL 2008, to find a trend, we were using CTE functions. For example, to find the trend in 2008:

WITH CTE AS (  
SELECT rownum = ROW_NUMBER() OVER (ORDER BY WorkOrderID), OrderQty
FROM [AdventureWorks].[Production].[WorkOrder]
)
SELECT CASE
WHEN CTE.OrderQty - PREVCTE.OrderQty > 0 THEN 'UP'
WHEN CTE.OrderQty - PREVCTE.OrderQty <= 0 THEN 'NA'
END AS Trend
FROM CTE
LEFT OUTER JOIN CTE AS PREVCTE ON PREVCTE.rownum = CTE.rownum - 1

· 5 min read

Well, I am back here after a year, reasons why i have chose this topics are many. One of the reasons could be one fine day i got a call from my childhood friend who was working for a reputed company in India and was shocked to hear that he was fired from that company.

He was very frustrated when he shared , but i was laughing and asking myself "is this guy kidding me?" because he was such an asset to any company. But after one year of his resignation he was not able to find a job. Absolutely, sometime you are doing better than others but company throw you for any other reason, major reason would be "boss is always right" try to break this rule & you will find yourself out of the company very soon without proper reason, while your activities are good, your work is good, your relation with other is good.When i made a  call to mind about this incident, i decided to write a post on this.

Yes, Especially in India where job changeovers across segments despite talent.It takes two hands to clap! What then happens really depends on the confidence and ability of the organizations leadership to embrace and mold differences. It takes a keen leader to successfully manage different personalities and abilities and knit these into a very successful and performing team. Loving your job helps you perform better and enjoy whatever task you are assigned to do! Loving your company motivates you and fuels the love you have for your job.

These days with global market, relationship and interest that companies have for global market, it is hard to predict how your employer would react to such fluctuating market! For them designing a work-force that can produce more profit is a big agenda. Some companies consider you as important asset to reach that goal, but many others feel you are replaceable. It all comes to one principle, find a right company if you can and be smart when you apply for a job. Once you find the right company be loyal to them, help them grow and be a part of their journey.

In today's environment where restructuring is seen as part of doing business, howsoever effective, loyal or honest you may be, it comes down heavy when the company wants to get the organization in shape. Loyalty has become a rare quality in this day and age. Having said that, one should still remain as loyal as possible while with an organization, but it never hurts to keep feelers out. One can wind up on the sidewalk in an awful rush.

Love yourself first. Love what you do. Propose your ideas to the Company. Make a few friends, or not, with your co workers. Completely choose to separate your business life/personal life, it's up to you. Isn't it better when your Happy with who you are? There will be people, in our lives, that bring us down. Ultimately, you have the power to love, be loved and to choose your path. We all need POSITIVE in our lives, as our world leaders are confronted, with these exact feelings. It has saturated, the persons, in charge of our great world. So I say, "Love Yourself, Love Who You Are, Be the Best You can Be. But, remember you too can be replaced, at any given time.

Here's a non-sugar-coated, not touchy-feely, un-politically-correct, not evolved, non-progressive perspective:

Companies are neither good nor bad. They simply are a collection of people recruited to deliver value to shareholders. Let that sink in a moment before continuing. The people in companies create the culture. The culture fits for the individual or it doesn't. If it doesn't, the individual can:

  1. Leave (easiest option) 2) Change to fit the culture (a big task) 3) Change the culture (usually impossible).

Managers have personalities / styles. If the employee does not fit with the manager's personality or style. None of this makes the company good or bad. You fit your culture and can work with your manager's style, or you don't. Quit wining, make your choice, and get on with it. If you really think the company is plotting against you with nefarious intent, you have delusions of grandeur. Fact is, you just are not that important. You, like everybody else  will, be replaced when the value you deliver falls below what the company can receive from a competitor (somebody else who wants your job).

It's healthy and good for your emotional and professional well-being to love the work, and respect the company, but not expect the company to love or protect you back. I think all of us have been there, especially those of us who are over 23. We put a lot of passion and creativity in our work, and then the company makes a switchback, and you are no longer so loved. You then become marginalized, which is the neon sign that you should be on your way to another position. It's also natural to feel betrayed and angry, and those feelings shouldn't sandbag you, they should prompt you to get moving. Cheers!

· 5 min read

In general, this is not so much a Sri Lankan only issue as it is a global one. But the fact is this: piracy in Sri Lanka is increasing at an alarming rate. You have huge shops selling pirated software, movies, music and games. This commercialization is something that is primarily an Asia-only issue. The excuses people have given for buying pirated stuff are: we don’t have the money, the original is not available in Asia yet and it doesn’t really harm anyone. 

The problem is that piracy existed all along and is rampant even in the west, where laws are strict about it. But we are one of the few countries where it is commercialized and is now a source of income for many. The fact is, with more companies coming to Sri Lanka, the originals are available, though still heavily priced. It does harm the creator of that software, game, movie and music, which took  up time and effort to develop because the money he should get for selling his creation, is not being given to him. And not having the money doesn’t justify stealing. Since we call ourselves one of the better countries in Asia, isn’t it time that the anti-piracy laws be implemented heavily? Because this surely is going to harm the economy as Sri Lanka takes on the world IT market.

As a student of software development, it hurts people when they don’t get the money we deserve. How many people put how much time in developing MS WINDOWS  that we talk of? It takes years. Suppose we make something and spend 10 hours a day, for 2 years, and then some guy steals it, People give excuses like “it’s too expensive”. Well, if you want to use it, you have to buy it, just because you cannot afford it doesn’t give you the right to steal it. Would you steal a car if you weren’t able to afford it and chances of being caught were minimal? What does that make you, a thief? Companies are not cheating you. A guy who works for EA games, the company which made the FIFA series, Usually it takes them 2-3 years of hard work to get one game out. Thousands of people work on it, the money the company is making is due to the fact that they earned it. If the cost is too much, don’t buy it, no one's forcing you to. 

Piracy is one of the evils facing businesses and is one that causes losses to government and organizations. But, before saying anything further against piracy:

1) It is right that cost of developing any software is high. But when thousands of copies of it are sold, costs must come down, for example the cost of software like windows etc. is hardly in hundreds. For which they charge in thousands - is that right?

2) Because Windows and other Microsoft software are used extensively. there is virtual monopoly and because of this reason they are free to charge anything which they want.

Companies themselves are more responsible for encouraging piracy. To stop piracy is not only in hands of customers but major steps are required from companies also 

Apart from others views, what are my opinions of the rights and wrongs of  software piracy?

I often hear people say that software piracy is illegal. You can go to jail if you are caught. Great! But does that mean software piracy is wrong just because it is illegal? In fact, legality of a thing has nothing to do with its being right or wrong. 

Let's not forget India's major reason for success is IT sector. Now what made IT a success in India? It's the cheap supply of pirated software to every nook and corner of the country. An original copy of Windows XP costs somewhere between 10,000 to 12,000 Rupees (approximately). A pirated costs around 100 Rupees. The same is the case with Microsoft office, Photoshop etc. Now if all the copies were original and cost the computer owner a fortune, do you think computing would have reached the grass root level as it has reached today? 

Also some people argue that piracy leads to loss of revenue to companies. I disagree. In fact, piracy actually earns the company more money. When free copies of software, say a computer game is available for free, countless numbers of people will become aware of a product when otherwise they would have simply looked past it. 

This talk is known as "buzz" and it drives up the interest in the product from people who don't have their copies yet. Think about stuff you've bought. Aren't you more likely to buy something that everyone's talking about? 

Whatever we are today is only because of piracy. Obviously if good/ bad piracy had not been there, we wouldn't have become software professionals as all these software like Oracle which we used to get for Rs. 50 and practice used to costs hundreds of thousands with license.

Long live Piracy!!!

· One min read

That is a POSITIVE ATTITUDE , but  we have to Respect  Great Civilization...!!

We entered the year with baby steps,

Ending it with a weary trudge.

So much has happened,

Just in a year’s time.

A year of growth and learning,

A year of bitter and sweet,

A year of old and new,

A year to place in our Wall of life.

Now a new book is waiting,

It's pages pure and white.

New baby steps again,

A New Year to write.

This little poem comes with a wish,

That your New Year will be bright.

That it's pages will be filled,

With memories of much delight.