Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
cLin
Apr 21, 2003
lat3nt.net
As a person who has learned C++ and PHP, how easy is Python to get into? Pros and cons versus PHP? Figured I'd ask in here since it doesn't really warrant its own thread.

Adbot
ADBOT LOVES YOU

cLin
Apr 21, 2003
lat3nt.net

bitprophet posted:

It's very easy to get into, and is generally better than PHP in every way save for not being ubiquitous on shared Web hosting environments like PHP is. I say this as someone who's been paid to write both PHP and Python and is currently paid to do...both :psyduck:

My background pre-Python was Java, VB and PHP and I absolutely fell in love with Python for various reasons. Largely it's just very close to my idea of an ideal language - the syntax is incredible, being both clean and very powerful/concise; the library support is great; the philosophy behind it is well thought out for the most part; the community is full of experienced, intelligent and pragmatic coders from every programming background you could imagine; I could go on.

Comparing to PHP, one of its largest strengths is that it's generally very consistent and clean, where PHP is one huge ugly namespace with inconsistent function names and/or argument specifications.

In addition, PHP's type system is such that it's extremely easy to make mistakes that are difficult to debug (e.g. the implicit cast of a string to an int during some math on line 10 is causing tax to not be applied on line 257, but without any error messages of any sort cropping up) and more explicit languages like Python avoid that almost entirely.

Wow, sounds like something I'd like to learn. What books do you python developers recommend? Something with examples since I learn best with it. How does a program work anyways? I know for PHP you can just write the code into the php file and execute it (printing hello world in index.php and going to index.php), but I never seen any websites with anything that'll indicate it runs off python code.

edit: oh yea, main reason I am interested in it cause I noticed for sites like codegolf.com where programmers from many languages compete for shortest code, python is usually way shorter than php with perl leading as the smallest amount of coding.

cLin fucked around with this message at 23:48 on Feb 2, 2008

cLin
Apr 21, 2003
lat3nt.net
Any books or online tutorials you recommend? I am sort of understanding the difference between the two and would like to learn more

cLin
Apr 21, 2003
lat3nt.net
Thanks guys, links are all bookmarked. I just realized I should start learning javascript as well seeing how the projects I have been working on lately all required some form. But I must learn Python, it looks like a clean language.

  • Locked thread