News for hackers. Stuff that matters.
Re:A call to PHP's mt_rand generates only odd numbers by dspillett on Friday July 24, 2015 @09:52AM (#9941966)
To be fair, that is not an uncommon situation elsewhere either.
Re:A call to PHP's mt_rand generates only odd numbers by mikeash on Friday July 24, 2015 @11:01AM (#9942441)
I think it is. Sure, there are plenty of calls out there in all sorts of systems that have crazy, documented behavior. But it's rare to see anyone outside of the PHP world defending the crazy behavior purely on the basis that it's documented. Crazy behavior is almost always there because of compatibility concerns, performance concerns, or an acknowledged bug that just hasn't been fixed yet. Outside of PHP, I rarely see anyone just say, "It's fine, that's how it's documented to behave" and leave it at that.
Re:A call to PHP's mt_rand generates only odd numbers by Peaker on Friday July 24, 2015 @01:45PM (#9943801)
I recall a Rails bug used to hack github and inject a bugfix commit. The Rails community rejected the fix originally because the crazy behavior was documented.
Re:A call to PHP's mt_rand generates only odd numbers by mkehrt on Friday July 24, 2015 @02:07PM (#9943954)
Wow. Do you have any more info on this?
Re:A call to PHP's mt_rand generates only odd numbers by dkns on Friday July 24, 2015 @02:58PM (#9944352)
Re:A call to PHP's mt_rand generates only odd numbers by BuildTheRobots on Friday July 24, 2015 @11:58AM (#9942860)
Outside of php and systemd.....

<Friday afternoon trolling is just too easy this week />

Re:A call to PHP's mt_rand generates only odd numbers by dspillett on Friday July 24, 2015 @12:43PM (#9943236)
And mySQL of old.

I assume things are much better now, but I remember a time when things like INSERT <table> (<date_field>) VALUES ('2015-02-30') would not have raised any sort of error, amongst other terrible things that people would defend having to implement explicit checks for in other layers of your application.

Re:A call to PHP's mt_rand generates only odd numbers by slapresta on Friday July 24, 2015 @02:32PM (#9944181)
> I assume things are much better now

Nope: http://grimoire.ca/mysql/choose-something-else

Re:A call to PHP's mt_rand generates only odd numbers by Spivak on Friday July 24, 2015 @02:27PM (#9944140)
I'm genuinely curious, what are some examples of systemd's odd behavior?
Re:A call to PHP's mt_rand generates only odd numbers by BuildTheRobots on Friday July 24, 2015 @04:07PM (#9944824)
Well, the fact my window manager is now intrinsically linked to my systems boot process strikes me as somewhat obscene. There was the amusement with it reacting to debug being passed to the kernel which caused the system to never finish booting...

systemd is by no means alone; in the last month I've discovered that `yum` deliberately breaks its output when you try and pipe it to something else (I mean really, ffs, really?). The justification for this isn't even internally consistent which really winds me up too...

Whilst I pick on a couple, there's been innumerable packages, languages and platforms over the years that have had their share of what could politely be called idiosyncrasies. I highly recommend The Unix Haters Handbook [1] for plenty of historic examples -it's a lovely read -oh, and for years one of the *nix bullet points was always "all the power in the world and not a safety in sight" [2]

[1] The Unix Haters Handbook: https://en.wikipedia.org/wiki/The_Unix-Haters_Handbook || http://www.csf.ac.at/fileadmin/user_upload/BioComp/training/...

[2] The Hole Hawg: https://web.archive.org/web/20150214132948/http://www.team.n...

Re:A call to PHP's mt_rand generates only odd numbers by RickHull on Friday July 24, 2015 @07:41PM (#9945891)
> Well, the fact my window manager is now intrinsically linked to my systems boot process strikes me as somewhat obscene.

Gnome depends on logind, which is sensible. Yes, logind is part of a suite of system management tools which also includes tools to manage the boot process.

Your complaint would apply equally to your window manager being intrinsically linked to your serial port (via the Linux kernel).

Re:A call to PHP's mt_rand generates only odd numbers by digi_owl on Saturday July 25, 2015 @01:55PM (#9948363)
Not just part of, logind will straight up not work if systemd is not running as pid1. As such, anything that depends on logind is dependent on a specific init sitting as pid1.
Re:A call to PHP's mt_rand generates only odd numbers by BuildTheRobots on Saturday July 25, 2015 @08:12AM (#9947353)
As an honest question, could you explain _why_ it's sensible?

Until a couple of years ago, my linux box was nearly entirely modular letting me install any combination of boot-loader, kernel, init system userland tools and/or desktop. How is this better?

Re:A call to PHP's mt_rand generates only odd numbers by pogden on Friday July 24, 2015 @12:38PM (#9943187)
What's more common outside PHP is that functions throw errors or exceptions when given invalid input, rather that trucking along and producing output that is clearly not what was intended.