« first day (3555 days earlier)      last day (1375 days later) » 
00:00 - 16:0016:00 - 00:00

4:00 PM
@Crell My core point is: an enum value should not BE a non-unique value. It should compare to true with nothing but itself. You may possibly attach values to it (or not).
 
One of the challenges we're going to face is that others here have said the exact opposite: That they want them to have primitive equivalents.
(I'd lean toward that not being the case, but I won't die on that hill.)
 
Yeah, and that's a mistake in my experience … you do reuse primitive values sometimes (e.g. if you are storing as a "compact" integer…)
 
pretty sure I'm with Bweobi on that bit. Do those people actually want them have primitive equivalents or just be convertible to equivalent?
 
but an enum should be unique - and that uniqueness shall be defined by its name
 
I have to keep thinking about enums as days in the week as a reference point...
 
4:04 PM
@Tiffany Which is an excellent example as to why not make it equivalent to a primitive integer … does the week start on sunday or monday?
 
enums are a thing that I don't fully understand yet, so I have to keep reminding myself a comparison
 
OK, so what about this:

enum Suit {
case Hearts = new class {};
case Diamonds = new class {};
case Clubs = new SuitClubs(); // External custom
case Spades = new class ($val) { ... } // Internal custom
}


Where the empty anon class is implicit if not specified. So every enum option must be an object, but they're implicitly a null object if not specified (which is the common case).
 
are the objects mutable?
 
I think if I was using enums 99% of them would be integers as they relate directly to DB fields.
 
For me, they are a short hand of declaring value objects. which are not mutable.
 
4:05 PM
@Danack Nice! Sounds fab, would love to watch 😃
 
@NikiC Sorry for the extremely late feedback. I think named args would mostly be useful for skipping args with default values. Has it been discussed to limit it's applicability to args with default values to mitigate the BC concerns? I can understand the resistance from library maintainers. Just an idea off the top of my head, might not actually work.
 
@Tiffany They shouldn't be, but I don't know how we can force that and have extensible ADTs at the same time.
 
@Crell I think every enum should be instanceof its container
 
@Tiffany No the enum objects will be immutable.
 
@bwoebi I agree. I'm thinking implicitly new class extends Suit {}. I'm not quite sure how we'd enforce that for an externalized custom class.
@IluTov Let me know if any of this sounds bonkers. :-)
But the more we talk, the more I'm starting to like it.
 
4:09 PM
@Crell I don't see the point of external classes
 
Some of the posts I've seen around Java enums proposed pushing the body out to an external class to keep the code smaller, but since it's not natively supported it gets wonky in Java. Also, a few people here (I forget who) really hated the idea of classes within enums for code length reasons.
 
@Crell I don't care for re-using __toString there, but yeah, some kind of method like that +1
 
Whether code length is going to be an issue in practice, I don't know.
@ircmaxell What else would you suggest for it, if not that?
 
@Crell I think we'd likely lose a vote for the extension RFC unless we also include an \Ext with it
 
@Crell An extra method named name()
 
4:11 PM
What would you think to including it?
 
@MarkR I don't know how just adding Ext solves the problem. As I noted in my reply, code still moves from core to extensions and back, too. And then it doesn't differentiate between core and PECL, so PECL can conflict with Core.
 
@Crell Other languages make it explicit and enforced (if we were to choose the sealed class approach). Sealed classes would be fine with me, my main concern here is still no possibility for autoloading...
 
How would this break autoloading?
You make enums an other autoloadable thing, like classes and interfaces and traits. Then if we end up supporting externalized classes, well, it's a class. wipes hands
 
@Crell The problem is that form the call-side you can't see that it's an enum.
 
@Crell We keep \PHP for engine level features (inc iterators etc), and \Ext (not \php\ext) for extensions and use the registry and allow any established PECL project to reserve an \Ext
 
4:13 PM
Suit::Hearts - OK...?

I don't think any other language makes it look different from a static property either.
 
@IluTov why would that be a problem?
 
With any syntax. Option::Some($x) could be a method, Option\Some($x) could be a function.
Actually, the former syntax wouldn't even work as then you'd lose the ability to type hint the sub-class directly. So the latter is the only logical option.
 
Wha?
I don't follow.
 
