Starting Programming – A Newbie’s Guide to Language Selection

Starting programming I must say is huge step in your life if plan to adopt it as a career. Its a sure thing that with growing technology there is a vast demand for good programmers and not to mention that the payday is quite good. With so many programming languages out there, learners have a lot of options which most of the times are confusing. Always remember that future of a programmer lies in his very initial days of his programming. I am not saying that if you get on with a bad start you won’t succeed but with the right choices and right start you can achieve a very high level of programming skill within very less time. By right choices I mean “Which programming language to choose first?”, “Which approach to take?”, “Which are the right places to learn?”, “Which books to refer?”.

Which programming language should newbies choose to start with?
Well there are many like C, C++, C#, Java, PHP, Python etc. But I would suggest you start with C Programming since its very simply, straight forward. If you choose to start directly with C++ or any other high level language, there is a very less chance that you will understand basic concepts of programming. There is another great advantage of starting programming with C language which is you get very familiar with the syntax(with practice of-course) which will help you while learning other high level languages. I say so because almost all high level languages have similar syntax as C language. This is the main reason I insist on learning C first.

Don’t just rush with the language because programming is field where learning requires a lot of patience. Take your time for learning and getting used to the language because its your first language and it is laying foundation. I am not saying that you should completely master the language when you start because it is impossible to master a language overnight. You will automatically master the language eventually as you keep practicing programming in it.

For a quick start you should atleast complete the following topics in C.
1. Data types and keywords
2. Condition Statements(if, if-else, nested if-else, switch-case)
3. Loops(while,for,do while)
4. Arrays(Single dimensional and 2 Dimensional)
5. Functions and parameter passing.(Also study in built functions like string and math functions)
6. Structures
7. Pointers
8. File handling(Open, Read, Write, Append, Close)

The topics I mentioned above are very important. You can learn the other advanced concepts like Data Structures and Networking as you get more and more programming experience. Once you are done with C, you can now proceed with C++ which is the next in line. This is because its very similar to C and has an Object Oriented approach which C doesn’t have. C is Procedure Oriented. There are also many new in-built functions in it.

The important topics that are to be learned in C++(Assuming that you have learned the C Programming topics I mentioned above)
1. Inbuilt functions
2. Classes
3. Inheritance
4. Operator Overloading
5. Function Overloading
6. File handling

Again this is not all you need to become and expert programmer, its just for a quick start. You will learn advanced topics as you gain experience with this.
This was pretty much with the language selection. Now lets move on to the approach to be taken.

Which approach to take while starting programming?
There are two approaches you can take.
1. Procedure Oriented
2. Object Oriented

Procedure oriented approach is traditional and easy to understand for beginners. In procedure oriented approach program is executed in a linear manner. C programming language is procedure oriented while C++ has additional object oriented feature.
Once you get familiar with procedure oriented style then you can move on to C++ to learn object oriented.
Object Oriented approach has lots of advantages over Procedure Oriented but still I would suggest that you start with procedure oriented first i.e., C Programming Language.

Which are the right places to learn?
If you are a college student studying Computer Science you might think that what is taught in college must be sufficient. But this is not true, even though various universities across the world keep updating their syllabus after regular intervals it is not enough to cope up with the advancements in tech world.

For better understanding and more programming references, you should go online. There are loads of sample codes, snippets and open source projects available that you can study and understand.
You should join programming websites/forums like stackoverflow.com where people get proper solutions to their problems and you get the information that most of the time is not available in regular resources you depend on.

You can visit following websites to start learning C Programming online:
1. www.cprogramming.com
2. http://www.tutorialspoint.com/ansi_c/c_introduction.htm

Note: Do not go Google around for C Tutorials because might end up in great mess if you land at wrong place. The websites I mentioned above are sufficient enough to get you started. After completing this you are free to Google and land on advanced tutorials.

Which books to refer?
No matter how much data is present online to refer from, it can’t beat the books when it some to proper arrangement of topics and presentation.
Following are the best books to refer for C and C++ Programming
1. Let Us C by Yashwant Kanetkar
2. The Complete Reference C++ by Herbert Schildt
3. Object Oriented Programming With C++ by Robert Lafore

You can buy these books online at reasonable price from:
1. Let Us C
US/UK/CA(With CD)   India(Without CD)       India(With CD)
     

2. The Complete Reference C++ by Herbert Schildt
US/UK/CA                  India
 

3. Object Oriented Programming With C++
US/UK/CA                  India
 
I hope this article helps you. Share it if you like it.
Good Luck and Thank You!!

How To Do URL Rewriting

What is URL rewriting?
Well.. URL rewriting is simply a technique used to convert complicated URLs in simple and straight forward manner. This is actually used in websites which are made to dynamically update its content. For eg..  sites coded with PHP, ASP, JSP etc.
If you are familiar with programming, the complicated URLs are referred to as query URLs. They generally look like this www.somesite.com/product.php?id=58.
Here product.php?id=58 is called the query string. In this case the query string is small so it wont be problem to remember but if the query string becomes too large like
www.somesite.com/product.php?category=4&subcategory=1&id=58 the URL becomes ugly. Now here is when URL rewriting comes into use. By using this URL rewriting method we can make the URL look simple and straight forward. Now by using URL rewriting we can change it to
www.somesite.com/category4/subcategory1/product58. Easy to remember right?
Apart from this advantage it has its own importance with SEO. These URLs are also search engine friendly. Search engines generally don’t index the query URLs properly or sometimes they don’t even get indexed. The reason behind this is that search engines consider that the page would be dynamically updated and will have different results each time even though in many case doesn’t. When the URL is rewritten as static URLs with an extension of .html or .htm, the search engines consider the page as static and don’t  mind indexing them pretty quickly. So that was most of the URL rewriting now lets talk how to use this technique.

How to do URL rewriting for SEO using .htaccess file?
In this post I will explain how to do URL rewriting on an Apache Web Server.
First of all go to the root directory of you website then create a file in there and name it .htaccess
Creating this file isn’t quite very straight forward. You need to open a text editor and save is as .htaccess
Now come the important part. Add these lines to you .htaccess file.

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

Then you set the rewrite rules in the following format:
RewriteRule ^([^-]*).html$ post.php?title=$1 [L]

^([^-]*) represents the value you pass to the query string which in this case is title of a blog post.
Let me elaborate a bit.
Consider a blog post with title “How to do SEO”. This page can be accessed using query URL: www.somesite.com/post.php?title=How to do SEO.
But when we use URL rewriting as above, the URL will be like this:
www.somesite.com/how-to-do-seo.html

If you want to know more about the technical details about URL rewriting, you can visit the Apache Website for detailed documentation otherwise the above code just does the trick.

You can also visit http://www.generateit.net/mod-rewrite/ to generate rewriting rules for your .htaccess file. This tool is quite convenient.
Anyways here is the full code again(Skip the #s):
##############################
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^([^-]*).html$ post.php?title=$1 [L]
##############################

Quick tip: If some of you may not be able to make it work, go to your apache configuration and check if rewriting module is turned on. Change following line:
#LoadModule rewrite_module modules/mod_rewrite.so
TO
LoadModule rewrite_module modules/mod_rewrite.so

For IIS user there is a module available on IIS website, just install it and open it. Once you go in there everything is easy.
Visit:  http://www.iis.net/download/urlrewrite
Anyways I will discuss it in upcoming posts.
 
How does URL rewriting work?
What actually happens is when browser requests a URL the web server(Apache/IIS) passes that URL to the URl rewriting module and then the module does all the stuff. It takes in the URL compares it with the pattern defined in .htaccess file and access the data internally by query strings. Then the output is fetched and displayed on your screen at a nice looking URL 🙂

If you find this content useful, don’t mind sharing it, it can make someone’s day too 🙂