I have never been an average user of computers. I wanted to program and the primary reason for that was to make the system do things the way i wanted it to. With time i realized that some programming languages fits your need better than others.
Gradually, we will all begin to prefer one language or a set of languages over the others. We all get into that comfort zone and start to call them our favorite programming language.
I realized that it largely depends on what you want to do with a language and how long one has been ‘stuck’ with it. It has nothing to do with speed or features. The interesting part about this is that, many of us have our favorites because we use it at work and the lucky few find a job that lets them use their existing skills.
These programming languages are just as similar to the spoken ones. With repeated use one gets proficient, there is grammar, there is a way to go about with it and yet the very basics of all of it remains the same. But there is a major difference. Learning programming languages with a similar abstraction level is easy. But if you want to be good in language that has an entirely different way to doing things, then be ready to lose some of your existing skills.
We can argue that a person can be good in multiple programming languages. Yes, i agree to that. But that’s why i mentioned about abstraction levels. I’m good at Perl and Python. I’m bad at C and Java. The first two are high level programming langues compared to C and Java. The level of abstraction provided by them is greater. I was good at C in college. But as soon as i picked up Perl and got comfortable at it, i went bad with C.
For me, typing mattered and that meant i was quite comfortable when i was able to do something in 5 lines against 15.
I must say that i have been lucky at my profession too. I’m into QA and that meant a lot of scripting. Basically a lot of Perl or Python. Even though i’m working for a company that builds majority of its products in Java, I really never had to possess any deep Java skills.
So, the question is -why is it so? Why? Why can’t one be really good in any programming language that one needs irrespective of the whether it’s a low level or high level?
I think the answer is the that it ‘spoils’ you! By letting you do anything you want to, it simply makes life easier. Hence we pick the languages that we want to for the things we want to do. Let’s look at it this way, you wouldn’t write a REST client in C and you wouldn’t want to do PIC programming in Python. Technically you can, but you got to be really crazy enough to do it.
Usage of strings are a better way to demonstrate this. Let me just give some examples as a closing note.
String Additon: “Hello” + “World” = “HelloWorld” being the logic
In C :
[c]
#include <stdio.h>
#include <string.h>
main() {
char str1[] = “Hello”;
char str2[] = “World”;
strcat(str1, str2);
printf(“%s\n”, str1);
return 0;
}[/c]
In Java:
[java]
class stringAddition {
public static void main(String[] args){
String str1 = “Hello”;
String str2 = “World”;
System.out.println(str1+str2);
}
}
[/java]
In Python:
[python]
#!/usr/bin/python
str1 = “Hello”
str2 = “World”
print(str1+str2)
[/python]
String Comparison: “hello” is the same as “hello”
In C :
[c]
#include <stdio.h>
#include <string.h>
main()
{
char str1[] = “hello”;
char str2[] = “hello”;
if(strcmp(str1, str2)==0){printf(“Strings Match\n”);}
else {printf(“Strings Don’t Match\n”);}
return 0;
}
[/c]
In Java:
[java]
class stringComparison {
public static void main(String[] args){
String str1 = “hello”;
String str2 = “hello”;
if(str1.equals(“hello”)){System.out.println(“Strings Match”);}
else {System.out.println(“Strings Don’t Match”);}
}
}
[/java]
In Python:
[python]
#!/usr/bin/python
str1 = “hello”
str2 = “hello”
if(str1==str2):
print(“Strings Match”)
else:
print(“Strings Don’t Match”)
[/python]
Let me know your thoughts…