@Danack Because with Option\Some the autoloader wouldn't know what file to look in.
@Crell With sealed classes each sub-class is just a normal class. So you can type hint a param as Option\Some.
This can be useful if certain methods are only available in certain subclasses.
 
Option::Some refers to the child property of Option, which is defined in Option.php. If Some is an instance of a named class, then on first use you hit that and the autoloader triggers a second time.
And there's another good use for an externalized class.
(Although methods available only in certain subclasses I don't think I like.)
 
4:19 PM
@Crell Well, if we were to disallow that sealed classes wouldn't be the right approach IMO.
 
Disallow which? I'm very confused now.
 
> (Although methods available only in certain subclasses I don't think I like.)
I guess the main point of sealed classes is that each "case" is completely independent and can define individual properties/methods.
Then, instead of special matching syntax you'd just check if a value is a specific subclass of the sealed class. And then you can do whatever you want with it.
sealed class Option {
    class Some extends Option {
        public function __construct(
            public $value
        ) {}
    }
    class None extends Option {}
}

$option = new Option\Some(42);

if ($option instanceof Option\Some) {
    var_dump($option->value);
}
 
gist.github.com/Crell/1e8decec66e2200a6a91eb69e9d7f831 - What I'm suggesting is that these are equivalent, except the second could also be type hinted if you were so inclined.
 
What I haven't completely thought through, does None (or any case without associated values or properties in this case) have to be a singleton?
 
I would think yes.
1) Saves memory.
2) === then works.
 
4:26 PM
To me, this approach seems quite verbose. I'd prefer a simple, more restricted enum.
 
It degrades gracefully.
enum Suit { case Hearts; case Clubs; ... } is simply a short hand for the longer version.
And we could probably short-circuit the constructor as well.
(Note: I am speaking from a design perspective, I have no clue how hard this would be to implement so that may change things.)
 
I just don't see the point of allowing methods in cases just so that you can avoid a match in a global method.
Especially if you don't think that methods should be defined in only some cases.
 
"don't see the point of allowing methods in cases" wha?
We want instances to be able to have methods, don't we?
 
@Crell Sure, but you said that there shouldn't be methods that are only available in certain sub-classes.
Which I generally agree with.
 
I am concerned about that mostly on traditional LSP-type grounds.
 
4:33 PM
@bwoebi / @crell that. something that is a bit more explicit about what it's doing and allows serializing to other than just strings (perhaps an int, or an object for some use-cases). Also the inverse would be handy (from)
 
What I meant was in cases instead of the enum as a whole to make it available for to every case.
 
But if we end up with an approach that does everything we want except enforce that, eh, I'll accept that.
@ircmaxell Which "that" do you mean? We've said a lot of things. :-)
 
@Crell the reply from @bwoebi saying name() or something like that
 
Ah
@IluTov So, I think I need a new table of capabilities we want/don't want/would like. :-)
 
@Crell I didn't even see your initial message :) The main problem I see here is that those look like values, but Beep isn't actually a value, it's a class. So cases with associated values can have many instances.
 
4:39 PM
Because this has a very different set of tradeoffs than what is in the writeup right now.
Ha!
A valid point. I knew there was a part I wasn't fully thinking through...
Which... I think unravels the rest of the concept. Damn.
 
will enums be namespaced?
(not sure if that's a dumb question)
 
I presume so.
(Not a dumb question at all, since they certainly could be implemented non-namespaced.)
@MarkR So following up... \Ext would mix PECL and bundled, and still has an issue when moving between core and bundled extension, as does happen. So it doesn't fully solve the problem, and creates a potential for collissions if someone in PECL yoinks a namespace that core could benefit from.
 
@Crell We would just leave it in \Ext if bundling it.
 
That makes user-space care about whether something is an extension or built-in for the first time. Eg, we'd all be using \Ext\Sodium rather than \PHP\Sodium.
Go ahead and toss the idea to the list if you want to see if Nikita bites. :-)
 
I think \Ext\Sodium is more likely to pass than \PHP\Sodium. Ultimately we're trying to solve the problem of an exploding number of classes in a language that has no structure for arranging them into a hierarchy.
 
4:56 PM
I am mostly OK with whatever is clear and passing. I'm just not sure that Ext solves the problem. But throw it out and see what happens.
 
\PHP\EXt\Sodium
 
Doesn't solve the problem of code moving PECL->Bundled, Bundled->PECL, Bundled->Core, or Core->Bundled.
 
