News for hackers. Stuff that matters.
[dead]
Re:Movim – Federated, open-source alternative to Tumblr by bovermyer on Tuesday December 04, 2018 @01:16PM (#18602057)
Yes, you do actually need to say more. What about the language choice gets you to make this comment?
Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Tuesday December 04, 2018 @01:54PM (#18602468)
Read this; it's a tad old, but still a very good read and while a few specifics have been fixed the overall argument is still perfectly sound: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
Re:Movim – Federated, open-source alternative to Tumblr by bovermyer on Tuesday December 04, 2018 @02:02PM (#18602572)
I have read that document. While PHP certainly has its problems, it still remains a tool in my toolbox.

The trick is being aware of the pitfalls. Just because an application is written in PHP does not make it inherently bad, just as an application written in (e.g.) Rust does not make it inherently good.

Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Tuesday December 04, 2018 @06:19PM (#18604400)
Rust makes it unlikely that certain classes of bugs exist. PHP makes it very likely that lots of bugs exist. You're right, it's not a silver bullet, but writing PHP, no matter how much you're "aware" of the pitfalls is just bad engineering and makes your software more likely to be buggy crap.
Re:Movim – Federated, open-source alternative to Tumblr by bovermyer on Tuesday December 04, 2018 @10:20PM (#18605455)
Rust is unforgiving, yes. PHP is forgiving, yes. You will write Rust the way Rust wants to be written, or you will suffer. You will write PHP the way you want to write PHP, and you may make yourself suffer.

One requires that you think a certain way in order to function at all. The other requires only that you can solve problems, but makes no guarantees that your solution will be the optimal one.

Regardless of language, the criteria you need to keep in mind is this:

> Am I solving a problem for people in a way that is better than other available solutions?

Re:Movim – Federated, open-source alternative to Tumblr by pdimitar on Wednesday December 05, 2018 @08:46AM (#18608099)
> One requires that you think a certain way in order to function at all.

That's a feature in my eyes. Languages with too much freedom -- C++, PHP, Javascript and many others -- suffer from (a) lack of idiomatic syntax or ways of doing basic things like map&reduce; even finding an element in a list, or formating a date/time have many library choices, and (b) give you plenty of ways to shoot yourself in the foot.

Opinionated tech is a protection against a class of brain defects of the human programmers. You cannot keep track of 50+ potential dangers in your head all the time. You will inevitably make a mistake. Opinionated tech reduces the count of things you have to constantly be aware of.

So again, feature, not a bug.

Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Tuesday December 04, 2018 @10:53PM (#18605574)
I agree with that statement. That statement is never true for PHP. It is the wrong solution. Stop using it.
Re:Movim – Federated, open-source alternative to Tumblr by bovermyer on Friday December 07, 2018 @11:51AM (#18629212)
Well, now I'm going to have to write something in PHP just to spite you. =P
Re:Movim – Federated, open-source alternative to Tumblr by sethrin on Tuesday December 04, 2018 @03:53PM (#18603512)
No, that post is past its utility.
Re:Movim – Federated, open-source alternative to Tumblr by zkomp on Wednesday December 05, 2018 @02:04AM (#18606234)
Why? It is still spot on. The metaphor is perfect - no matter what specific bugs is fixed in PHP, the overall fractal of pure shit is still present - it is everywhere you look.
Re:Movim – Federated, open-source alternative to Tumblr by sethrin on Thursday December 06, 2018 @02:41AM (#18616153)
If you want to see that, I'm sure you will. It says more about you than about PHP, though.
Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Thursday December 06, 2018 @11:07AM (#18619195)
Why do you think it's past its utility then? The arguments are still perfectly sound, so despite a few of its complaints being fixed it still seems worth reading to me.
Re:Movim – Federated, open-source alternative to Tumblr by sethrin on Friday December 07, 2018 @05:20PM (#18632225)
One can write very similar things about the evils of C, Java, or JavaScript, particularly if you happened to be an asshole. It's mostly value judgments, and consequently it has low informational value. It's an angry rant. CS needs far fewer people who think that it's okay to write vague, angry rants about other people's code. Yes, that is quite a common thing to do, and no, that does not make it okay.

If you must rag on PHP, presumably after some contemplation of the beam in your own eye, then this would be best accomplished by a more neutral and factual presentation, such as phpsadness.com. Spreading an angry, dismissive, fact-light rant is just poo-flinging.

Re:Movim – Federated, open-source alternative to Tumblr by vertigolimbo on Tuesday December 04, 2018 @12:49PM (#18601754)
So? So is facebook, wikipedia and, surprise, surprise - Tumblr
Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Tuesday December 04, 2018 @12:54PM (#18601807)
Facebook has an army of engineers to make it work even though they made a mistake early on. Small open source projects written in PHP don't.
Re:Movim – Federated, open-source alternative to Tumblr by wolco on Tuesday December 04, 2018 @12:55PM (#18601819)
What do you recommend?
Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Tuesday December 04, 2018 @01:07PM (#18601944)
Over PHP? Basically anything. Hell, I'd use Python before I touched PHP or let anyone install it on any of my machines, and after years of using Python at work I despise it (sorry people who love Python).
Re:Movim – Federated, open-source alternative to Tumblr by existencebox on Tuesday December 04, 2018 @01:12PM (#18602018)
I'm somewhat curious to ask "why" (and full disclosure I am indeed a koolaid-drinking python fan) because I could find myself agreeing if you had said the slightly different "I despise it <for certain classes of work>"

E.g. I found myself regretting writing a 20k LOC hobby product in python, it rapidly became so much more of a hairball to grow than a strongly typed or statically compiled language (and part of me wonders how much that's because I haven't learned type hints yet); however you'll pry python from my cold dead hands before I take another language for data analysis/prototyping.

Re:Movim – Federated, open-source alternative to Tumblr by deft on Tuesday December 04, 2018 @01:36PM (#18602267)
We have the exact same issue with python. For large projects the dynamic typing is such a hassle. It slows down development. It increases debugging time. It's just a pain for complex systems. I haven't used type hinting yet but it only fixes so much of the problem.
Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Tuesday December 04, 2018 @01:45PM (#18602363)
We're veering offtopic now, but my problems with Python (in no particular order, some are serious, others are just nits that are annoying but don't really discourage it that much):

- Too dynamic: deliberately hand-wavy but, as you said things quickly become a hairball. No where I've been has been disciplined enough to keep Python projects clean, but they shouldn't have to be. - Dependency management: pipenv has made fetching dependencies a bit better, but it's so slow that it's almost unbearable to use (for even a small repo it has to download and execute setup.py from deps one at a time because the underlying system doesn't provide a decent way to calculate a dependency graph up front, it's aweful). - Testing: I don't know why exactly, but every single place I've ever been has had large chunks of tests that do nothing because mocks accidentally got substituted in for the thing being tested. Maybe this is just part of "too dynamic". - Deploys: I miss the days of single binaries. Workarounds like using containers just for the sake of having a single artifact that can be pushed to prod are solutions for a problem that shouldn't exist. That being said, single binaries seem to be in vogue again, so maybe those days will come again soon. There are certainly worse things here than Python, but still, it's been a major pain point at all places I've been previously. - Significant whitespace: I know this one is controversial and in theory is just a minor annoyance, but again, everywhere I've ever been we've had some sort of major issue where it turned out that something wasn't indented as much as someone thought it was and it was missed in code review. Curly braces may be ugly, but at least they're explicit. - The Python 2/3 split. 'nuf said. People acknowledge that this was a mistake, everyone else learned from it and it's becoming less of a problem over time (but not quick enough).

No language is perfect, but I can't think of a single problem that I wouldn't pick something else over (unless its a choice between Python and PHP, then I'll take PHP any day).

On a more positive note, I always miss context managers when working in other languages that don't have a similar concept.

EDIT: Sorry about the list formatting.

Re:Movim – Federated, open-source alternative to Tumblr by wolco on Tuesday December 04, 2018 @04:39PM (#18603807)
You would choose anything, anything at all. Curious are you an active developer?
Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Tuesday December 04, 2018 @06:22PM (#18604419)
Yes, basically anything. And yes, I'm an active developer who has been forced to use PHP plenty of times. Don't do it. Just stop it. Every time you use PHP, even newer varieties, you are making the world of software a worse place.
Re:Movim – Federated, open-source alternative to Tumblr by wolco on Wednesday December 05, 2018 @01:31AM (#18606117)
What language are you using daily?
Re:Movim – Federated, open-source alternative to Tumblr by SamWhited on Wednesday December 05, 2018 @09:20AM (#18608367)
Mostly Go these days, still a bit of Python and Clojure and on rare occasions a bit of Rust (although those aren't really daily anymore).
Re:Movim – Federated, open-source alternative to Tumblr by grezql on Tuesday December 04, 2018 @01:02PM (#18601901)
no, facebook was initially written in PHP but as it grew they realized it sucked and invented HHVM / Hip Hop to transpile the php to C++.
Re:Movim – Federated, open-source alternative to Tumblr by keb_ on Tuesday December 04, 2018 @01:46PM (#18602380)
In what ways is Hack & HVVM better than PHP7 & Zend? Genuine question.

I've found developing PHP7 applications relatively easy and stress free with the combination of static analysis tools & PHP7 typehinting.

Re:Movim – Federated, open-source alternative to Tumblr by zamalek on Tuesday December 04, 2018 @01:58PM (#18602516)
HVVM used to have the advantage that it was much faster. PHP have subsequently got their act in order and, last I read, there's little difference.
Re:Movim – Federated, open-source alternative to Tumblr by nl on Tuesday December 04, 2018 @08:14PM (#18604989)
So.. it's written in PHP then.

(They don't write C++ code, they still write PHP)

Re:Movim – Federated, open-source alternative to Tumblr by Nydhal on Tuesday December 04, 2018 @12:52PM (#18601787)
facebook was a mistake.
Re:Movim – Federated, open-source alternative to Tumblr by wolco on Tuesday December 04, 2018 @12:54PM (#18601811)
Someone is stuck in the year 2012. What do you recommend backbone, jquerymobile?