• 0

php or python for web development?


Question

I am trying to get into web development and I have been researching the different languages that I can use to start learning these things. I have a little bit of php knowledge, enough to allow me to make customization and changes to some things in wordpress but not enough to really do anything with it.

With so many different languages that can be used to code websites I am confused what would be the best one to chose to start learning. I have read good things about django (python) and how it is a better language that is more cleaner for bigger scale projects and that such. php is more widely used/supported and basically ready to go out of the box, however it has its own set of problems also. The more I read about the two different languages, the more I get indecisive.

Can you help sway me in the right direction?

Link to comment
Share on other sites

Recommended Posts

  • 0

Whatever you chose to go with don't use a framework, take the time to learn and understand the language first. (Y)

Agreed. You may think it's a good idea, but it will teach you bad (code) manners.

Link to comment
Share on other sites

  • 0

A good part of this article has be debunked. I'm too lazy to post link but do a simple google search. Anyone who write such a long blog post to critize a language clearly has an agenda. You know i hate web forms with a passion. I don't waste my time writing a 20 pages blog about it. I just don't use it when i can avoid it.

Is it actual debunking or people just disagreeing with the points he raises?

And it's fairly obvious that he has an "agenda" by posting about something, if he didn't care he wouldn't post about it, good or bad.

Link to comment
Share on other sites

  • 0

I self learned php and use it often

It was easy to pick up and as said before there are thousands of examples and tutorials etc online

Link to comment
Share on other sites

  • 0

Sorry for the late reply, but I wanted to get all my information together before deciding. So I want to thank everyone of you for helping sway me towards the right language.

I decided to learn php. I have been reading there is the "right" way of learning it and the "wrong" way that makes you a bad php programmer. The more I search there is no consensus from people on what to do / what way / what to read to learn php the right way. Can anyone direct me in the right direction?

Thanks. :)

Link to comment
Share on other sites

  • 0

Use PDO instead of any of the mysql_* or such APIs, they've been deprecated for years yet they're still prevalent in tutorials.

And double check the usage of every API call, they're all over the place in behaviour.

Edit: Oh, and use prepared statements with PDO, they're faster and more secure against attacks like SQL injections.

Link to comment
Share on other sites

  • 0

One thing I think is important to consider if you are new to web programming is that PHP errors are very clear - it pretty much tells you what is wrong. No idea what Python is like as I've never used it, but other languages (both web and desktop) that I've used are totally obtuse with errors, giving you little clue as to what needs to be fixed (which is really irritating when trying to learn a new language). However, this isn't to say you should depend on them later on. When you are comfortable enough you should look into handling errors and how to use exceptions correctly. But when starting out, the clear PHP errors are very useful IMO.

I think one big mistake people make with PHP is to just use a framework from the outset. You don't learn how to do various things that are quite important (and some just do little more than try to turn PHP into something it isn't, abstracting things over and over for the sake of abstraction). I've written my own frameworks and CMSs and the lessons I learned have been invaluable.

The other big mistake is to just copy tutorials without looking for more information. For example, if security is a big concern, read everything you can on protecting against attacks. This ties in with the former point - when I started I learned to use the mysql_ methods (news to me that they've been deprecated, but I've been out of it for a year), which in turn taught me how to properly sanitize user input. (Never trust the input!) I've come across code from developers who've only existed in frameworks and they don't have the foggiest on what to look for and how to detect various types of attacks because their framework of choice did it for them (or they assumed as such anyway). This is fine as long as they can use their framework, but what about situations where the framework can't be used?

My thoughts from 8 years of web development with PHP/MySQL/Javascript.

Link to comment
Share on other sites

  • 0

Ron Paul 2012, i'd recommended Head First series books.. try searching for Head First PHP

IMO Head First series are the best books, especially for beginners; the way they presented the contents is good and exciting (not boring like the usual deitel like book)

Link to comment
Share on other sites

  • 0

Hi,

I do not think you will get the answers you are looking for and I also think you are thinking about this "backwards" - What does the project demand? I produce very few (Python, RoR or Nodejs projects) vs PHP and the reason is "standardization" and costs. Large companies frequently are slow adopters and out of the few companies who did use Python / Nodejs - this was a specific purpose that PHP itself would not lend itself too. For smaller companies the cost of hosting PHP is too low to ignore - buzz words like "Word Press" are still king.

Link to comment
Share on other sites

  • 0

Thanks for the tips and information guys. But what about books? Any good books that you guys recommend?

Any intro book, to get the basics. Buy the book, rip out the chapter on mysql_ statements, then go read the PHP documentaiton on PDO and prepared statements, and you'll be more or less good to go on a basic site.

After that, you'll want to learn about object oriented php, and AJAX, and whatever else strikes your fancy, but you need none of that to get up and running. Correctly executing database read / writes you absolutely need from the beginning.

Learning mysql, as presented in most into books, is a complete waste of time, and it's borederline irresponsible how many books are still being published new that still do inserts using mysql_query.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.