Sunday, 20 January 2013

Some facts about all the Programmer or a Software Developer

No matter where you are in your software development career or what technologies you work with, there are couple to things we all have in common:
  • Education (Everyone needs to go for education but the nature of that education can differ.)
    • Knowledge (the things we know)
    • Skills (how we use the knowledge)
    • Judgement (Choosing the right approach)
  • The challenge is - There are always new platforms, new tools, new languages as our field is growing rapidly.
In case of any other profession, if you stop learning, things will still work. But in fields like software development and information technology, we need to make learning as our habit and a passion too as if you don't do it, your skills will be less valuable in the IT market.

But wait!!! you can't learn everything going on in the industry. One needs to develop a education  strategy to move ahead and choose what to learn and what not to learn. This is a very important step one needs to make in this field for their career. So, let us figure out how can we move ahead.

We can move ahead to know about education strategy but think for a minute for the title that you are using for your career. There is a programmer  software developer, software engineer, software architect, computer scientist, etc. These title are for the human resources of many organisations. Let us divide our community into two groups or titles: The Programmers and the Software Developers. A software developer may have the skill of a programmer or software architect or software scientist, etc. 

If you ask a programmer to to write some code, you will get a quality code written if the programmer is confident with proper comments and following good practises. But if you ask a software developer to write some code, you will get questions like:
  • How does it fit in the business process? Are the requirements thought out?
  • Are you sure you understand what it will cost?
  • What kind of documentation it will need? 
  • Many others...
Both has different approach to deliver some code. Programmers will write the code for a problem and software developers will deliver the solution by sometimes writing the code. 

Languages Don't Matter
We discuss a lot about the languages that we use like pros and cons or which is better c# or vb.net or someone might say python/ruby/PHP/javascript is good, etc. But the point is, Languages Don't Matter.
  • Programmers care about individual languages and 
  • Software developers care about language characteristics:
    • Strong or loose typing?
    • Case sensitivity?
    • Object oriented? Inheritance? Interfaces? Properties?
    • Functional?
    • Datatypes?
    • Platform Integration?
    • Interpreted, compiled, or something in between?
    • Control Structures?
  • Languages are secondary to platforms.
  • Language doesn't matter from a technical perspective, but it really do matters from a business perspective. If a business works with a language that is not liked by many there might be a huge risk or cost to find someone to support the systems in future.
  • A typical software life cycle cost can be like (may vary):
    • Requirements and Design - 20% of the cost.
    • Code and unit test - 10% of the cost.
    • QA/deployment - 10% of the cost.
    • Maintenance - 60% of the cost.
Keeping the above table in our mind if we compare language A and language B below:
  • Language A - 50% reduction in coding costs, better tooling but not popular and hard to find develoeprs.
  • Language B -  very popular - developers are 50% cheaper.
Which one would you go for?
  • From technical perspective, A is the better choice. But you should choose B, as it is good for long term cycle of your system.
Formal Education

There are some important points like software development life cycle, what to ask before starting a project, how to learn  a computer language and just not use it to complete a project, etc. One can learn all this by having a good experience but a formal education in college and universities, a graduate is more close to become a software developer.
Going to college or university has many advantages. You might find yourself creating a network of friends which is another source of learning and enjoying! It also gives you credibility i.e. your education provider gives you a certificate at the end of your course that you have learned a particular module or subject and this will show to your future employers about your abilities. It is also common to not to join a college for a degree and start working directly in this industry but to have a better knowledge about this industry, one should attend a degree course from college or university.

Which School is Best?

For computer science at undergraduate level, they all teach the same thing. They use the same resources, text-books. So, choose the course wisely like don't go to a college where they are teaching computer programming instead go for computer science. Employers are keen to know where you did your graduation from but in this industry this is not that important as once you get your first job, they only want to know what you did in your job. You should ignore the college rankings.

So, What does Matter?
  • Go somewhere you like (culture and atmosphere)
  • Look for Reasonable cost. (Fees for the course, living cost, etc)
  • Consider the level of competition
  • Location and Industry connections (As local organisations will be interested to invite students to join them or placement or internships, etc)
Building a Foundation

There are some facts that everyone needs to know and remember we all are in the same boat:
  • You can't know everything.
  • You can't keep up with what's new.
What do you about it?
  • Learn how to learn 
  • Learn what not to learn and where to stop
  • Learn the fundamentals
  • Learning on demand
The last two points above are very important. Say suppose you searching for a code sample to work with A and B as technology. You might find a code that works and you just use it by modifying some lines of code as per your need. But wait, this is the best time to learn about the fundamentals of those technologies or languages A and B. This will help you to learn about them and making your own solution. Also, if you practise this in your daily routine, you can be a just-in time programmer.

