Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: PHP for Python programmers
46 points by reinhardt on Sept 11, 2010 | hide | past | favorite | 73 comments
I've been happily programming in Python for a long time (6+ years) and so far I've been fortunate to never have to write a single line of PHP. Recently I was contacted by BigNameCorp regarding a good job opportunity. Problem is, PHP is the main language (among several others) of said company and chances are that at least part of the job will be writing and reading PHP code. Although that's not necessarily a show stopper, I'm afraid I have been spoiled working with a high level language for so long and I'm not particularly thrilled to move down the language totem pole.

I've seen blog posts about moving away from PHP to Python, Ruby, and other better languages but not much about the opposite direction. Have you been in a similar situation and if so how did you manage to adapt and maintain your sanity ? Any suggestions, warnings or pointers on learning the good parts of PHP (if there are any) for advanced programmers would be most helpful.




If `BigNameCorp` writes a lot of PHP seriously, you won't notice that many problems. It's not going to be PHP anymore. It's going to be Symfony, Zend, Cake, or something else (maybe even some proprietary, internally used framework). It isn't that easy to find pure-PHP code these days - it just takes too much time to write.

If you do however see an old-style "let's just include everything", "global variables are cool", "just shove it into $_SESSION" kind of code... well - good luck, you'll need it ;)

There's also going to be some forehead slapping as you discover what is not possible (like `function_returning_array()[0]` => syntax error)

I get to write PHP once in a while but normally prefer Python. It's easy to spot in the style of the code written... but otherwise, no problems. I'd just suggest changing the error reporting level to maximum - it's not hard to write a lot of PHP code that will both work correctly and report tens of warnings per line.


"If `BigNameCorp` writes a lot of PHP seriously, you won't notice that many problems."

It also depends on how long BigNameCorp has been around. They might take coding seriously now, but legacy code in general is a pain to deal with. Much less legacy code that's been written in a language like PHP.


Array dereferencing in is the trunk and will be available in 5.4.


And will be available for use on BigNameCorp's RHEL servers in about eight years.


If then. Look how many BigNameCorps are still using ASP classic.


Can you learn PHP and be successful with it? Absolutely. Do you want to? As a Python programmer who's had to do PHP from time to time, I can say it isn't terribly fun. If I were to make a decision based solely on the programming language though, I wouldn't choose a shop whose main language was PHP. Again though, that's assuming that I was just basing it on language. I've found choice of programming language to be one of the less reliable indicators of how good a company would be to work for.


Perhaps I'm irrational, but early in my Python career I got back a source file from a friend that had invisible changes in the spacing (tabs and spaces got confused) and spent entirely too much time fixing the resulting bugs.

I figured whatever benefit I got from Python's other 'good' features, I'd lose back with that kind of BS, so I quit programming Python.


Is it really that hard to search and replace a tab with four spaces?

    %s/\t/    /g
should do it in Vim. Make it /gc if you have tabs in your code for some reason.

If it's really hacked up, then a source code beautifier might be a better bet:

http://www.google.com.au/search?q=python+source+code+beautif...

The alternative is to have wild, all over the place indenting in languages like PHP. Except that the code will still run, so nobody will fix it.


I realize the question was about language specifically, but something that wasn't really addressed in all these comments is the totality of the environment PHP will be used in.

PHP using a decent framework with properly unit-tested and documented code, a team of mid-level and sr devs, version controlled, good comments, a build process, and reasonable development schedules would be a joy to work with vs hacked-up Python thrown together by various people who don't know what they're doing with no process, docs, version control, test, where everything was due 2 weeks ago and people just develop on live servers. That would, simply put, be a nightmare, regardless of the 'purity' of Python.

I recently took on a project based on Rails. I saw some code - there were tests - some of the models I inspected looked decent. My initial view was "it's Rails - how bad could it possibly be?". It was/is horrible. However, once we'd commenced, I realized a) it's Rails1 (and was still being developed in Rails1 as of March 2010), there's 0 version control, no external docs, few internal comments, and 95% of the tests are either auto-generated skeletons only, or at the level of "Add 1 to the inventory, save, then check the inventory has increased by 1" (not checking any logic, just db code).

