Live data from Hacker News

PHP Sucks

evertpot.com

251–260 of 297 posts

Re: PHP Sucks

#251

Earlier quoted context omitted.

Give us a break, as a language PHP is a terrible language, and yes I do develop and get paid because of PHP, and I do so for the same exact reason you listed. It pays the bills and does so handsomely too. I have 20 yrs of programming experience in various languages than I care to count, as much as 20! So I do know my languages. From an academic perspective, PHP blows! But from a practical standpoint, it's a tool. It…

Is it any worse than Javascript, if we're honest?

PHP is like Javascript in that both languages are now being used to do what they were not designed for.

Re: PHP Sucks

#252

I worked at a PHP-based company and after a year of intense interviewing, we finally decided to switch core languages and tech stacks because we weren't attracting strong enough candidates. What we found is that most good programmers didn't want to work in php and most php developers were designers that learned how to code php. But they didn't understand CS fundamentals or even a decent idea how to code. They could c…

I found that if you advertise for php programmers you get mostly people working on fairly simple web applications. The more talented programmers would apply when we emphasized that we use php for the front of the backend systems, but we also use Go and node.js for more realtime parts of what is a suite of micro services. once we got them in the door they were happy and productive php programmers

Re: PHP Sucks

#253

I worked at a PHP-based company and after a year of intense interviewing, we finally decided to switch core languages and tech stacks because we weren't attracting strong enough candidates. What we found is that most good programmers didn't want to work in php and most php developers were designers that learned how to code php. But they didn't understand CS fundamentals or even a decent idea how to code. They could c…

I found that if you advertise for php programmers you get mostly people working on fairly simple web applications. The more talented programmers would apply when we emphasized that we use php for the front of the backend systems, but we also use Go and node.js for more realtime parts of what is a suite of micro services. once we got them in the door they were happy and productive php programmers

Re: PHP Sucks

#254
post #213

Earlier quoted context omitted.

Is it any worse than Javascript, if we're honest?

Yes it is, and I really don't like JS much to begin with. There's seriously wonky things in there like the associativity on ?: being wrong, and == being even more broken than in js. There's order of arguments on array_map and array_filter being inconsistent. It's not that there's a massive flaw in there that kills it, it's death by a thousand paper cuts.

PHP's massive flaw is that it does one thing very well (web-dev), but does everything else rather poorly. It becomes the default choice for projects that start out as a web front-end, but then gets used in other situations where it's ill-suited. A lot of PHP projects have components that are hacked together and work, but are confusing and less-than-ideal from a design perspective.

Threading/asynchronicity comes to mind. I've worked on a few projects that started out as a web-front end, but then needed to do some background processing. Eventually the background process needs to be multi-threaded and the choices are: rewrite your code to support pthread's wrappers classes, use fork and shared memory segments, asynchronous web requests. All those solutions work, but they are much more complicated than the same task would be in most other languages with native threading support.

Re: PHP Sucks

#255
post #249

Earlier quoted context omitted.

What's beautiful and what pays our bills are unrelated. If I have to do a beauty contest of the programming languages I used a lot, from uglier to most beautiful, I'd sort them like this: PHP, Perl and C (no ++), Java, JavaScript, Ruby. I didn't use Python a lot and I'm undecided if it should be placed before or after JS. That silly method(self) looks as useless as PHP's silly $this->attribyte. They're just bad desig…

Python's method(self) is very useful. It gives the ability to call methods in the same way you use functions, which is what they really are. It allows you do things like map(str.strip, list_of_strings).

But why can't the interpreter/compiler implicitly add that argument to each instance method definition? There is no need for the programmer to type it. I understand that self plays also a role in the declaration of class methods but other languages found ways to do without method(self) and still have class methods. Java's static (coming from K&R) or Ruby's def self.method

Anyway, that is the way of Python. A lot of people is happy with that and will never be changed. It's beauty contest matter :-)

Re: PHP Sucks

#256

Earlier quoted context omitted.

Running C# (.NET Core) on DigitalOcean $5/month droplet too much for people?

How well does that price scale

I don't fully understand what you mean but if you're saying it will under-perform with this hardware I assure you that it will scale better then Node.js :)

