Jump to content



Photo

php or python for web development?


  • Please log in to reply
37 replies to this topic

#31 The_Decryptor

The_Decryptor

    STEAL THE DECLARATION OF INDEPENDENCE

  • Tech Issues Solved: 4
  • Joined: 28-September 02
  • Location: Sol System
  • OS: iSymbian 9.2 SP24.8 Mars Bar

Posted 28 November 2012 - 07:24

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.


#32 vetFourjays

Fourjays

    Neowinian Senior

  • Joined: 09-September 05
  • Location: Staffordshire, UK

Posted 28 November 2012 - 11:49

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.

#33 vetthe evn show

the evn show

    Removed

  • Joined: 10-June 02

Posted 28 November 2012 - 16:11

Removed

#34 OP Tech Star

Tech Star

    Neowinian Senior

  • Joined: 24-November 04
  • Location: California, USA

Posted 03 December 2012 - 08:10

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

#35 imin

imin

    Resident One Post Wonder

  • Joined: 20-April 13

Posted 20 April 2013 - 18:02

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)

#36 Andre S.

Andre S.

    Asik

  • Tech Issues Solved: 10
  • Joined: 26-October 05

Posted 20 April 2013 - 21:47

[...]

Welcome to Neowin! While your comment was very relevant, in the future, please don't dig up 5 months old threads. :)

#37 tim_s

tim_s

    Default

  • Joined: 07-January 13
  • OS: OSX (Macbook Pro i7), Windows 7 (Gaming), Gentoo
  • Phone: Samsung Galaxy SIII, iPhone 4s

Posted 29 April 2013 - 19:44

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.

#38 threetonesun

threetonesun

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 26-February 02

Posted 29 April 2013 - 19:58

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.



Click here to login or here to register to remove this ad, it's free!