Parts of the code are - yes - more expressive that they'd have been in PHP. But, overall, the project is an abysmal mess. It's painfully apparent the original dev(s) didn't understand how to build software. They could 'sling Rails stuff together', but that's about where it stopped.

We've made a not too painful decision to rebuild, just using the old code for reference as to how screens should look. Rebuilding is being done in Grails (fwiw), and we're using a bdd approach (easyb) to get started. I was on the fence about using Rails/cucumber, but my skills aren't very strong in that, and we've got a deadline to meet.

I understand PHP isn't perfect. Coming from other platforms, there can be many 'gotchas' which catch people off guard. I've found moving from PHP to other platforms you find similar gotchas. It doesn't make every 'gotcha' automatic proof that PHP is crappy (a few do, but not all!) But again, the language, while important, should not totally define your view of the job or the entire ecosystem.


In the same boat right now with a Django project and couldn't agree with you more. Django is a decent framework but no framework or language will prevent a crappy mess if you're determined enough.


Don't worry about it. I was in a similar position a few months ago when I, a python programmer, was offered a perl position. Eventually you just get used to it, and you might even find things you like. I've stopped being as much of a language snob. Some features and most syntax are just decorative, and you'll adjust. The whole giant namespace thing would bother me a lot, but hey its worked for other people before.


Language snobs, as a rule, are people that have not programmed in more than one language, or that somehow think that their chosen superior tool makes them superior as well.

Nice to see that learning a 'crappy' language like PHP got you on to a more even keel in that respect.


On the contrary. Language snobs have programmed in multiple languages. That's why they can clearly recognize a flaw when they see it. If you've always used a tool with the same flaw you likely don't recognize it as a flaw and just think that that's the way it works. Or you do kinda recognize it as a flaw but don't realize how much it slows you down.


I think there's more than one kind of language snob out there. Some of them have never programmed in more than one language, and so naturally think that language is the best. Some don't regularly program in any language, and take whatever fad du jour is on Reddit as gospel. But others have programmed in lots of languages, and have tried the languages in question, and that's why they think it sucks.

It can be difficult to tell them apart. But one way is to look at the depth of their criticisms, and how many of those criticisms you've heard before. If they say the same things everyone else says, chances are they're talking out of their ass. But if they can come up with unique, detailed, insightful reasons why a particular language sucks, it's pretty likely that they've used it extensively and have some idea what they're talking about.


Well put. I've seen many people who will be quick to jump and say Java|C++|PHP|Ruby|Python|C# is the BEST AT EVERYTHING EVER because the Internet tutorial they took told them so. These people are so common that having opinions on a language is something that you actually need to be careful what remarks casually about, lest you be branded an uninformed idiotic language bigot. Most languages in wide use are there for a reason, but that doesn't mean any and all opinions on them are invalid.


I'm not sure if it's an oversight or intentional but you didn't mention Lisp, which is, for many "snobs", the language of choice.


He should have mentioned Lisp, along with some other languages. However, I don't know how intentional that was, but he only mentioned languages used by the first kind of snobs -- those who are not familiar with great number of tools. Of course, I'm oversimplifying, but I'm sure that average Lisp, Smalltalk or Haskell programmer have used more languages than average C++, Java or PHP.


I've used quite a few languages and even though I see the flaws I just shrug and get on with the job at hand, re-writing something because a code base is not written in 'your' language is the mark of a pretty inflexible programmer.

A language snob is someone who derives a feeling of superiority from the language they use, in reality the tools matter a lot less than language snobs will have you believe.

I've worked with lots of people over the years, and some of them were all-out snobs about 'their' chosen language.

These people were extremely irritating to work with because they refused to look past the minimal advantage that you derive from working in language a,b or c.

The stuff most of us create could be implemented in just about any language without anything close to the kind of 'slowing down' that you allude to, it all boils down to how well you know your language and the environment you operate in, as well as knowledge about the domain you are building your work for.

