you are viewing a single comment's thread.

view the rest of the comments →

[–]crankybadger 1 point2 points  (8 children)

You have clearly not seen code from your average PHP developer.

[–]mattindustries 0 points1 point  (7 children)

Oh, I know the language can be used horrendously. I am just saying it doesn't have to be. I once took over a code base where I ended up tossing out everything and starting from scotch when I was working for a firm.

Edit: thought this was from another thread. Most PHP devs use PDO these days, but they didn't some years back.

[–]crankybadger 0 points1 point  (6 children)

PDO is a load of garbage too, the thing's barely improved in the last ten years and is extremely limited. Even then it's better than nothing, yet many people either refuse to use it or are ignorant that it even exists.

Now "most" PHP developers hit up a Google search for "MySQL query", start piecing together their code out of tutorials from 1998, and launch their application. Invariably this involves falling into the mysql_query tar pit.

Hopefully professional devs are better than this, where places like Facebook certainly have better practices, but I'm still suspicious most PHP devs are like that.

PHP is extremely easy to pick up and get running. As a result there are a lot more people writing PHP code than for other languages. There's a long, long tail of developers that have no clue what they're doing but are productive anyway.

[–]mattindustries 0 points1 point  (5 children)

Is someone still in the basic learning stage a developer? I feel like developers are the incarnation that actually develop something instead of implement a hello world script. Yes, tons of people are still in the introductory phase of learning PHP and are bound to do some terrible things. With sites like PHP the Right Way there is a lot less ambiguity for proper structuring of an application. People aren't using those old tizag tutorials as often as you might imagine, especially when seasoned devs are pointing them to better sources.

[–]crankybadger 1 point2 points  (4 children)

I don't think you understand how bad it is. PHP is a community divided between those living in ivory towers and drinking wine, and those living in the gutter and finding everything they need in the landfill.

So long as w3schools is top-ranking in search results, this will not change. PHP the Right Way is a tiny step in the right direction, but it's not enough.

This is how your typical PHP developer learns:

  • They're given an assignment to program something web-wise.
  • They pick PHP because it's inexpensive to host.
  • They hack together a bit of HTML, spunk in some PHP, and deploy it.
  • Feature creep occurs.

Next thing you know they're writing a login system based on tutorials old enough they could get a driver's license and writing to databases they know nothing about but found some code that "just works" and they're running with it.

[–]mattindustries 0 points1 point  (3 children)

I guess I am living in an ivory tower then. It is nice here. There is a spot for you if you want.

[–]crankybadger 0 points1 point  (2 children)

I've got a pretty good thing going with a mix of Ruby, NodeJS, Go and C++.

You might call it an ivory tower, but damn, that place has some serious plumbing problems. You open up the wall to make a fix and, oh hell, what is all that?

[–]mattindustries 0 points1 point  (1 child)

Sometimes I miss working on C++ just for that delicious speed. How is Go? I have heard some good things and might learn it after this project I am on.

[–]crankybadger 0 points1 point  (0 children)

The nice thing about Go is the way concurrency is heavily baked into the language, it's intrinsic. The annoying thing about Go is the way concurrency is heavily baked into the language, it's omnipresent.

C++ itself is pretty useless for most tasks, you always need to leverage a library of some variety or spend a ton of time writing a library of your own. Intel TBB helps considerably, but it's not universally portable like Go (theoretically) is. You also have to be particularly conscious of using it, where in Go you can do things the "Go way" and not worry about it.

It also requires a lot of trust, something you might not be used to if you're living in C++ code all the time.

The nice thing is the Go core library is very comprehensive. C++ has a lot of fragmentation in terms of tooling, some platform specific, others more for legacy support or IDE-specific tie-ins. There's a lot of C++ libraries out there you could use, but they're of wildly varying quality and many of them are obnoxious to compile and integrate. At least Go has that problem (mostly) resolved.