Resources

Where can you go to learn technologies? In college...? No, going back to college again is not the answer.
  • Classes (schools or training companies) - but they might not be working in real environment to deliver production code.
  • Conferences
  • Documentation for those technologies are the best material to look at.
  • Search (articles, blogs, forums and references)
  • Forums in questions ans answers format.
  • Books
  • Create them for yourself - make your own notes, etc.
Study Workflow
  • Breadth vs. Depth
    • Breadth - build a foundation in multiple subject area
    • Depth - specialise in targeted subjects as needed
  • Don't let your specialisation become your identity. As in our field, all technologies have a time frame and you might not find your specialised technology to be as good in the market as it was 8 years before.
Choosing Technologies

If you are an employee, you management might have the preference to select a technology or if you are an consultant, your client might have the preference to do so. But it is important for you to decide, which technologies, you want to work with.
  • The key is to look at the supply and demand.
  • Try to pick the survivor.
  • Don't believe marketing hype.
  • Don't always follow the money.











Thursday, 10 January 2013

Career of a Software Developer and some strategies to Survive


If you are an software developer by profession or have hobby to develop in some languages, I guess you spend most of your time working on different technologies and updating your skills either by attending conferences, books and other sources. There are many things to learn and by the time we learn some of them, we again have lots of other new things in queue, that never ends! It is sometimes very difficult to how to work in such environment and keep learning and updating your skills. Everyone has this issue but very few talk about this! Geeks can talk a lot about comparing different technologies or the competition going on between Microsoft, Google or any other organisation. But wait, is this all a software developer can think of or should do? No, we are not taking care of many important factors that I am going to talk about here.

There are some points that really means to be a software developer. There are many things that no one teaches us in school or university. Here are some challenges that a software developer has to face, but very few talk about:


  • Technical - is about keeping up with the rapid change in our field and to choose wisely which one to go for...!
  • Professional - related with the politics going in the company or dealing with managers or struggling to become an manager of which you don't have any knowledge or experience.
  • Financial - Interpreting the job offer or should we invest only in our company's stock.
I don't know about you how you introduce yourself as a software developer or a programmer who codes but I introduce myself as I ship production/release code. Yeah, it is different then yours but in a good way because it says that you are just not writing codes as part of your side projects or while working on a open-source project, it just says that do something that people use in real life on their computers. And yeah, to find a solution for a problem, a solution that makes life easy for an end user. 

Hey! Will you stop writing code in future or will you change your field? Think again, as there are many reason for which someone may go into the software development field. Reason can be programming is fun, you like challenges, doing something creative or it tends to pay well or may be we are sometimes better with machines than with people, etc. I hope you have you reason with you as this is very important whether its love towards learning, technology or money or you don't like to deal with people (against managerial role) or anything else. You need to be clear with yourself as this will help you to move towards success.

How do you measure Success? 

For some, its
  • Money...?
  • Friends and Family...?
  • Recognition...?
  • Fame...?
  • Making a difference...?
  • Anything else...????
Find yours wisely so that your priority drives your career path.

Goals

Now, you have a priority to climb the ladder of succes but will you be able to do it without defining a Goal? No way! If you are not aware what you want, you won't get it. If you don't have any idea at the starting, atleast try to define a generic goal for you. Another question that someone might ask   to himself is how technical I want to be? Software development can be a path to many related careers. 
Somehow, your work will take the priority of more number of hours from the 24 hours and you will get  very less time to spend only for you! So, you would not choose something as your goal that you don't enjoy or that is boring! Choose something, that you love and enjoy and even getting paid for that enjoyment. If you are doing this, then someone is not stealing your life! Instead they are paying you to do something that you would be doing if you don't had a job. Also, everyone one has financial needs, so choose wisely if money is your main reason for success. 

Try to answer the above questions taking your case in your mind. Write it down and keep reading. I will be coming with the next part - Some facts about all the Programmers or Software Developers.



Thursday, 3 January 2013

Extract key/values from FormCollection in ASP.NET MVC action method

 To avoid you from having to chase for the same information: here's how you extract key / value pairs from the FormCollection that comes as an argument in an ASP.NET MVC action method:

public ActionResult Create(FormCollection formCollection)
{

   foreach (var key in formCollection.AllKeys)
   {
      var value = formCollection[key];
      // etc.
   }

   foreach (var key in formCollection.Keys)
   {
       var value = formCollection[key.ToString()];
       // etc.
   }
}
Also, a final tip: If you find that the formCollection does not contain the key/value pairs you expected, check that 
  1. Your controls reside within the correct form (you can have more than one)
  2. Your controls have names (just having an id is not returning values in the formCollection)
Hope this helps. 