In my experience the choice of language has a relatively small impact on the speed of the initial build and the quality of that build.

Over a longer term for less than rocket science style projects it is far more important to have good documentation and a supply of reasonably competent coders than that it is important to do your project in any one specific language.

Of course, there are languages such as brainfuck and a bunch of others that you'd do well to avoid for many reasons but I take it we're limiting the discussion to the top 10 languages used to build everyday applications and web-apps, say Java, C++, Python, Perl, PHP, Ruby, C# and whichever won't spring to mind at the moment.


Technically perl, not PHP, but now all I see is arbitary syntax. It's nice.


Ah right, I was stuck in 'topic' mode :) Sorry!


This is pretty much the best advice. I began programming in PHP, and 95% of my web dev still uses it. (Though my latest project is using Python's Flask microframework.) I don't consider using it for anything else, even though PHP-GTK isn't too bad. My favorite language is Python, I've drunk heavily from the Scheme and Lisp koolaid, learning about programming games in C/C++ along with embedded systems that also use assembly here and there.

And yet, for my own anecdote, at the start of the summer I got a job where the main part of my work is creating a Flex front-end application with Java services running on Tomcat/Jetty for the backend, using SOAP (though we do have REST hooks too generated automatically) as a data transfer protocol. It's kind of ugly at first, since hey, it's Java, but really it's not bad and my "I wish this was PHP/Python" moments grow more and more infrequent.


Just because you don't want to work with a language (especially PHP, dunno about Perl) doesn't make you a language snob. If you're closed off to any languages other than your preferred language, you're a language snob.

That said, there's nothing wrong with programmers being picky about languages. Not only are languages what we're forced to think in day in and day out, but they affect what tools we can use, how we structure our code, and (like it or not) what jobs we can easily get.


That is good advice, but what will PHP teach someone exactly? I don't believe it has anything interesting to offer someone who has learnt a number of languages.

All it has going for it is that it has low barrier to entry and is a commodity in terms of it's developer and low-end hosting. I consider these as good selling points for PHP but that is all I think it has going for it.

I think the social ecosystem of a language is very important, and I think there's more information and quality libraries in Ruby at the moment, so the popularity vote for PHP is a bit moot nowadays for web application development.

I try not to be a snob, I try to use 'the best tool for the job' but I don't think PHP is a very good tool. And I'm sorry but as someone who uses these tools all day I do not consider it a good tool.


I agree with this strongly. I was a PHP programmer for quite some time, a good one at that. I started itching to move away from PHP beacause I knew of its weaknesses and the expressive beauty of python. Long story short, I am now a web application programmer that solely uses python.

The argument that language choice doesn't matter, it's the engineer that matters, is very valid. I'm an excellent engineer in both and produce high quality working code in both. But python is clearer, more fun, and right.


"I try not to be a snob, I try to use 'the best tool for the job' but I don't think PHP is a very good tool."

That was my point actually. :-)

Just because you don't want to use PHP doesn't make you a snob.


Snobbery is defined as looking down on anything you consider inferior - for example in social classes, you can have middle class snobs without them thinking that every other class (including the upper class) are worse than them.

So no, I'd disagree with your definition of 'snob'.


Dictionary.com seems to see my point of view as being valid:

"a person who believes himself or herself an expert or connoisseur in a given field and is condescending toward or disdainful of those who hold other opinions or have different tastes regarding this field: a musical snob."

Regardless, if avoiding languages I consider inferior make me a snob then I'm happy to proclaim myself a snob.


Amen.... I've started to use more than one language, and it's made me a better programmer and far more understanding of how different languages approach problems.

PHP does have problems, but it's easy to pick up. I don't know that learning it will make you a better programmer, but a good programmer can definitely make it solve problems efficiently enough.


Any new language you learn will make you a better programmer.

Try picking one that is as far as possible from the ones you know and then try building something useful in it. That's the fastest way to broaden your horizons.


