« first day (4317 days earlier)      last day (614 days later) » 

JRL
12:09 AM
@Crell I mean, you can use this sort of thing to write to private properties 3v4l.org/BUvSi#v8.1.9 (fortunately it appears that using it to write to readonly properties is still prevented)
that makes it impossible to make actually immutable classes unless you make the whole class readonly basically
 
Sure, yeah, I don't see how that's relevant. Maybe I'm missing something, but that... has nothing to do with FP.
 
JRL
right, but it has everything to do with OOP
which is my point
having FP be just a way to screw up all the assumptions and protections for people who use OOP instead doesn't seem... correct
 
Why should FP be "just a way to screw up all the assumptions"? That's what I am not following.
 
JRL
im not saying that's all it is, im saying that the fact that this works should be considered a bug, regardless of whether it makes sense from a FP perspective, because it violates a core assumption of the object model
 
Well, ORMs and serialization libraries would be very hard to write if not impossible otherwise. PHP is hardly the only language with visibility back doors.
 
JRL
12:13 AM
???
how could those things not be done with a write once method?
 
That means you have to build serialization machinery directly into the class. And you still need to be able to read the data to serialize/save it.
Unless you go back to "everything must have a getter and setter method" like a Java Bean, in which case you may as well give up and stop pretending.
 
JRL
function set($key, $value) { $this->$key = $this->$key ?? $value; }
 
And bypass any validation.
 
JRL
i dont think its unreasonable to have an interface for something like that on objects you want to magically work with serialization
 
Having just build a serialization library that doesn't require that, I disagree. :-)
 
JRL
12:17 AM
okay. im pressing because i don't understand how that requires visibility back doors for FP. im trying to get you to explain it a bit so i can learn.
because i don't see it right now
 
I made extensive use of the rebinding hack for both read and write, which meant most functionality could be applied to any object.
I think we're talking past each other.
One sec.
 
JRL
ok
 
1) Being able to bust through visibility rules is not an FP thing. It is entirely orthogonal to FP. I don't know why it's even being discussed.
2) Being able to bust through visibility rules in certain circumstances is very useful, and almost a requirement for certain things to work.
3) Being able to bust through visibility may or may not violate OOP dogma, depending on which OOP dogma you're subscribing to, as there are many. :-) But if the dogma disallows useful things, or requires heavy contortions to get around it (like Java Beans), then it's a bad dogma.
I try to be pragmatic these days. FP and OOP have way more in common than most people give either credit for, and it's not an either/or battle. If done intelligently, they're complementary.
Gotta head out. Inlaws in the hospital again. :-(
Good night folks.
 
12:46 AM
Can I call zend_execute from within PHP?
Hm, or maybe more like zend_add(opcode)
 
 
2 hours later…
3:15 AM
@TimWolla I'm always impressed by how any and every new bit of information I learn about character encoding makes the subject space more complex.
I don't recall learning anything about unicode where after I was like "yeah this makes things simpler"
 
 
4 hours later…
7:28 AM
@Crell First of all, I hope that your relatives are doing okay. I was wondering if you could help me understand the appeal behind hidden properties (I believe that to be a core concept of OOP).
Having only coded small REST projects, if I needed to protect data against undersirable reads, I do it at the authentication level. If modifying data may cause problem, I solve it by either versioning or choosing an immutable datatype.
I've never had to write my own classes, and I dislike using them (unless it's a db model for orms) because of the unnecessary overhead.
 
8:10 AM
@Mwthreex Xdebug can also make a dump of all function calls, including location and arguments to a file: xdebug.org/docs/trace — with xdebug.mode=trace — see also youtube.com/…
@kelunik I've been seeing these as well now, it's due to an old openssl library, IIRC.
 
