Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

181–190 of 402 posts

Re: I still love PHP and JavaScript

#181
post #149
post #87

Earlier quoted context omitted.

But genuine question -- what other languages are as simultaneously as useful AND predictable?

Python covers many of the same use cases and is much more consistent/predictable. TCL if you want to go back a bit further.

With Python one never knows when a particular feature code depends on will be removed. With PHP code written 15 years ago still works.

Re: I still love PHP and JavaScript

#183
post #169

Earlier quoted context omitted.

This is just so far from the truth. I can just as easily push tons of logic down into templates in erb/jsp/jinja etc... at some point it boils down to the programmer's level of expertise, but also to the programmers' opinions as there are still a lot of varying opinions on what exactly are best practices.

> I can just as easily push tons of logic down into templates in erb/jsp/jinja etc... Not just as easy if they don't allow you to insert arbitrary code at arbitrary points as PHP does. Personally my preferred approach is Wicket where you can't have any logic in your markup at all, all of your logic lives in code and the only thing you can put in the template is IDs for where the code can insert child components or pl…

You seem to think that you refuted my argument, but instead you reinforced it.

By using Wicket you are making a choice to opt in to a template system that encourages best practices. This is the same reason people in the PHP ecosystem opt in to Twig/Blade/Mustache, or how people on Ruby opt out of ERB for Slim or Haml.

Re: I still love PHP and JavaScript

#184

Earlier quoted context omitted.

I would say security by default is a good reason to not have this. I've been burned too many times on PHP projects because someone miss-configured an httpd conf file.

From all the potential web security issues someone can have that one is probably the easiest and most likely you will get right.

The whole reason for the principle, "Secure by default" is because someone is going to fuck up.

Re: I still love PHP and JavaScript

#185
post #181
post #149

Earlier quoted context omitted.

Python covers many of the same use cases and is much more consistent/predictable. TCL if you want to go back a bit further.

With Python one never knows when a particular feature code depends on will be removed. With PHP code written 15 years ago still works.

What features have been removed from Python?

Re: I still love PHP and JavaScript

#187
post #81

Earlier quoted context omitted.

Not sure about "no surprises" - just saw this on Twitter yesterday: https://twitter.com/LupinityLabs/status/1554217944179249153

This is hardly specific to PHP. You should never compare IEEE floats using equality.

Isn't it the fault of the interpreter that it shows a rounded value without being promoted to?

Re: I still love PHP and JavaScript

#189
post #169

Earlier quoted context omitted.

> I can just as easily push tons of logic down into templates in erb/jsp/jinja etc... Not just as easy if they don't allow you to insert arbitrary code at arbitrary points as PHP does. Personally my preferred approach is Wicket where you can't have any logic in your markup at all, all of your logic lives in code and the only thing you can put in the template is IDs for where the code can insert child components or pl…

You seem to think that you refuted my argument, but instead you reinforced it. By using Wicket you are making a choice to opt in to a template system that encourages best practices. This is the same reason people in the PHP ecosystem opt in to Twig/Blade/Mustache, or how people on Ruby opt out of ERB for Slim or Haml.

How many of them, and how well does the ecosystem support them in doing so? It's theoretically possible to write good code in any language, sure, but in practice the language (not just the formal syntax, but the tooling, ecosystem and community, the whole culture of the language) has a lot of influence on whether people write good or bad code in it.
Post reply on HN