There is no ideal solution to it short of a namespace level alias being added to the engine
 
That's basically the root question: All of those moves COULD happen, which are we OK with saying "gotta change your name" in the process. "None" is not really a viable option when also having a convention for namespaces.
 
5:20 PM
@Crell I'm not sure if this was thoroughly discussed but I really like @IMSoP idea that we should put engine features (i. e. ArrayAccess, Attribute) into the global namespace and PHP's standard implementations (i. e. <<Deprecated>>) into PHP\ namespace.
 
@moliata Have a look at the current RFC. That's largely what it says now, I think.
 
It is
 
Ah, I see, the first bullet point "The \PHP namespace is reserved for use by classes provided by PHP-SRC itself." confused me to thinking that everything within php-src should be in PHP\ namespace
Okay, found the Guidelines section, thanks. Now this proposal seems like a no brainer for me.
Anyways, is anyone working on Enums atm? I might take a shot and try to implement those myself.
 
@moliata Yes, kind of. @IluTov has been experimenting, and I traded him some R&D time for also working on partial function application. :-)
They're... tricky, it turns out, hence the need for serious up front design thinking.
 
Gotcha, I'll look into implementing other things from my TODO list then.
 
5:28 PM
github.com/Crell/enum-comparison - That's the current status of thinking, still subject to change.
What else is on your list? :-)
 
Besides enums, there are 3 things ;) Using statement, type aliasing and fixing callables
 
Do tell!
(I'm trying to stay on top of different lines of work to make sure they don't collide; my engine code skillz are still mediocre so informal coordination is as much as I can do right now.)
 
My engine skills are also "mediocre", soo...
Right now I'm experimenting with making callables consistent since (unpopular opinion) I actually love them
...and this as a result would also allow to declare typed callable properties
which due to my "OCD" :p is something I hate that you can't do - makes language inconsistent
 
What's your issue with them currently? I know someone was working on typed callables, and partial function application as @IluTov and I have been poking at would solve a lot of the syntax issues around specifying them.
 
cmb
@Derick want have! :)
 
5:34 PM
Callables have a problem with context "dependence", that problem is outlined very well in the typed properties RFC
 
Oh, that thing. What's your proposal?
 
Not sure yet, I'm experimenting with different solutions that Nikita outlined
I'm also trying to fix the issues outlined in Dan's consistent callables RFC
 
Gotcha, OK.
I just know of a lot of at least thinking if not patching around function/callable usage right now, so trying to avoid people bumping into each other.
 
just a passing note without fully reading the latest discussion on the topic: I will campaign hard against any implementation of enums where Day::MONDAY == Month::JANUARY has any chance of returning true
 
does that even work in any programming language?
 
5:43 PM
@IMSoP how would that happen?
or rather, how could that happen?
 
any language where enum is just a shim on top of a primitive type
 
aren't you comparing two objects i. e. Day instanceof Month?
 
That's what happens in C.
@IMSoP Have you thoughts on the proposal from my comparison document?
 
@moliata it should always return false, I think is the point
 
Yeah exactly, I thought that no language compared enums as primitives but as objects (Day instanceof Month)
 
5:45 PM
because months are distinct from days... sure, days are part of months, but they're distinct... it's like saying an apple is an orange
 
@Crell I'll have a look through; thanks mightily for putting it together, it's something I'd considered doing myself, but never made the time :)
 
In C, that's true. In languages with a Unit implementation, it's "d'fuq?"
 
@Tiffany it's not to do with months and days as such, it's just that some languages define Day::MONDAY as an alias for int(1)
 
I see
 
or give it an implicit cast, or magic value, or such
 
5:47 PM
anyways, even if we implement enums by PHP 8.1, I suppose we would be able to release them only in PHP 9.0
...due to BC break policy, right?
 
only if they need us to break something
 
@IMSoP I wasn't considering the implementation part of it because it's so far beyond me
 
Enum would become reserved
keyword
 
@moliata in case you didn't see, due to the current problems with callables, and how much BC break there would likely be in just fixing them, I think adding a new way of defining callables would be better, and then the current version could be dropped over time. And github.com/Danack/FunctionTypes/blob/master/… are my thoughts on the replacement equivalent.
though I don't care about the syntax that much all of:
typedef logger = callable(string $message): void;

type logger = callable(string $message): void;