hm php.net/hrtime is going to the pecl/hrtime instead of the new hrtime core function, maybe that should change?
 
 
1 hour later…
cmb
9:34 AM
@beberlei Probably (although cool URLs don't change). But I wouldn't know how to do that.
 
cmb
9:50 AM
@OlleHärstedt To manipulate PHP source code on the fly just before compilation, you could write and register a stream wrapper. If you can/want to do it from an extension, see phpinternalsbook.com/php7/extensions_design/hooks.html.
 
10:36 AM
@cmb Hm hm. Would that require a PHP extension?
Oh wait
Let me google for stream wrapper first
 
@cmb That can be used to write tokens? During include or such?
 
cmb
@salathe Thank you! (now I know)
 
11:25 AM
morning
 
 
2 hours later…
1:28 PM
@cmb sorry you had to deal with that ... whatever that is :D
 
1:41 PM
Hi @Derick , looks like you forgot to push geospatial to github.com/php-geospatial/geospatial
 
@RemiCollet Yes, forgot to push enter ;-)
 
thanks!
 
@JoeWatkins... that was one hell of a confusing thread
 
@Derick the only part I understood was the ending ... Fuck PHP :D
 
cmb
2:08 PM
I'm afraid that person indeed needs to talk – to a psychiatrist. :(
 
Jun 16, 2021 at 19:32, by Danack
> imo, one of the big problems facing open source ...is dealing with the online behaviour of people with long term mental problems
@cmb this is a problem that's going to get worse and worse...
 
cmb
sadly
 
2:24 PM
22 hours ago, by Danack
Does anyone here care at all about the semantic web? I just saw this,and have no idea why people were ever invested in it, or why they're still trying after all these years of failing.
If anyone does have any insight on the semantic web, or even why some people think it's worth spending energy on, I'd still like to understand that better, to avoid possibly wasting some time on something.
 
I sometimes think it was a mistake to include null in mixed.
@dhiaagr Thanks. Mother in law has been in and out of the hospital this year. Lots of family drama I won't go into here. :-(
@dhiaagr One of the key tenants of modern coding is "information hiding." Which is a fancy way of saying that the implementation details of piece X should be hidden/inaccessible from piece Y, so that you can refactor/change/improve piece X without breaking piece Y. Most good languages have some mechanism for that, and in the ones that don't (JS, Python, Ruby, etc.) there's conventions like a _ prefix to indicate "internal, I may change it, don't use this directly."
The trick is how one defines "piece" and "details." In PHP, Java, C++, and C#, piece is defined as the class. Hence public/private/protected visibility and interfaces. (They address that separation in different ways, but both are aimed in part at that separation.)
In Rust, Go, and a few other newer languages, it's defined at the package level. In some languages, it's defined in both, because why not. :-)
 
@Crell any particular reason?
 
2:40 PM
@JoeWatkins Wow. Just... wow.
@Danack Because "foo|null" to indicate error is such a common pattern. It would be helpful to differentiate between "this returns something but I don't know what" and "this returns something but I don't know what, or null on error." Right now, there's no meaningful way to differentiate those.
(Technically you could list out int|float|string|array|object each time yourself, but 1) eew, and 2) doesn't cover resources.)
 
Yeah....type systems are never a perfect fit. But I don't blame mixed here. I think what would want here is to be able to do:
typedef result = int|float|string|array|object;

function foo() : result|null {...}
And resources are going away.
 
I dunno if it's okay to brand everyone prone to ranting as needing mental help ...
haven't you ever met someone like that irl ?
like in any pub, on any friday or saturday evening, in any big city, anywhere in the world ?
 
@Danack That would also work, yes. So when are you adding typedef? :-)
 
Jun 17, 2021 at 11:42, by Danack
I know I need to find a better phrase for it.....but when people perceive the world, (particularly the motivations of people giving them feedback) in a way that does not match the perception that the vast majority of people have, and there is such a divergence in "perceptual models" you can't have a useful productive conversation with them, or about their code.
 
some people like the sound of their own keyboard/voice, and there's nothing more too it than that ... that their thinking is confused and erratic doesn't necessarily mean they are unwell, maybe they just are like that ...
 
2:49 PM
Let's see whether this is going to draw attention: github.com/php/doc-en/commit/…
 
@JoeWatkins Context matters. An unhinged rant doesn't itself imply someone is mentally unwell. But enough of them directed at you can make you mentally unwell.
 