If you're like me, you'll never be happy using PHP. It's like being a piano player and having someone ask you to play their favorite song, but only if you cut off 9 of your fingers.

The result is a bloody mess. Find a different job.


I've had to use PHP even though I really love Rails because WordPress is built in PHP and a lot of my client work is with WP.

It's definitely not elegant when compared to Ruby or Python but it's not as bad as Java. Because you know Python, it won't be hard to pick up but you'll need to accept that you're working with a different environment and live with the tradeoffs.

The neat thing about PHP code is that it runs pretty much anywhere. This is not a big deal when you're building one app that is going to be used by a lot of users but it is a big deal when you have projects you're building that are open source and you want to foster a growing community.

As others have mentioned, a lot of your sanity levels will depend on what their current code looks like. If it's at a company like Facebook, I'm assuming their code would be at least decent or even nice. On the other hand, it could be a complete nightmare to work with bad code. A different way to look at bad code could be as an opportunity to do a lot of work and make yourself very valuable to the team. It just depends on whether you want to take on that type of role.

Now if money and distribution of your code isn't a biggie for you, I wouldn't take the job as you don't want to realize you've wasted a year on something you hate.


PHP is an okay language. I'd never choose it by myself, but most of the time it is bearable. The language is not the problem though - it's the people.

PHP breeds mediocrity in such a superb way, it's rivaled only by Visual Basic. It attracts many dumb people and, chances are, you will meet many of them on your new job.I won't go as far as telling you to stay clear of the job - just have that in mind when deciding.


Completely agree!

Both PHP and VB share low barriers of entry. That make them novice friendly, but in the end it encourages practices that everybody else have agreed to call bad habits.

By example, copy & paste. In most languages if you pick a random forum and ask "how do I do X?", you will receive answers that range from "RTFM" to some cryptic link to a Fine Manual to Read. You will be forced by the elders to conceptualize what you want to do, and then learn how does it work. On the other hand, that same request in the PHP and VB forums will get half a dozen of "here is it, dude" responses... including the one form the reading challenged idiot who answered how to do Y instead.

In the mind of the newbie, then, it becomes perfectly acceptable to equate programming to a look up table where there is some arcane incantation that corresponds to every problem.

Not to say that there is no professional people doing quality work in either language. But dealing with the noise in the community is the price you have to pay.


Atleast at Facebook, the PHP code quality and abstractions are very very good, and getting better. Developing the compiler in-house has some advantages.


You are going to have to learn what the shifted '4' and the unshifted ':' keys on your keyboard do. You might start practicing to build up those muscles.

(I just learned Python to give App Engine a spin. All my usual languages use semicolons, I finally stuck a little clay on the key to alert my brain when I pressed the semicolon.)


Switching languages, for me, has usually been a matter of remembering syntax, some minor differences (such as how arrays work, what things are built-in, etc), and the patterns in each language that naturally arise from those two. Of course, things get more complicated if the language itself is structured differently (eg: Javascript), but there are a lot of underlying concepts that carry over (scope, stack, OOP, etc). In short, it just takes practice. If you're "advanced", you should be able to pick up on it pretty quickly.

To get a feel for syntax and how PHP works (especially == and reference/value), you should read the docs. They're a breeze and provide lots and lots of examples. The user comments are generally incredibly helpful and will notify you of caveats that you might need to be aware of.

You'll also want to start off by learning how to build objects in PHP, how associative arrays work (they are great), and how to use __autoload() to include classes on the fly.


Magic quotes is also worth a mention. It's bound to throw anyone coming from another language for a loop.


Magic quotes has been disabled by default for several years. All you need to know about them are: disable them if enabled.