callable logger(string $message): void;
could be used.
 
@Danack while typedefs to make sense, the problem comes with dynamic callbacks, for example
 
5:48 PM
it might be worth pre-reserving enum for 8.0, like we pre-reserved some type keywords in 7.0 when we weren't quite ready to implement them
could just be a soft reservation in the manual, or a deprecation on declaring a class with that name
 
$router->get('/user/{name}/post/{id}', [PostController::class, 'show']);
$router->get('/user/{name}', [UserController::class, 'show']);
 
although we'd have to decide in advance whether Vendor\Some\Enum would still be possible, which it currently isn't for string etc
 
let's say in an imaginary framework, we have something like this ^
 
@IMSoP Ilja already suggested reserving some words for 8 and was greeted with a giant shrug.
 
We can't create a typedef since the number of parameters is variable
 
5:50 PM
@Crell <unhappy face>
 
and thus for such cases, the only solution would be to use the callable type hint.
 
@moliata but unless those are static methods, they wouldn't be callables.
 
well, I was just using PostController::class as an example, we can use new PostController(), doesn't matter
 
I think the point is that the definition of function get($route, $handler) can't specify much about the type of $handler
 
the problem with dynamic callables is that we can't create a typedef
and thus we have to reside to using callable typehint
 
5:56 PM
the fundamental problem remains defining what "callable" actually means; the only values guaranteed to be callable in all contexts are Closure instances
at which point you don't need the pseudo-type, just mark the parameter as Closure, and the caller has to use Closure::fromCallable
 
@moliata Sorry, I don't understand the problem. yes, if the handlers require different parameters, that can not be defined as a type.
 
@NikiC Can you look at this one when you get a moment? github.com/php/php-src/pull/5836
 
@Crell Haha well put xD
 
@Danack so, adding types doesn't solve any of the consistency problems
because a) you can't always specify them; and b) types aren't the problem, visibility is
 
> Sorry, I don't understand the problem.
 
5:59 PM
Closure::fromCallable() is actually quite performance expensive. Anyways, in the future callable type should also be used to define first-class pass-by-function syntax i. e. instead of using call('my_func') we could do call(my_func)
 
I think we're talking past each other. and maybe trying to solve different things.
@moliata I think that's more referencing callables, than defining signatures of callables.
 
@moliata yeah, I was using it as short-hand for "whatever concise and efficient replacement for Closure::fromCallable we come up with"; the point being, it would be an actual type, not a pseudo-type that needs to make decisions about how to interpret a string
 
@Danack Yeah but I'm not trying to implement typedefs or first-class function-reference syntax for that matter :) but to fix consistency problems.
Generally, the easiest solution would be to simply wrap all callables internally via Closure::fromCallable() (Nikita's idea in the typed prop RFC, not mine ;))
 
yeah, that's basically the lines I'm thinking along
optimise the hell out of the implementation, but wrap the callable into something as soon as possible
 
I'd love a function signature type but I'd say 90% of my uses of callbacks would need to be generics based
 
6:11 PM
with proper closure wrapping, this kind of nonsense would be impossible: 3v4l.org/C7df2
 
Ah but Closure::fromCallable seems to be very expensive
Just did a little test and
 
4 mins ago, by IMSoP
optimise the hell out of the implementation, but wrap the callable into something as soon as possible
 
and if we try to pass a string to callable type hint
1 million times, it takes around
0.04s
if we wrap using Closure::fromCallable() every time, it takes 0.16s
 
the key point is not what the compiler does with the argument, it's that it does something other than asserting its current state
 
quite honestly, unsure how far we could optimize something
@IMSoP I'm not sure what you're referring to?
 
6:14 PM
struct callable { something* function_entry, zval* this_value }
 
@moliata .....you can just say 'type'. They aren't hints. (or at least shouldn't be).
 
in the example I posted above, the callable check should happen in the calling scope, so that $foo->secret has to be visible before the call to checkCallable
 
@moliata @IMSoP One of the benefits of the partial application RFC is that you can reference a function by partialing it: array_map(thing(?, ?), $arr);
 
@Crell what type would thing(?, ?) be? A closure?
@IMSoP well then we wouldn't even need to wrap callables using Closure::fromCallable() internally
I'll try to tinker with that, thanks
 