@Danack but what if they actually do think corporate pressure does play a role, that's not necessarily paranoid, it could ...
 
@JoeWatkins yes. If you can give me a better phrase to use for "when someone perceive the world in a way that they are unable to have a productive conversation with other people, or at least makes other people scared to take part in a conversation".
 
@Derick Oh dear. I wonder how much code that's going to break. (Is that from the standards body?)
 
Why would anything break?
 
2:52 PM
Oh, that's just the docs, never mind.
 
Well, there is a update in the database too
 
The difference in a pub is that you can go and sit at a different table, or if someone is harassing people in a pub, the landlord will (or at least should) kick them out. But online, they people's bad behaviour seems to get worse and worse over time.
 
Adds Europe/Kyiv, and marks Europe/Kiev as "backwards" (ie, outdated)
 
@Derick oh well, at least that isn't going to be contentious as it's completely unrelated to current world events. /s
 
2:54 PM
well, Ukrainians have been lobbying for this for nearly a decade now... the rule was always "the most common English spelling", and that (since February) has now significantly changed
 
and same start with Odessa => Odesa
 
yes, but that's not a TZID :-)
 
@Danack heh… Mixed is still a hack … in general.
 
this latest push of me will likely break some tests, which I'll fix duely
 
@Danack Also: is that a honor?
 
2:57 PM
@bwoebi I refer you to my previous answer: "Mixed is a vital thing....that should be used as little as possible."
 
yeah :-D
 
@JoeWatkins as I said, if you have a better phrase for me to use for when someone is interacting so poorly there can't possibly be a useful conversation, I will try to use it. But I see people consistently behaving in a way that is obviously (in my opinion) hurting both themselves and other people, due to them having very odd beliefs.
The 'Trongate' guy is a good example. He apparently was able to have productive conversations with people up until a few years ago, when he wasn't selected to be the new maintainer of Cake (I think). At which point other people started noticing he was starting to behave oddly.
By being really nasty to other people. He seems to have continued spiralling into his own belief that he is the best programmer in the PHP world, and everyone else is an idiot:
 
Hello I'm from Indonesia, this is my first time posting a chat on Stackoverflow.
Where should I start to learn Laravel Observer, any suggestions? Oh yeah, is there a room for a special Laravel chat?
 
@HanaHasanah The laravel community seem to be mostly elsewhere. I think on Laracasts, which probably has some information on Laravel Observer.
 
cmb
@Danack At least I can understand what they are saying there.
 
3:10 PM
The guy has massively hurt his own career by being such an arse, and he can't comprehend why people might not want to work with him: youtube.com/watch?v=uS1vKAN_ick And to be clear, I feel really bad for him. A slightly difference lived experience or tragic event in my life could have easily left me being far more of a dick, and not seeing how that is affecting people.
 
@cmb checking for the expires (time_t) with a number out of 2^31 range does not work (on 32 bit systems) - should I... just leave what I have or make a macro hack?
 
@cmb yeah.....it seems that being completely unable to have a productive conversation is not directly related to appearing to be able to form sentences. Which can waste other peoples time.
 
cmb
@Derick I think you need to check only #ifdef ZEND_ENABLE_ZVAL_LONG64.
 
Sure, but it still seems so pointless :-)
 
cmb
Why pointless? That check is faster, and you don't even need to construct the time string (and release it on failure).
 
3:16 PM
ah - on 32bit systems you can't specify a time_t that high, of course.
 
cmb
And you can't even pass a large value in the first place (zend_long is 32bit signed).
 
thats what I just said :D
 
cmb
Mostly! :) (MSVC defaults to time_tbeing 64bit on 32bit systems; we override that, though. And I don't think POSIX even makes any guarantees about the value range.)
 
new commit added, please check
 
cmb
approved :)
 
 
2 hours later…
5:18 PM
@Danack Calling Nikita an idiot. Bold. Very bold.
 
