4 ms·
Ruby, Python, C#, Java, and JavaScript are all are more predictable and just as useful. Go, Elixir, Clojure, and probably others are more predictable while bein
by Hasu 4y ago
Ruby, Python, C#, Java, and JavaScript are all are more predictable and just as useful. Go, Elixir, Clojure, and probably others are more predictable while being less "useful" only in the sense that they may have less convenient deployments or less mature web libraries.
- mxschumacher 4y agoGo is more difficult to deploy than php? php.ini files and php extension installations to get to production is what I remember
- Hasu 4y agoNo, I was thinking 'less mature web libraries' for Go. It's hard to talk about groups of languages in broad strokes when there are various tradeoffs and each language has its own strengths and weaknesses, and I painted two possible weaknesses broadly across several languages that don't strictly apply to all of them.
- tisc 4y agoI've used Python, C#, Java, JavaScript and PHP, and in my experience Python is the most unpredictable of these languages. Just to name a few: - mutable default arguments - late binding closures - typings that are purely documentation instead of being enforced Labeling these things as "gotchas" doesn't make them predictable imo.
- zelphirkalt 4y agoPython less predictable than PHP? In what world? In PHP standard library functions silently take a null instead of a string, even though they are string handling functions, hiding that mistake for the user of the language, until a later point in time, when the context has been lost and one needs to do silly debugging, until one finds the place where the null first was handled, while it should have raised an error. Such is the silly character of PHP standard library. Many functions also have multiple return types, which makes it difficult to simply use the result of one as input to another. If predictability means to predict, that standard library will behave nonsensically, then yes, PHP has the one high predictability.
- samuellevy 4y ago> silently take a null instead of a string Oh, so you _haven't_ used any of the recent versions of PHP, then. You're just talking shit with no actual recent experience. Gotcha. Well, thanks for your input.
- zelphirkalt 4y agoLook what I got here for you: docker run -it php:8.0 bash # php -a Interactive shell substr("abcdef", 3); // no result -- Ah right, PHP does things differently than other almost every other language that has a REPL and I have to echo a value, which was just returned, even on the REPL ... php > echo substr("", 3); -- Silently hiding the error. Idiocy. php > echo substr(null, 3); -- Silently hiding the error. Idiocy. php > echo substr("abcdef", 3); def Who is shit talking now? Are you suggesting, that all this is normal and OK? Nothing is fixed. It's still badly designed and probably will remain shitty like that, until PHP programmers finally realize, that this needs to be properly fixed. EDIT: Of course the docs also do not mention this to happen at all and tell you, that the first argument must be a string. So I guess that means, that in PHP terms, null is a string. Great for type safety!
- tored 4y agoThese problems were fixed in PHP 8.0 and 8.1 https://wiki.php.net/rfc/engine_warnings https://wiki.php.net/rfc/engine_warnings https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_a...
- n3storm 4y agoI am starting to find PHP bearable as soon as they are starting to follow Python language and precepts (like libs for humans, code readability instead of shorthands,...)