What if I don’t have SQL Express installed?


 what if I don’t have SQL Express installed?

If you don’t have SQL Express installed and running, you may have got the following error when your code tried to read or write some data:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Blah blah blah…
No problem! You can quickly switch to use the new SQL Server Compact – a lightweight, in-process database – without having to download or install anything manually. Simply add SQL Server Compact to your project by issuing the following command in the Package Manager Console:
Install-Package EFCodeFirst.SqlServerCompact
Ta da – no more external database required. Run your project again (Shift-F5) and this time it will create and connect to a file-based database (a .sdf file will appear in your ~/App_Data folder). The EFCodeFirst.SqlServerCompact package adds a file to your project called AppStart_SQLCEEntityFramework.cs, which configures the runtime to use SQL CE.
Of course you probably still want the proper version of SQL Server when you eventually deploy your application for public use, but for small applications or for learning, SQL CE is really handy.

Thursday, 20 December 2012

Must Have Developer Tools! Some tricks to develop quicker

Google Developer Tools, Some tricks to develop quicker

  1. View Source => By going through menu navigation or Ctrl-Shit-I on windows or Cmd-option(alt)-I on mac.
  2. Or for particular element, just right click on it and choose inspect element.
  3. For fast navigation, prefer keyboard arrow keys to collapse or expand DOM elements. You will find the width and height of that active element as you move in Developer Tool.
  4. To get the full view of the page, try Ctrl - (minus) to zoom out so as to see your whole page with developer tools open without scrolling. Sometimes useful to me.
  5. You can copy the the content or the DOM elements by using your mouse, but you might like to do this by using console's copy() method. For example, copy(document.body.innerText) and then paste that anywhere. Its handy if you know the DOM element and may help for productivity.
  6. Use clear(); function to clear the console, however the developer tool has a GUI for that.
  7. Use inspect(body) to inspect body element of the DOM, just pass any element in the function.
  8. Also, you can use $0 to access the element that is selected in the DOM in a console. So,  you can pass $( $0 ) for jquery method where an anchor tag was selected in your DOM, so it means you are accessing that anchor method.
  9. Under Network tab, the blue line in the waterfall chart shows that the DOM is ready or the DOMContentLoaded Event fire and the read line shows the windows load event which waits for the documents to load images, iframes, etc.
  10. You an see the cookies information by going through the Network tab and then selecting Header or Cookies tab.
  11. For javascript debugging, we can edit the script file of the page on the fly and it will render it as this feature is unique to Chrome because of its V8 JavaScript engine.
  12. Sometimes, its hard for us to find where the error is in our script, so you might want to open the script in developer tools and then click the pause button, now chrome will set a breakpoint when it find the statement because of which the error is being logged in console.

Wednesday, 5 December 2012

Learn how to build HTML5 and JavaScript Apps with MVVM and Knockout (Part - 1)

One needs to understand the "Separation of Concerns" while building an application:

  1. The Structure i.e. HTML
  2. Presentation i.e. CSS
  3. Behaviour i.e. JavaScript
Do we use any UI patterns with JavaScript development, like 
  1. MVVM or
  2. Data binding structures
How should be write structured JavaScript? Should we write in a modular pattern?

Also, all apps love data, so, how should we care about data and bindings. Somehow, we need to load data from somewhere, such as using an Ajax service or loading JSON data on your screen and after getting the data how will you respect changes from the user

Knockout is a JavaScript library that can solve the above issues in a very nice and efficient manner.

So, what is Knockout?
  1. It allows you to have rich client-side interactivity for your UX provide a good pattern. 
  2. It gives you a good separation of structure and behaviour.
  3. It provides you to use declarative bindings to be able to help you bind your UI elements, in case, HTML or even may be CSS styles and classes down to your source object. 
  4. Offers you to work in MVVM pattern.
  5. It has a very good browser support. (IE6+, Firefox 2+, Chrome, Safari, Opera)
Key Concepts of Knockout:
  1. Dependency Tracking via observables (eg: a property depending on another property and it is in sync with a UI control and vice-versa(optional).)
  2. Declarative Bindings (Instead of using JavaScript to go through DOM and find a particular control with certain ID use can bind the control from the html itself to push data to the UI and pull data from UI again from/to the source object.)
  3. Templating Support (eg: you might have repetitive structures in your webpage like list of abc or rows in a list box, rows in a table or li in a ul/ol. You can use templates to take care of those views. You can use jQuery templates with Knockout, or native templates of Knockout or any third party templating engine.)
Demo
The important factor is to understand the MVVM in terms of Knockout: the separation of concerns. 
  1. MVVM is just a separation pattern and a way to organise your code structure to make it easier to maintain and to deal with separation and responsibilities.
  2. Model-View-ViewModel
  3. Not technology specific. ( you might have heard MVVM with XAML and now you are using with Knockout with JavaScript and HTML.)
  4. Works well with data bindings. (in this case its html)
