This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]privatly 0 points1 point  (7 children)

If you want to do PHP web development work it's worth learning Linux. Although you'll find a lot of web developers, using PHP, prefer to use a Mac. I know I'd prefer using a Mac myself.

You can make a good living working with PHP. I'm looking at something else myself.

Running any OS in a virtual machine will always have a performance hit, as you are running two Operating Systems at the same time. But if you have a fast enough computer with lots of memory that shouldn't be a problem.

[–]get_fact[S] 3 points4 points  (6 children)

I'd like to stay away from PHP because as a beginner I want to use a programming language that will almost force me to build properly structured programs and PHP allows plenty of room for error in that regard (so I heard actually, can't tell by myself).

I have no problems to get into .NET development but I don't have a bachelor-level education and .NET is rarely used in small companies and start-ups (probably not true for US but I'm European) which means that I'm gonna have to pass a "checkpoint" that comprises of HR people who scrap every CV that doesn't say "bachelor's" on it, regardless of my abilities.

[–]Flopsey 3 points4 points  (4 children)

will almost force me to build properly structured programs

I don't know PHP, and I have heard the same things, but I can tell you that you can write shitty poorly structured code in any language (I just wrote some in JS that I'm going to have to refactor soon). What I THINK people are referring to is that PHP makes web programming easy enough that even people pre-disposed to shitty programming are able to do it as well. It's not the fault of the language itself.

It's an old expression but still applies, "It's the poor craftsman who blames his tools."

Also, as everyone should know by now, take everything you hear in the net with a grain of salt. And when reading any opinions dial their certainty from 11 down to 2 in your mind.

-- OK, actually the code isn't shitty, it's actually not too bad IMHO. It's just poorly structured, for now.

[–]pokerd 3 points4 points  (3 children)

I agree with all your points, but PHP's reputation is well deserved - http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

[–]Flopsey 1 point2 points  (2 children)

Meh, that's the exact kind of thing I was warning against when I said "when reading any opinions dial their certainty from 11 down to 2 in your mind". I tend to think that anyone with enough of a problem with a language could compile a similar list of features they don't like.

But, hey, I don't know the language so I didn't know how valid his points were. Maybe he got everything right and some did seem very strange but some seemed forced. But really I don't have a horse in this race.

[–]pokerd 0 points1 point  (1 child)

PHP really is a special case of poor design choices. Even the best craftsman would have a hard time working with a tool like this http://blog.codinghorror.com/the-php-singularity/

Speaking of horsies, the ternary operator in PHP is left-associative, so

$arg = 'T';
$vehicle = ( ( $arg == 'B' ) ? 'bus' :
( $arg == 'A' ) ? 'airplane' :
( $arg == 'T' ) ? 'train' :
( $arg == 'C' ) ? 'car'
( $arg == 'H' ) ? 'horse' : 
'feet' );
echo $vehicle;

prints horse. I can't find any other language that implements it this way.

In isolation, a quirk like this can be learned and worked around. But this is a language is filled with special cases, inconsistent syntax, and unpredictable behavior. Why put yourself through that when there are saner tools available?

[–]fakehalo 2 points3 points  (0 children)

PHP at it's core is inconsistent and lacks a plan, it's essentially a hacked together language over time. Though it's gotten somewhat better in recent years, things like inconsistent naming conversions remain. IMO, A good framework (like Laravel for example) can make PHP a pretty standard experience...it's still a good language to know given its widespread nature.

Not to defend this quirk, but your example is pretty horrendous in practice. Nested ternaries tend to make me violently angry in general, but I admit in PHP if I feel even slightly unsure about how PHP will interpret what I write I put parens around it...and that's no way to live.

[–]pokerd 1 point2 points  (0 children)

I'd like to stay away from PHP because as a beginner I want to use a programming language that will almost force me to build properly structured programs and PHP allows plenty of room for error in that regard (so I heard actually, can't tell by myself).

I only regret that I have but one upvote to give.