6:18 PM
@Crell I understand and wish her a speedy recovery.
@Crell I understand.The language that I mainly use is Python and to quote its Zen: Namespaces are one honking great idea. This ensures `internal details to be not the concern of the caller + good design pattern guidelines help mitigate the risks of breaking pieces when refactoring and changing code;
 
@Danack That's because the online "landlords" are cowardly wimps who will happily fold for any bully that walks by and screams "free speech." (Ask me how I really feel.)
 
Thank you for taking the time to explain all this. And I agree with you, FP and OOP don't have to be mutually exclusive because what is OOP anyway but an umbrella term for post goto design patterns.
 
@dhiaagr Well, OOP is more than just "anything better than goto." :-)
 
True, I admit. It's more about objects and those objects having specific behaviors and attributes.
A great talk comes to mind: Stop writing classes. If your class has only two methods, and one of these methods is the class constructor: You don't need a class.
 
6:40 PM
In that case, what you have is a closure with extra verbose syntax. :-)
 
Closures fill me with anxiety, lol.
 
@Danack I can't find the post, so I assume it was deleted?
 
@LeviMorrison yes. I believe the gentleman may have been previously been banned /r/php, and his posts are probably quite identifiable to the mods there.
 
Okay, good. It's fine to complain, but not like that.
 
@dhiaagr i) How do you test your code? ii) OOP isn't about classes, it's about types. And I just wrote a type that has zero methods:
class DatabaseUserConfig
{    public function __construct(
        readonly string $username,
        readonly string $database,
        readonly string $password
    ) {
    }
}
@LeviMorrison to be clear about one thing, I feel really bad for the guy. There is a common pattern of people i) learning to program ii) thinking they've learnt everything and then iii) just not being able to process that the 'youth' may have different and better ideas than someone who has been doing programming for many years, but has stopped learning..
 
6:50 PM
You can have incredibly strong types in non-OOP languages. In fact the strongest type systems are found in functional languages (Haskell, OCaml, F#, Idris, etc.)
@dhiaagr Try my book. It will cure you of that. :-)
 
@Danack Unit testing. All of my tests are assertEqual(). OOP isn't only about classes, but they sure are an intrinsic part. Disclaimer: I only deal with REST apis.
The talk's main point isn't that you can't write classes with a small number of methods, is that yo shouldn't. Since you'd be better using built-in datatypes and stateless functions.
 
@dhiaagr How do you substitute implementations so that you don't have to do things like HTTP calls as part of your tests?
 
@Crell I would gladly check it out. Is it mentioned on your SO profile ?
 
@Crell I will definitely check it out when I'll be able to. Thank you.
@Danack Flask's request objects, there's also a great requests library.
I never meant that I never use classes, that's infeasible. What I meant is that : I never had to write my own classes.
 
7:10 PM
@dhiaagr Looking at that talk... The "functools.partial" bit he shows for Greeting is exactly what I said. That's a closure.
Also, "Separation of concerns doesn't come up." - OK, checking out, the guy doesn't know what he's talking about.
 
@dhiaagr cool. if you're having fun with not using classes, then you do you. And how to write 'good' OOP is one of those things that is easier after you've seen what good OOP looks like (and it's probably not Laravel). But at some point you've got a reasonable chance to change your mind.
 
It also depends heavily on your language. In PHP, plain functions are harder to use because of the lack of autoloading, so they're less common. That's not the case in Python, for instance.
In most OOP languages, classes are how you define types. You. Want. To. Define. Types. Types make your code more self-describing. It is a key part of your validation. And classes are how you do that.
Python isn't a typed language, which is why you're probably not used to it. This is a flaw in Python. :-) (And in all weakly typed or untyped languages.)
 
@Danack I just pointed out that what I meant all along is : I don't wirite classes. And not : I don't use classes.
And it's only based on my usecases. As in: building REST apis. Other than that, my whole application is an instance of the Flask class of the flask framework.
 
@dhiaagr That is going to bite you, very very hard. Especially in PHP, Java, C#, etc.
(And I say this as a strong FP advocate.)
 
@Crell I can imagine how that would be the case based on what I gathered from what you said earlier + what I learned along the way.
Fortunately*, for the time being, any state in my application is always explicitly returned.
 

« first day (4317 days earlier)      last day (614 days later) »