MVVM Components
  1. We have a view which is this case is HTML. ( is the user friendly presentation of information)
  2. We have our model which is in JSON. (javascript object in this case which has a property named as firstName)
  3. Between above two, we have logic to separate to how to  present that model JSON data into the view itself and that is our view model. 
    1. It contains all the behaviour for the view that the view needs and can aggregate on or more models to show the data inside the view.
    2. Contains properties like firstName, methods and the Model.
Demo
  • Nuget - to manage 3rd party libraries and references.
  • Web Essentials - code collapsing, vendor specific css properties, etc.
  • Web Standards Update - html intellisense and validation.
  • WoVS Default Browser Switcher - quickly change the default browser from visual studio.
  • JSLint - javascript code analysis.
  • CSSCop - catches common CSS issues.
  • Resharper 6 (trial version only) - javascript refactoring tools.
Begin Coding with Knockout and Visual Studio
  • Either download the JavaScript references from http://knockoutjs.com/.
  • Either get the debugger or minified version from Github.
  • Use Nuget to install Knockout.
  • Add intellisense for Knockout in Visual Studio for any *.js files by adding the following: & lt; reference path="/scripts/knockout-2.2.0.debug.js" / & gt; at script-page level.
    • After doing this, whenever you will type ko. you will see all the options that you can use from the Knockout library.
    • It has to be the first line of code in the page and you have to comment it using "///".
    • Or use a tool like Resharper that will add the intellisense support for your project by its own.
Key Resources
Stay tuned for part - 2.

Friday, 30 November 2012

The Building Blocks of JavaScript Programs

This post is second is series of learning JavaSciprt fundamentals. You may like to visit this article to go through all the posts in the series.

Now, we will learn some building blocks the bits and pieces, that one should know to write JavaScript code.

The working demo for this post is here.

Outline

  • Comments - using which you can write some hints for a piece of code.
  • Variables
  • Null - a special object in JavaScript programs
  • Undefined - which is slightly different primitive type in JavaScript.
  • Finding Help - we will see where we can go for any assistance/docs for JavaScript.
  • Objects
  • Equality - how things are compared in JavaScript which one should be aware of it.

Comments

  • The comments in JavaScript is kind of similar to comments syntax available in Java.
  • Comments is something that won't output anything as a result like your other piece of code, it is just for your use as it doesn't get rendered by the JavaScript interpreter. 
  • Single line Comment - "//", this two forward slash characters is used for single line comments followed by any single line sentence. For example, "// this is a single line comment".
  • Multiline Comment - "/*  your content */", the syntax for this comment is forward slash and star to start with, put your multiline sentence after that and close it with start and forward slash. For example - /* As you know this is a multiline comment, in which you can break the sentence into n number of lines.*/.
  • You might want to use comments for any piece of code in order to instruct yourself or to any other developer in the team that what that code does, etc.
  • The working demo for this post is here.

Variables

  • Variables in JavaScript are declared with 'var' keyword.
  • Variables type is inferred, i.e. they don't have a type until a value has been assigned to a variable. When assigned, the type is then defined from type of value specified.
  • The working demo for this post is here.

Null

  • Is one of the JavaScript primitive types.
  • Null means the absence of a value.
  • But when null is used in any boolean expression like in case of a if condition, it evaluates to false.
  • The working demo for this post is here.

Undefined

  • Is also one of the JavaScript primitive types.
  • It represents an unknown value i.e. a variable that has not been assigned anything.
  • We encounter undefined when a non-existence object property is called.
  • But when undefined is used in any boolean expression like in case of a if condition, it evaluates to false.
  • The working demo for this post is here.

Finding Help

  • Everything in JavaScript is an object except for the simple types like string, number, boolean, null and undefined.
  • Objects are collection of properties and the values of those properties can be of any type.
  • Objects are declared with the object literal notation.
    var anobject = { firstValue: 'a', secondValue: 2 };
    • In the above example, we have created a anobject object, with two properties - firstValue with a string value and secondValue with a numeric value.
  • In JavaScript, there is no class construct but we can define our objects and properties.
  • The working demo for this post is here.

Equality

  • Objects are only equal to them-self.
  • Primitives are equal only if the values matches like ("Dog"==="Dog").
  • There are two types of equality operators in JavaScript:
    • ==
    • ===
    • The difference between the two is type coercion.
    • == only checks for values but === check for values and also for the type.
    • Use === over == and !== over != as it gives a proper answer comparing value and the type. Although, the decision is yours. 
    • The working demo for this post is here.



Search...