And if you can't guarantee they're disabled (e.g, if you're writing code to be used by other people), undo them at runtime as early as possible.


I'm also a huge fan of Python, and I do believe that it (or other higher level languages like Ruby and Lisp) spoils you. I once took a well-paying job, but the main language used was ColdFusion - and not just ColdFusion, but a huge, complex, disgusting ColdFusion framework that the company had written themselves and was riddled with bugs. I figured I'd be fine because of the paycheck and the prestige of the job. Switching to a new language wasn't hard or anything, but I ended up only lasting a few months, then quit, taking a significant pay cut to get away from ColdFusion. I found that I just couldn't stand the stupid language.

I guess my point is, when deciding whether this is the right job for you, language is a very important factor. After a little time writing in a language you don't enjoy or respect, if you're like me, you're going to start to feel creatively and intellectually unfulfilled.


The team that makes PHP makes quality a higher priority than just about any other language; if something is built into PHP, it's pretty likely to work correctly. (For example, PHP and Python have the exact same problems with threads, and the PHP team says "don't use PHP in a threaded environment" and the the Python people say "come jump in the water is fine")

It's true that everything gets shoveled into one big namespace, but PHP lets you get a lot done with very little bull. There's a lot of crappy PHP out there, but there's a lot of crappy Java, Python, Ruby and C# too. If you approach PHP with some discipline I think you'll find it's an environment that never kills you with a showstopper flaw.


Seriously? Don't get me wrong, I could imagine valid reasons to use PHP. But the quality of the language itself is at the very bottom of that list. I don't usually hear PHP advocates making that case. Usually it's a combination of "the language isn't that bad" and "there are a lot of libraries for PHP".


If you define quality as 'orthogonal naming of functions' and 'elegant constructs' then yes, PHP has its flaws.

But it's been absolutely bullet proof in production for me and when I did find a bug I've had a patch within 24 hours straight from the core devs.

They do take quality serious there, they just don't define it as language elegance.


I'm not sure I understand what your argument is. That there aren't major showstopper bugs that make PHP unusable due to various segfaults? Sure, that's true. But do you mean to suggest that such things exist in greater quantity in other such languages? You say the PHP devs have a sharper focus on quality than other languages; can you provide and kind of evidence for those claims? Not just good response time by the PHP devs, but systemic failures in other languages that go unaddressed, as well?

PHP tends to be at the bottom of the "language quality totem pole" because as a language it's pretty low quality. The PHP interpreter may be fine as a piece of software, but that's a completely separate matter from being a quality language.


I've filed bug reports for other languages and have never so much as received a confirmation, let alone a patch, the php devs responded within a few hours, that shows to me they care.

> PHP tends to be at the bottom of the "language quality totem pole" because as a language it's pretty low quality. The PHP interpreter may be fine as a piece of software, but that's a completely separate matter from being a quality language.

It is specifically for that reason that I broke it down in to two parts, and apparently we agree on the language quality from a design point of view, but from a 'have to use this in production' point of view we do not.

> You say the PHP devs have a sharper focus on quality than other languages;

That's a straw-man, I said no such thing, but it does happen to be my experience that the PHP devs respond very quickly compared to other platforms / languages.

> Can you provide and kind of evidence for those claims?

And no, I'm not going to provide you with any 'evidence' for my claims, you can take my word for it. This is not a court of law, and besides that I never made any claims about other languages before this comment and I don't feel like putting other languages and/or their developers down.

I know PHP as a language has its flaws and that there are some unfortunate choices made in the past that are very hard to undo but that's no reason for losing all objectivity.


> I've filed bug reports for other languages and have never so much as received a confirmation, let alone a patch, the php devs responded within a few hours, that shows to me they care.

It's great that the PHP devs do that! Is that a compelling reason to use the language? I'm not so sure.

>That's a straw-man, I said no such thing;

You said:

> The team that makes PHP makes quality a higher priority than just about any other language

Can you explain to me what I misinterpreted?

> And no, I'm not going to provide you with any 'evidence' for my claims, you can take my word for it. This is not a court of law, and besides that I never made any claims about other languages before this comment and I don't feel like putting other languages and/or their developers down.

It's a little silly to make a comparative statement like "The team that makes PHP makes quality a higher priority than just about any other language" and then refuse to provide examples of where this happens and matters. If you'd just said "The PHP devs respond quickly to bug reports", sure, but when you start saying "They do this better than other languages", you're implicitly already "put other languages and/or their developers down". In a case like that, I don't think it's out of line to ask for examples; if there are major failings in other languages that go ignored and unaddressed, then that's certainly worth some attention. If there aren't, the whole point is moot anyhow. If there are examples of systemic problems that go ignored in other languages, I'd like to know about them - that may matter when I choose a language for a project.

I'm not interested in trashing PHP here; I use it on a daily basis, and get a lot done with it. I also use Ruby, Python, Javascript (both server and clientside), bash, and the occassional perl on a daily basis, and don't have problems with mysterious segfaults and unexplained crashes from 2-year-old bugs that would somehow make PHP's lack of such problems a major marketing bulletpoint. I don't understand your position at all, because as far as I can tell, it's "The PHP interpreter is mostly bug-free, and bugs get fixed quickly" (which is great!), but...what language with showstopper bugs survives mainstream use?


> You said:

>> The team that makes PHP makes quality a higher priority than just about any other language

> Can you explain to me what I misinterpreted?

Yes, that that was terra_t, not me making that claim.


Doh. Egg all over my face. My apologies!


np. Glad we got that cleared up :)