yeah, that's exactly the kind of thing I'm talking about: that would make the example $f = $foo->checkCallable($foo->secret(?)); which would fail, because $foo->secret isn't visible from the current scope
 
6:18 PM
It would produce a closure, yes. And you could also substitute in real values for any of the parameters.
 
@moliata yes, hence my comment earlier of "whatever we can replace Callable::fromClosure with"
what I care about is the result, not the mechanism - the result being a usable type signature which guarantees that something both is now, and will remain, callable
 
@Crell well at that point, we don't even need to fix consistency problems with callables? Since partial functions could be used as a substitute for 'function_name' and ['class_name', 'function_name']
 
Precisely. :-)
 
> ['class_name', 'function_name']
The only one that's left is how to reference instance methods of classes.
which is a useful thing for things like route config
 
The partial syntax becomes a nice short hand for fn($x) => foo($x, 5);, but ideally will automatically surface the types to the wrapping function so it is still type compatible.
 
6:22 PM
well I suppose partial funcs would also support (new TestObj())->partialFunc(?)
 
@Danack $foo->bar(?, 5, ?);
 
^
 
@moliata it will do that, but if you don't want to instantiate the objects there but actually want to pass the class name and method name to the router.
 
(Note: this is hypothetical. @IluTov was working on it but it's complicated. I don't want to speak on his behalf, just based on the RFC from @LeviMorrison that we were working from.)
 
but that might be yet another separate problem.
 
6:23 PM
@Danack For ['class to instantiate', 'method to call after instantiation'], that's already not a real callable so it's out of scope. The instantiation process could be complicated.
 
If we can take strings and arrays out the back and double-tap them when it comes to callables that will be a good day, even if it takes 5 years
 
@Danack well, then you could use array|Closure union type?
 
@moliata It has to capture the object, I'm pretty sure.
 
@LeviMorrison I'm not sure what you mean?
 
the only way I can think of to make that type-safe would be to make the instance a parameter rather than a $this context
 
6:27 PM
@Crell yes, out of scope for partials. as I said, it might be a separate problem, but I really would prefer being able to write [Foo::class, 'someMethod'] in a way that was ambiguously clear that it refers to the 'someMethod' instance method that can be called on instances of Foo, rather than it being an array of two strings.
 
Sure. But without knowledge of the constructor you can't really be complete there.
 
fn(ClassType $instance, string $foo, int $bar) => $instance->someMethod($foo, $bar)
@Danack that's not what [Foo::class, 'someMethod'] currently means; I can't think of any way of expressing that right now, other than just two variables and a manual is_a test when you eventually receive the instance
 
Just like a "service name, method name" tuple is not a language callable, and won't be, so out of scope.
 
I'm trying to think what that scenario would mean, in some theoretical pure OO sense; something like "when you later have an instance of class Foo, send it the message Foo$someMethod" maybe?
 
6:49 PM
Which?
I find it easier to think in functional terms these days. :-)
 
Dan's example of "call someMethod on an instance of Foo"
I guess it's a partially applied call to despatch(object, method, ...args)
despatch(? instanceof Foo, 'someMethod', ?)
but what is the type of 'someMethod', if you want to reference the definition, not the name?
instance_method<Foo> perhaps
despatch<T>(T, instance_method<T>, ...args)
$f = despatch<Foo>(?, Foo::someMethod, ?)
$f(new Foo, 42)
resulting in (new Foo)->someMethod(42)
I should probably go drink some more beer and eat some food :P
 
@Crell What is the question? ^^
 
Which question?
 
7:05 PM
@Crell In case you didn't know, you can click the arrow on the left to see which question somebody is responding to :)
> (Note: this is hypothetical. @IluTov was working on it but it's complicated. I don't want to speak on his behalf, ...)
 
Ahhh...
Just explaining how partial application solves 80% of "referring to callables" problems. :-)
Or will, assuming it can be made to work; since you're the one looking at code for it currently I didn't want to over-promise on your behalf is all. :-)
 
@Crell ah ok :)
 
I'm defining a schema in an array:

$schema = [
	'id',
	'name',
	'address' => [
		'street',
		'suite',
		'geo' => [
			'lat',
			'lng',
		],
	],
];

The problem is that "address" and "geo" are keys, while the "id", "name", "street", "suite", "lat" and "lng" are values, thus making it hard to iterate over this array.
I'm not sure if I should just add an empty string to all items that are not arrays (thus making everything a key), or try to process this in some way to do that automatically. I was wondering if someone has been through something similar?
 
