News for hackers. Stuff that matters.
Re:What are the worst parts of PHP? by smt88 on Monday April 10, 2017 @01:58PM (#14080967)
Worked on PHP on-and-off for more than 15 years. Jobs in PHP can sometimes pay well, but the PHP labor market is fairly saturated, so you're more likely getting underpaid than well-paid.

Here are some of the reasons I don't use PHP anymore:

1. Code bases often written by near-amateurs, so almost always a headache to work on

2. Terrible type system (and unpredictable type coercion) mean that the code has to be written with great discipline or it's going to be buggy

3. Inconsistent signatures of built-in classes/methods/functions means that it's almost impossible to remember anything, so you need to consult documentation (or inline completion) constantly

4. Very generally, a community that likes magic (see: Laravel) -- ease/speed is prioritized over correctness/explicitness, which means maintaining large PHP projects is often a nightmare

Re:What are the worst parts of PHP? by ccajas on Monday April 10, 2017 @04:57PM (#14082485)
Irony, thy name is PHP. Your name means "hypertext pre-processor" and was conceptualized first and foremost to be a web dev language. But you're now often being turned down in the web dev world in favor of general-purpose languages!
Re:What are the worst parts of PHP? by smt88 on Monday April 10, 2017 @06:08PM (#14082977)
The web is used radically differently now than it was 22 years ago in 1995. Also, PHP wasn't designed to be the platform for large code bases maintained by multiple people. It wasn't really designed at all, as its creators have said publicly.
Re:What are the worst parts of PHP? by justinzollars on Monday April 10, 2017 @02:29PM (#14081232)
Thanks for the info! I may have an offer and I want to make sure I am aware of my unknowns.
Re:What are the worst parts of PHP? by axvk on Monday April 10, 2017 @03:20PM (#14081700)
Currently working as a full stack dev with PHP on the backend. Every language will have its pros and cons. If there was one language to rule them all then everyone would use it. Point is you should instead focus on how the company uses the language. Do they have standards, tests, deployment process, etc..? Every language can have projects that are a nightmare or a pleasure to work with. It really all comes down to the company.

Ask to see a code sample if possible.

Re:What are the worst parts of PHP? by justinzollars on Monday April 10, 2017 @04:00PM (#14082028)
nice points. Def know there is not a language to rule them all. I'm a ruby fan - its "good enough" but def full of faults. I just wanted know the pros and cons of PHP so I properly weigh my options.
Re:What are the worst parts of PHP? by jwho82 on Tuesday April 11, 2017 @01:11AM (#14085028)
What are you mostly working with these days? I really need to branch out from PHP...
Re:What are the worst parts of PHP? by smt88 on Tuesday April 11, 2017 @05:24PM (#14092593)
If I could choose anything, I'd go with Rust, Clojure, or F#. I'm currently working with C#/.NET and enjoy C# well enough, but mostly hate .NET.

I had a fantastic experience writing a thoroughly-typed, functional-style REST API using TypeScript -> Node recently, and I'd highly recommend that for someone who is practically-minded.

Re:What are the worst parts of PHP? by krapp on Monday April 10, 2017 @07:42PM (#14083570)
>Would you ever consider a job in PHP?

Heh. Most of the programming work I get is with PHP. I wish I could find work not in PHP. I'm still paying off a degree for building business applications in C# - and trying not to forget C# because I never use it. I can't seem to get a chance to forget PHP.

To me, the worst parts of PHP are, first, that the language was designed and intended to be used the way Wordpress (and many small hacky sites) use it - with PHP, HTML, Javascript and CSS all mixed together.

And second, that PHP isn't aware of context - it doesn't treat XML as objects (the way Hack does with XHP) and doesn't escape variables by default. One either has to manually escape every instance of every variable with a function whose name is too damn long (htmlspecialchars) or use a framework which does that for you.

The second point entirely undermines the purpose of PHP, and turns the first into an utter minefield.

Re:What are the worst parts of PHP? by dreistdreist on Wednesday April 12, 2017 @06:47AM (#14096428)
Automatic escaping would not work anyways, you need to escape for the appropriate context (HTML, JS, CSS, JSON, XML...).

You don't have to use a framework, just use one of the many composer packages available like Twig for example...

Re:What are the worst parts of PHP? by dreistdreist on Wednesday April 12, 2017 @06:49AM (#14096441)
I am working on a nice PHP 7.1 codebase where we just started with DDD. It's awesome.

Yeah there is quite a bit of legacy code still there (the application is over a decade old), but all the new OOP code is nice to work with and we are getting rid of the old one slowly over time.

Re:What are the worst parts of PHP? by dpeck on Monday April 10, 2017 @04:06PM (#14082071)
the parts after "<?php"

Seriously though, I would think long and hard and be unlikely to take a job requiring more than a trivial amount of php. For me its tough to structure well, the stdlib is inconsistent so it means constantly having to look at the documentation, etc.

Re:What are the worst parts of PHP? by jamesmp98 on Monday April 10, 2017 @02:08PM (#14081061)
Are we talking about modern PHP or pre-PHP7?
Re:What are the worst parts of PHP? by justinzollars on Monday April 10, 2017 @02:29PM (#14081234)
Lets say both, I'd like to hear your perspective.
Re:What are the worst parts of PHP? by sbank on Monday April 10, 2017 @07:18PM (#14083422)
PHP.
Re:What are the worst parts of PHP? by justinzollars on Wednesday April 12, 2017 @08:40PM (#14103077)
I didn't get the job so I should be thankful!
Re:What are the worst parts of PHP? by bbcbasic on Wednesday April 12, 2017 @06:47AM (#14096427)
rofl
Re:What are the worst parts of PHP? by vgy7ujm on Monday April 10, 2017 @03:52PM (#14081963)
In many ways OO PHP is starting to look a lot like Java. Verbose and overarchitected code. It was a good templating language for C modules, not so good when you try to shoehorn it into solving every problem that you have.