This is why I love HN.


Fundamentally, PHP has an entirely separate address space for each web request... This is a much more "robust" (reliable as opposed to "featureful") approach to web development because there are no data structures in RAM that are shared concurrently between requests.

For example, in ASP.NET, I've had a whole team of developers swear up and down that there are no static variables in a particular segment of code that could be the subject of a race condition. Sure enough, I go in there and find one that's hidden away in a very obscure location.

Java has the same problem, as does any environment that exposes threads to the language. Sure, in theory you could do some very nice things by sharing data structures between requests, but practically the whole programming style of PHP encourages people to avoid horrible horrible problems with concurrency, and there are no language features, even in the laboratory that practically make those problems go away.

To take another example, the urldecode function in CPAN has been wrong for 15 years. If you want to write a urldecode that works right, you've got to write your own (possibly using the built-in for a base). Similarly, the URI object in .NET sometimes does incorrect transformations on URIs, and you need to use string URIs if you want to make interoperable semweb systems... PHP has the lowest fraction of 'things that say they work but really don't work' of any web programming languages, and that's the reason why it is so successful. Other languages are "blub" because they don't recognize that it's even possible for things to be this easy.


To be fair, most languages don't start out as a hacked up bunch of perl scripts like PHP did. They have the benefit of a design process, versus PHP's history of I need it to do X .. hack hack hack .. there it now does X. Remember, PHP started out as one dude's quest to have a dynamic webpage. It's not like Ruby or Python where someone sat down and tried to think things all the way through.

So yeah, I don't think any sane PHP advocate is going to get in your face about PHP as a superior language. Because it's obviously not true and it really doesn't matter all that much.


"Quality" of a language, in your definition, doesn't seem to take into account community, support, ease of use, or pervasiveness. PHP is certainly not at the bottom of the list if you include those attributes, and if your goal is to learn a new language those things become very important.


This particular conversation follows the PHP conversation template uncannily well:

http://www.reddit.com/r/web_design/comments/bxfok/9_useful_p...


> and the the Python people say "come jump in the water is fine")

Doesn't this come simply from other execution environment? PHP is used for websites and you're very unlikely to need/want threading there. I've never heard django/rails/whatever people complaining about threading (apart from the actual HTTP server people).

On the other hand, Python got popular in research / number crunching (numpy, scipy, etc.) / networking (twisted, tornado, diesel, etc.) -- and the multithreading requests seem to come mostly from that camp.


It's pretty simple. Just switch off your brain and pretend you're writing really poor JavaScript.