7:22 PM
is there nothing you need to validate other than the presence of attributes?
e.g. required, type, etc?
 
I've thought about that. Sounds like a JSON Schema. The API that I'm consuming doesn't provide one, I was wondering if I should add that on the client...
 
@LucasBustamante Dear god please don't do that. :-)
 
Yeah, I didn't plan to
 
better than rolling your own validation system, IMHO
 
I mean the giant array with mixed structure. :-)
 
7:23 PM
@Derick enjoyed the video!
 
Just to give some more context, I'm trying to create a DTO out of a REST response that I'm consuming
 
Then make it a classed object. Arrays make terrible DTOs.
Or series of classed objects, potentially.
 
the idea of that is to abstract the REST response from my application by using a DTO... If the REST response change, I could potentially isolate this by changing only the DTO
I'm struggling to find a good way to do this.
 
If you're starting with JSON data, why not just use json_decode() and take whatever it gives you? If you want more than that, use real classes.
 
public static function fromJson($json) { $inst=new self; $data=json_decode($json, true); $inst->id = $data['id']; $inst->address=new Address($data['address']['street'], // ... and so on
 
7:27 PM
That.
 
if you want it to fail hard if the server changes its schema, then you need a full validator that can check types, optionals, etc
either something like Symfony validator, which is basically a really elaborate version of what you started with, but at least you're not inventing it from scratch; or something like JSON Schema as you say
both are kind of long-winded because they're trying to express the schema inside another language (PHP or JSON); is there anything like RelaxNG's compact syntax for JSON?
 
Thanks. That gave me some directions... I think I'll do something less automated, more verbose, and more explicit
Kinda like this: 3v4l.org/cpWcq
I don't care about the values, just the schema
 
@NikiC
./configure --enable-debug CC=clang CFLAGS="-march=native -fsanitize=address -fno-omit-frame-pointer"
ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ./sapi/cli/php Zend/tests/match/037.phpt
That should report the error, right? Runs normally for me.
 
@IluTov In this particular case it'd be -fsanitize=memory, but it's much easier to just run under valgrind for individual tests
 
7:57 PM
@NikiC Still nothing ^^ I'll use valgrind instead.
 
@IluTov Ah, you need USE_ZEND_ALLOC=0
for all of them (memory/address/valgrind)
 
@NikiC Damn, 5 seconds after I ran distclean in the docker container that takes like 15 minutes to build xD
 
@IluTov óÒ 15 minutes to build
What kind of machine is that?
 
@NikiC Docker on Mac with volumes ¯\_(ツ)_/¯
the configure is almost longer than the compiling itself (I'm guessing because there are so many filesystem reads)
Also, maybe I have slightly exaggerated :P
 
Does Docker on Mac still have terribad disk performance?
 
8:08 PM
And I'm only using Docker because valgrind doesn't work on mac, and neither does clangs memory sanitizer apparently...
 
@IluTov On linux running configure takes 20 seconds...
 
@NikiC On Mac too, just not in a docker container
at least not when you have the entire php-src directory mounted
 
I'll probably never understand why programmers ever use Macs
 
@MarkR Yep :'( It also has other issues, my CPU still goes to 100% randomly sometimes.
@NikiC I've thought about switching to Linux but let's be real, it sucks just as much.
and let's not even talk about windows.
 
@IluTov I managed to set up valgrind on mac a few weeks ago :D It was quite a struggle
 
8:10 PM
Windows supremacy \o/
 
@IluTov Linux is pretty good for developer systems
The only thing I'm aware of that sucks on Linux is HiDPI support ... That's the one thing one has to work around.
 
@NikiC Because my company gave it, so I gave my windows laptop to my parents :D
but for me, ubuntu was a nightmare when I used it for 2 years around 2012
 
@MátéKocsis Did you use a fork? Or did they actually fix it? :O
 
I've been on Kubuntu exclusively for years.
It's usually good. :-)
 
Last time I checked there was a fork but that one didn't work for me.
 
8:13 PM
I wish Ubuntu would fine one way of setting up its networking and stick with it :|
 
@MarkR Use systemd-networkd and don't care about the fancy other things
 
And on a Mac you have both good software and terminal support. My biggest pain point with Ubuntu was that neither of my programs worked as smoothly as on Windows. At least this is what I feel
 
Also just bought drum software that only runs on mac and windows :(
 
I use Windows 10 Pro on my main PC and laptop, I have Ubuntu installed on ESXI as a server... I'd be happy to run Linux for my dev machine so I could run docker without the hassle but without things like Adobe suite etc going full linux is a non-starter for me
 
For the MongoDB manager it appears the only way to grab the URI after it is instantiated is to var_dump it and grab ['uri']?
/cc @Derick
 
8:19 PM
@IluTov ahh sorry, it was gdb :D There was a kilometres of long tutorial how to codesign it :D
 
9:14 PM
@Girgias Hi, sorry I was late on closing the RFC, sad about the turn out but it was interesting to see people come out from the grave to vote against it, like Andi
 
Dare say a lot of votes would go different if people who have been long-since gone from the project couldn't vote
 
@Kalle I completly forgot about it lol
But yeah that was suprising
 
9:38 PM
@Kalle aww
 
something something, get rid of the old people.
/not quite ready to get on the cart.
 
might be a dumb question, how do I change my avatar in people.php.net?
 
@IMSoP, @Crell, @Tiffany This is what I ended up with, regarding the DTO... Open to feedback, thanks. 3v4l.org/fBTVR
 
nevermind, I figured it out
 
9:47 PM
@LucasBustamante I'd probably go with true rather than '' for "required and don't care what else"
but I still find it odd that you care about the existence of a value and not its type
receiving 'id' => 'a2aa06d9-b3b6-4f8c-a450-a5a37f401ff4' when you're expecting id' => 42 is just as likely to break your code as not receiving id at all
 
It can only be scalar or an array of scalars
yeah, I should probably cast that ID to string instead of int...
 
the only way to add an avatar is by using gravatar, which requires signing up for Wordpress and paying for either a domain or a paid plan that uses my domain... am I missing something?
 
@Tiffany try wordpress.ORG
 
@LucasBustamante I mean more fundamental than that... 3v4l.org/3PtLW
 
profiles.wordpress.org/wordpressdotorg there's a register button there.
 
9:54 PM
I would at the very least define the schema as 'id' => 'int', 'name' => 'string', etc
and treat validation as a separate concern from the DTO
 
@LucasBustamante I was able to do it by going back to the gravatar homepage and logging in, I didn't have to finish the steps to register my account
 
\o/ yay for the meetup plan on 1st
 
@IMSoP I was avoiding having something like a JSON schema on the client-side... But indeed, I think it makes sense to define the types and whether they are required or not...
 
I think either you validate or you don't
if you just want a DTO, don't write a schema validator
if you want a schema validator, probably still don't write one, because people have written it for you
 
@Danack get off our lawns? :P
 
10:08 PM
@IMSoP To be fair, if you consider the array will be coming from JSON, it seems to be working nicely: 3v4l.org/cXIQ2
 
for what it's worth, this is closer to how I'd write it: 3v4l.org/b8nFS
 
Except for booleans...
 
@LucasBustamante how is that "working nicely"? how are you going to plot "https:\/\/3v4l.org, loooong" on a map?
you're no better off than if you'd done no validation at all
 
I'm not sure if I follow you. Getting Lat/Lng: 3v4l.org/HvnSD
 
but what are you going to do with those values?
how is "looooong" acceptable, but null not?
the point of a DTO is that the calling code can rely on some contract
if that contract is nothing more than "these fields won't be null", it's not adding much value
at that point, just ditch the validation and make it a dumb data object: 3v4l.org/dcMeV
if a field is missing, it will come out as '' or 0; but that's already true if you haven't validated the type
 
10:28 PM
I value your feedback, but I'm still not convinced either way. I have to leave now, but I'll get back to this later, thank you.
@IMSoP /\
 
no worries, and it is of course just one person's opinion
but "what contract is this class/module promising to others?" is often a useful question to ask yourself when architecting
 
11:04 PM
Segfault when trying to access non-existing variable ・ Reproducible crash ・ #79828
 
11:18 PM
@LeviMorrison Sorry, I don't remember - but, reach out to them and I'm sure they'll add some stuff to make it easier.
 
00:00 - 16:0016:00 - 00:00

« first day (3555 days earlier)      last day (1375 days later) »