Functional programming rah! OOP nah! Or how to know you're a zealot
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Bulb said in Functional programming rah! OOP nah! Or how to know you're a zealot:
You have this helper object, but the user does not have to remember to use it, because the mutation methods are on the helper, can't forget to make it exception-safe by not putting the closing call in a finally, can't forget to make the closing call altogether.
You're "solving" problems that don't exist. Like parens or braces, you write the start and the end together and then add the material between them; that's just how code like this is written. This is a fairly common pattern in GUI programming, and I've literally never seen it mismatched. Not once.
Just like
new
anddelete
. I’ve never mismatched them, so we don’t need either GC or RAII.
-
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
YMBNH.
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
You're "solving" problems that don't exist. Like parens or braces, you write the start and the end together and then add the material between them; that's just how code like this is written. This is a fairly common pattern in GUI programming, and I've literally never seen it mismatched. Not once.
How much of that is remembering it all and how much of that is the IDE either doing it for you or throwing an error if it isn't there?
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
You can't do this with RAII without it being a major wtf.
Here are a few simple ways to do it.
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
Well, we all know that stuff being done a lot is the main hallmark of quality.
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
I've got a long enough career that it can now get a driving license, or buy guns...
I've seen it plenty, all over the place.
Of course, I constantly complain about the skill levels of my cow-orkers as well.
-
@boomzilla said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
Well, we all know that stuff being done a lot is the main hallmark of quality.
The most dangerous words in the English language are "this time will be different, I swear!"
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@boomzilla said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
Well, we all know that stuff being done a lot is the main hallmark of quality.
The most dangerous words in the English language are "this time will be different, I swear!"
Enjoy your cargo cult and refusal to learn from other people!
EDIT: Also people are literally saying the opposite of that. "This does the same thing." And none of it lived down to your expectations of .
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects.
I can use this exact phrase to describe me and PHP. I would not be so quick to describe anything this way.
-
@Mason_Wheeler You wrapped the end into a finally clause. Even if people were to never forget about the end in the first place (), there 100% will be people that forget about exceptions and will write non-exception safe code (i.e., without the try-finally).
If the code between the begin() and end() is more than a single line, you'll end up with stuff like people returning out of the block, never realizing that it'll skip their end() call.
-
@boomzilla said in Functional programming rah! OOP nah! Or how to know you're a zealot:
people are literally saying
Hearsay!
-
@Carnage said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
I've got a long enough career that it can now get a driving license, or buy guns...
I've seen it plenty, all over the place.
Of course, I constantly complain about the skill levels of my cow-orkers as well.Like I said, this is a common UI pattern. You know why getting it wrong simply does not happen? Because even if someone did accidentally get it wrong, as soon as they run it to test it they would notice that the UI is broken, which is literally among the easiest types of bugs to notice, if not the easiest.
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
they would notice that the UI is broken
:
-
@Carnage said in Functional programming rah! OOP nah! Or how to know you're a zealot:
I've got a long enough career that it can now get a driving license, or buy guns...
I've got a long enough career that it could have a baby career — and the baby career could be grown up and have its own baby career.
-
@Mason_Wheeler and yet such examples of such bad code can and do make it into the wild.
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Carnage said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
I've got a long enough career that it can now get a driving license, or buy guns...
I've seen it plenty, all over the place.
Of course, I constantly complain about the skill levels of my cow-orkers as well.Like I said, this is a common UI pattern. You know why getting it wrong simply does not happen? Because even if someone did accidentally get it wrong, as soon as they run it to test it they would notice that the UI is broken, which is literally among the easiest types of bugs to notice, if not the easiest.
Yes. That pattern works in the languages you work with regularly. But why do you continue to deny that the code that we've all seen accomplishes the same thing?
No one said that the code you posted was dumb. They've just proved you wrong for saying it's the only way.
A smarter and humbler person than you would say, "Oh, yeah. That works, too. I'm not familiar with that, but it would work."
Just stop being such an arrogant retard for once.
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Carnage said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler it is possible for things you have not seen to occur, and with frightening frequency. When did you start believing that you were the knower of all things?
A long career encompassing several different jobs and codebases, plus heavy involvement in open-source and other side projects. If it was at all frequent, it seems reasonable to assume that I would have run across it at some point.
I've got a long enough career that it can now get a driving license, or buy guns...
I've seen it plenty, all over the place.
Of course, I constantly complain about the skill levels of my cow-orkers as well.Like I said, this is a common UI pattern. You know why getting it wrong simply does not happen? Because even if someone did accidentally get it wrong, as soon as they run it to test it they would notice that the UI is broken, which is literally among the easiest types of bugs to notice, if not the easiest.
I haven't touched UI code in 8 years now I think.
Where I see it must often is with shit like database connections. And you'd think that people would notice running out of that resource and fix it.
-
@Carnage said in Functional programming rah! OOP nah! Or how to know you're a zealot:
you'd think that people would notice running out of that resource and fix it
I've heard far too many stories of problems with Oracle database servers simply because idiots writing web pages in old-style PHP had no idea what "releasing a resource" was, let alone why they should do anything about it. There's a lot of wrong packed in that sentence, but in the case I'm thinking of it was causing totally unrelated applications (including for login auth!) to fail because the database server couldn't spawn any more processes.
-
@dkf said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Carnage said in Functional programming rah! OOP nah! Or how to know you're a zealot:
you'd think that people would notice running out of that resource and fix it
I've heard far too many stories of problems with Oracle database servers simply because idiots writing web pages in old-style PHP had no idea what "releasing a resource" was, let alone why they should do anything about it. There's a lot of wrong packed in that sentence, but in the case I'm thinking of it was causing totally unrelated applications (including for login auth!) to fail because the database server couldn't spawn any more processes.
These people should have MFC inflicted upon them, and having to create a desktop program.
-
@Carnage they’d just be confused that things crashed often and with no obvious-to-them reason.
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
they’d just be confused
They're already confused. This is just about having a good chuckle as they get dropped in a soul-sucking morass.
-
@dkf we could always inflict PHP-GTK on them.
-
@Arantor The evil ideas thread is .
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@dkf we could always inflict PHP-GTK on them.
Are there any enlightenment PHP bindings?
-
@Carnage I don’t think so. There’s definitely been bindings for both Qt and GTK but neither are maintained as far as I know and the move to PHP 7 is kinda what killed them.
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Carnage I don’t think so. There’s definitely been bindings for both Qt and GTK but neither are maintained as far as I know and the move to PHP 7 is kinda what killed them.
I guess it'd be too far down the insanity hole.
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Carnage I don’t think so. There’s definitely been bindings for both Qt and GTK but neither are maintained as far as I know and the move to PHP 7 is kinda what killed them.
A while ago I looked into it for , and php does not support out-of-tree extensions to the point where they purged all documentation related to it. So if there's nothing on php.net about it, it probably doesn't exist.
-
@PleegWat PHP-GTK at least did have a semi-official page on PHP.net itself, PHP-Qt had a Sourceforge project, wxPHP it’s own site (+GitHub, and unexpectedly is still maintained)
Other random repos do exist out there but it’s all a nonsense shitshow as you would expect.
-
@Arantor the Enlightenment binding will be much easier, tho. If they've stayed true to their manifesto goals and all their assumptions hold. What could go wrong?
-
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
Like I said, this is a common UI pattern. You know why getting it wrong simply does not happen? Because even if someone did accidentally get it wrong, as soon as they run it to test it they would notice that the UI is broken, which is literally among the easiest types of bugs to notice, if not the easiest.
Some UI bugs are easy to notice, some sit in the code base for a decade until someone notices it. Everyone than wonders how this bug existed for so long with nobody noticing it.
-
@topspin said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Zecc said in Functional programming rah! OOP nah! Or how to know you're a zealot:
and the guy who isn't sure.
Apropos of nothing in particular, I once read a short story that had a similar premise to Idiocracy: once upon a time, we were really good at making things, and making them to last. And so all the world's infrastructure systems lasted almost-forever... and there was no demand whatsoever for them once they'd been installed everywhere, so the companies that made them eventually went bankrupt.
The protagonist is a senior sewage worker: he's really good at interpreting the error codes the sewage system spits out, rebooting the system, cleaning a sensor, removing a blockage, etc. And then, one day, one of the machines he works with just goes completely dead, in the way that 100 years of poor maintenance on an excellent machine will eventually do. So the hero, being a clever person who cares about his job, tries to find someone to repair his machines. Any possible helpline for these nigh-invincible machines has long since closed, and in desperation, he finally just writes down the machine's specs and tries to research at the local library -- maybe he can learn how to fix it himself?
The punchline is that this is the first time the librarian has ever seen any member of the public enter the library. She's surprised and pleased and eager to help, but it's very clear that there is nobody in the world who can possibly fix any of these old, slowly-failing machines that are propping up what passes for civilization these days.
-
@PotatoEngineer that's a big theme in the early Foundation stories by Asimov.
-
@PotatoEngineer and this is why you want to build reliable software.
-
@Gribnit if someone made it, I'd give it a go to build an application. But I don't think I have the right level of... shall we say... enlightenment to make the binding myself.
-
@boomzilla said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@PotatoEngineer that's a big theme in the early Foundation stories by Asimov.
I read that series (up to Second Foundation, I'm not sure if there's more), but I can no longer remember why the Empire fell in the first place. The important part to that series wasn't how the Empire fell, only that it did. But now I wonder. <internet-searchyness /> Nope, never revealed how the Empire fell, Empires are just things that rise and fall. Apparently, there's a TV series now, and the pre-Empire-fall bit is expanded into multiple episodes.
-
@Arantor said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@dkf we could always inflict PHP-GTK on them.
Good lord, I hate GTK, and let’s say I haven’t read a single good thing about PHP. The combination sounds diabolical.
-
@Arantor fairly stated and full points, although the judges were expecting more screaming.
-
@topspin Especially as PHP-GTK is of the era before PHP really put the time and energy into cleaning up its act.
-
@Dragoon said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@Mason_Wheeler said in Functional programming rah! OOP nah! Or how to know you're a zealot:
Like I said, this is a common UI pattern. You know why getting it wrong simply does not happen? Because even if someone did accidentally get it wrong, as soon as they run it to test it they would notice that the UI is broken, which is literally among the easiest types of bugs to notice, if not the easiest.
Some UI bugs are easy to notice, some sit in the code base for a decade until someone notices it. Everyone than wonders how this bug existed for so long with nobody noticing it.
I fixed a bug last month where a feature just deterministically always crashed when you tried to use it.
To be fair, it was introduced by a former cow-orker, I’ve never used it myself either, and apparently so never did our customers. (Our product is the opposite of off-the-shelf, with only a handful of users and a correspondingly high price tag.)Still, I have no idea what that
assholecow-orker was thinking when they checked it in.
-
@topspin said in Functional programming rah! OOP nah! Or how to know you're a zealot:
Still, I have no idea what that
assholecow-orker was thinking when they checked it in.Let's be honest, the user is unlikely to use this anyway, so I'll just check this completely untested prototype in, close the ticket and if I am wrong, I'll finish it later under the bug report.</>
-
@topspin said in Functional programming rah! OOP nah! Or how to know you're a zealot:
I have no idea what that
assholecow-orker was thinking∅
-
@Bulb said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@topspin said in Functional programming rah! OOP nah! Or how to know you're a zealot:
Still, I have no idea what that
assholecow-orker was thinking when they checked it in.Let's be honest, the user is unlikely to use this anyway, so I'll just check this completely untested prototype in, close the ticket and if I am wrong, I'll finish it later under the bug report.</>
Or more likely, he figured it was good enough to pass the unit tests and he could claim his 5 points for the PBI and faff off to the pub early.
-
@boomzilla said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@PotatoEngineer that's a big theme in the early Foundation stories by Asimov.
Also an undercurrent of Logan's Run, though it was excised from the film adaptation.
-
@PotatoEngineer said in Functional programming rah! OOP nah! Or how to know you're a zealot:
I read that series (up to Second Foundation, I'm not sure if there's more),
Much more. Up to and including deconstructing its own premise. And that's before you get on to the second trilogy written, by three writers all with names starting with 'B', after Asimov's death.
-
@Watson said in Functional programming rah! OOP nah! Or how to know you're a zealot:
@PotatoEngineer said in Functional programming rah! OOP nah! Or how to know you're a zealot:
I read that series (up to Second Foundation, I'm not sure if there's more),
Much more. Up to and including deconstructing its own premise. And that's before you get on to the second trilogy written, by three writers all with names starting with 'B', after Asimov's death.
Well, it's all that was on my parents' bookshelves, so surely that's enough!?
(Okay, I should hunt down some more books. But since I haven't read an actual book in about four years, it could be a while. Been doing a lot of podcasts after I had the first kid, because there just wasn't much time any more, and I'd usually rather play video games with my wife as audience than read a book.)