The Kohana PHP framework source (http://github.com/kohana/core) is a great example of well-written PHP code. You can definitely get a sense of the "good parts" of PHP from reading through the code.


Really? Perhaps I just looked at the wrong time, but I was looking at Kohana last year and ran far away. The issue wasn't the core, but everything else around it - the plugins, the dev attitudes picked up from mailing lists, the release process and more.

IIRC, I wanted to use Kohana because of some specific plugins recommended to me. However, they were marked as only working in 2.4. 2.3 was in beta, but the consensus I got from IRC people was 'just move to 3 - it'll be released soon and that's where attention is being focused'.

The core code might be well-written, but that doesn't mean it'd be a good project to build on. It might be, but code alone is not the only factor to consider.


Think of PHP as a really amazing shell scripting language. Just as shell scripts can be glue for all the powerful UNIX utilities, PHP gives you APIs for just about any useful library you might need for web work. You won't be able to use your fancy Python chops for things like generators or itertools, but with luck instead you'll be running a bunch of powerful well-designed existing C code with a few function calls. Of course, a significant project will require a bunch of data & logic in PHP...

Also, the PHP source code is quite readable, for those times when the good online reference manual doesn't help.


Programming languages are tools of the trade and no different than tools in any other field. If it's a good job then it is a good job. If the job requires you to work with PHP, then that is a lesser consideration that is barely worth mentioning. Good coding can be done in any language even crusty COBOL or LISP. After you learn the PHP syntax, then you won't think about it anymore. In a few weeks time, you'll be surprised that you were worried about something so trivial as the programming language used.


Your post suggests that the only people who care about what language they use are the ones who did not use any languages other than the one they like the most.

That's simply untrue.


Bookmark http://www.php.net/manual/en/.

I suspect that the quality of the code base will affect your happiness much more than the language itself will. I doubt that BigNameCorp belongs to the world where all database fields are VARCHAR(255) and elaborate code is required to ensure that '99' < '100', or where globals float about mysteriously. If so, heaven help you--but they'd probably write Python in the same fashion.


When I started programming I was using Visual Basic and Pascal. I miss those days because I was focused only on building things and was not aware about "Which is the best language" blog posts.

My suggestion is to not pay too much attention to those blogs and focus more on building things.

I'm sure PHP is a good language to build very good websites.


I started as a PHP programmer and transitioned to Python. I'm currently doing PHP at work, and it's not too bad, despite some of the warts that come with an application designed over 5 years by a single person.

Sure, I'd rather be hacking Python, but I'm not going to go kill myself or anything.


not that I've written any python, but is PHP that much low level?


PHP isn't super low level, but it is for a server side language. Much of its standard library is just a pretty thin wrapper over the C, and since it's often used without a framework, the code 'feels' lower level.


It's basically the equivalent of Python, Perl, Ruby, etc. It completely fits into that same niche as an interpreted dynamic language with OO capabilities. It's nowhere near as elegant as Ruby or Python, but similar concepts can be expressed with +-35% lines of code. So no, it's not actually low level at all. You don't have to do memory management. You don't have to declare variables. Arrays are not fixed sizes. It is compiled to intermediate bytecode... etc.


It feels a little bit lower-level than Python, in terms of the runtime, rather than the language. It also struck me as being lower quality in terms of their runtime, and their docs, than Python and several other languages I've used in recent years. Closest to amateur hour of all the languages in widespread use on the web, in my judgment.


You'll be be fine. I've found it very easy to switch from/between C/C++/PHP/Python. Perl on the other hand...


It's easy to write code that works if you're switching between C, C++, PHP, and Python. However, being able to write idiomatic code is a different matter entirely.


C++? Strange. It took me time to learn seriously. I used to reread "Effective .* " every few months.

Python/Perl/Ruby/PHP fill such a similar niche that I try not to go between them, because it would be boring.

My personal plan is to next go Erlang, Perl 6 or some Lisp variant.

Edit: Job offers for 2011 or so would be appreciated. :-)


Depends what order he learned them in. Maybe he already knew syntax from C and classes from Python before learning C++.


I'm a Pythonista who had to deal with a client's legacy PHP codebase earlier this year. One tactic I used was to try to write all new stuff, where I could, in Python. Tasks that could be separate processes from their existing PHP stuff. For example, command-line tools, automation, supplementary web apps, etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: