Python, Javascript, And PHP as Languages for Beginners
Introduction
Python, Javascript, and PHP are all known as languages that beginners can use to sink their teeth in programming. Those three language are also frequently used in many commercial applications. Given all these three choices, which language should a beginner learn? Well, here’s the features of the three languages broken down.
Python
Pros:
- Cross-platform
- Used on the desktop and server
- Has a module for everything that you could ever think of
- Has good documentation
Cons:
- Indentation is required, and errors will come up if code is not indented properly. UPDATE: A bunch of people told me that they think indentation is good as it teaches newbie programmeres to properly indent their code. I understand the good part of this, but I think that forcing indentation seems extreme. I guess whether this is a con or not is completely up to the developer.
- It may take some Googling to figure out how to use a certain module. I can tell that from personal experience.
- It’s not HTML-embedded like PHP or Javascript, so it’s a little more work to write web applications with it.
Python is ideal for the person that wants to create cross-platform applications on the desktop and server, and doesn’t mind having to install Python if they’re on Windows.
Javascript
Pros:
- All you need to execute Javascript is a modern browser, which is something available on plenty of computers.
- Reduces server load in web applications
- With AJAX-style Javascript coding, you can make web applications more like desktop applications
- In the form of Greasemonkey scripts and similar, Javascript can be used to modify the functionality of other webpages.
- Since Javascript works with HTML, you can create user interfaces much more easily than with Python.
- Javascript can be used to make desktop applications with things like Adobe AIR.
Cons:
- You can’t expect Javascript to act the same everywhere. Different web browsers handle Javascript differently.
- Users can disable Javascript in their browser, or have a web browser that’s too old for your application.
- Because of the the first con, Javascript is harder to write and debug
Javascript is a good first language for people that are willing to put work into writing and debugging code, but they do not want to install things. It’s also good for people that want to make HTML pages easier to use.
PHP
Pros:
- Is server-side like Python, but shares the same ease-of-interface making as Javascript.
- Is HTML embedded. This makes it even easier to make user interfaces in HTML.
- You can bet on recent versions of PHP being available on (most good) shared hosting servers due to it’s demand.
- Has good documentation
Cons:
- It’s easy to shoot yourself in the foot.
- Not good for desktop applications at all.
- The community is filled with newbie programmers showing others code examples with bad programming practices.
PHP is good for people that want to develop server-side web applications quickly, and are okay with the application not being as fast (I can’t find the link to the testing that shows that Python is faster). It is also a good idea to buy a book on PHP in order to learn all the bad programming practices that are often showed in newbie code examples that are posted on the Internet.
Posted in Uncategorized | View Comments