Re: PHP Sucks

#257
The vacuum of negativity is vast and relative. Who cares if Java developers think they're better than PHP developers? From the perspective of a C developer neither can properly allocate and manage memory effectively if their life depended on it (heap-based programming, lolzors).

In my experience the modern PHP developer is characterized by a crippling self-consciousness. When I meet someone who is a fellow developer and tell them that I do C and Python and stuff... they usually begin with a bit of self-deprecating humor: I do PHP and stuff, not real programming like you, blah blah blah. I feel obligated to correct them.

The best thing you can do for yourself as a programmer is to not pigeon-hole yourself to a single language regardless of how tempting it might be from an economic/marketing perspective. Learn maths and get good at identifying problems and simplifying them. Become an expert in at least one general-purpose language and one specialized one for sure... but remember to think like an engineer: these are just the brick and mortar of the job! You still need a good mind for design, creating blueprints, and the experience to make informed trade-offs.

PHP is good for many things. Deal with it.

Re: PHP Sucks

#258

Earlier quoted context omitted.

The problem is that clients really want WP a lot. Bigger and bigger companies currently and for most of their departmental sites. This is WP shoe-horned in a full site CMS function. The thing is, users seem to love it. I would wager that if you just rip out the guts of PHP and leave only the frontend (the /wp-admin part that is), but leave it 100% as it is and write a solid backend in Django/Rails, you have a winner.…

> I would wager that if you just rip out the guts of PHP and leave only the frontend (the /wp-admin part that is), but leave it 100% as it is and write a solid backend in Django/Rails, you have a winner. I would love for WP to exist as only an admin interface to a clean, backend data store. Unfortunately, the problem is the database schema that WP ships with and the way WP handles data. It's almost impossible to get…

As the person who wrote a patch to import data from WP to Pelican I agree. It's a complete nightmare. In order to properly maintain the formatting from ~6 years of blog posts I had to literally translate the PHP code that parsed the database representation into Python... which is some really gnarly code.

Re: PHP Sucks

#259
post #108

Earlier quoted context omitted.

Right, and who's paying me to work with one of those alternatives? No one. My reference for what you quoted was a Rails project written by a Python dev who thought he needed to make Ruby more like Python. The resulting code was so horrendous that I literally cannot tell which of 2-3 parts that compose one feature (all heavily monkey-patched together) is responsible for what. It's like 2-3 complete implementations, bu…

> Right, and who's paying me to work with one of those alternatives? No one. Give me a break, it's not like there are only PHP jobs out there. If you can't find anything else then it's because you're not capable of coding something that is outside PHP domain, IE basic CRUD apps ..

A lot of software developers are are also business people. They focus and make decisions based on the needs of the organization, given the local job market, current staffing, past investments, the future roadmap of whatever product they are working on, etc. If PHP is the best route, then that's not something a business person is going to spend a lot of time worrying about.

In many ways, if a "coder" comes in and starts wanting to change a bunch of things purely because they are opinionated about languages, then that person is not going to go very far.

Re: PHP Sucks

#260

Earlier quoted context omitted.

The problem is that clients really want WP a lot. Bigger and bigger companies currently and for most of their departmental sites. This is WP shoe-horned in a full site CMS function. The thing is, users seem to love it. I would wager that if you just rip out the guts of PHP and leave only the frontend (the /wp-admin part that is), but leave it 100% as it is and write a solid backend in Django/Rails, you have a winner.…

> I would wager that if you just rip out the guts of PHP and leave only the frontend (the /wp-admin part that is), but leave it 100% as it is and write a solid backend in Django/Rails, you have a winner. I would love for WP to exist as only an admin interface to a clean, backend data store. Unfortunately, the problem is the database schema that WP ships with and the way WP handles data. It's almost impossible to get…

Have you looked at/heard about the WP REST API[1]? Basically, it allows WP to function as that backend admin tool that you talked about, and you can build the front end as what ever you want[2].

[1] http://v2.wp-api.org/

[2] An example of a front end powered by the WP REST API https://github.com/ustwo/ustwo.com-frontend

Post reply on HN