« first day (1624 days earlier)      last day (3307 days later) » 
00:00 - 22:0022:00 - 00:00

10:00 PM
Though it did push me to #2 all time in the tag.
Past rook. And less than 1k behind #1
 
10:12 PM
@ircmaxell uh. #1 is a lucky shot (3 answers in security, 1 with 3651 upvotes), rook is the long-con... far longer than you. 800 answers vs your 100. You're a half-lucky one :P
 
Hey Florian buddy
Correct me if I am wrong, but you are working with domain driven design right?
 
you're wrong
sorry :)
 
oh, ok
I am asking because I remember you gave me a github link to a PHP module for processing Currency which was more or less using practices from DDD
so I guessed you are knowledgeable in the area, but I guess you apply strategies from PoEAA
 
@ziGi PoEAA?
 
Patterns of Enterprice Application Architecture
 
10:23 PM
ah, nope
I just apply SoC
 
Yes but you know what a Value Object is
 
and Value Objects is a term which is part of DDD
Entity as well
domain objects and data mappers
all those things are
 
I see
then yes, you can say I'm working with domain driven design
 
I did not know either, however I started learning how to work with it recently
because the application I am working on is DB oriented which is really bad as you can imagine
it's created 4 years ago but it uses practices which were used 10 years ago
 
10:26 PM
@ziGi not necessarily
 
Well I think it is because if we want to change the data source it's virtually impossible without refactoring ~60% of the app
But I agree SoC is quite important
I did some refactoring of some stupid god classes
and I was able reduce the parsing time of the data with around 60-70%
 
performance is often not gained by adding readability though
 
just because the guy who coded the thing decided that it would be a good idea to keep the raw database data together with the parsing functions, the processed data and the array with the parsing instructions in a single class
@FlorianMargaine oh, you are quite right there
 
I wish we could write something like if (isset($var = $array['var'])) { ... }
 
but imagine now a class of around 2000 lines of code instantiated for each retrieved DB record
@bwoebi that looks a bit C\C++ style
 
10:31 PM
@ziGi C style? oO
 
@bwoebi I guess he's never used if ($foo = bar()) {} in php
 
Anonymous
ping
 
well at least the assigning part inside an if statement
 
although I use if (($foo = bar())) {}... C habit
 
ok you are right
I have never used it in PHP
but that's because I don't like it as a coding style in general
 
10:33 PM
@FlorianMargaine I hate that… I'm just writing it because compiler and don't disable it because it makes some sense…
 
@bwoebi what is the big deal, you can always say $var = $array['var'] in the beginning of the if block {..}
 
@bwoebi I don't have an opinion on it... and since it makes sense, I use it in php too
 
@ziGi I dislike being redundant…
 
in js I don't though, I usually use the word var too, so it's not necessary to disambiguate it
 
@bwoebi what's redundant about it?
in the first case you say, does that exist
in the second case you assign it
 
10:36 PM
@ziGi if (isset($array['foo']->bar->baz)) { $var = $array['foo']->bar->baz; }
 
he does a property fetch twice when he could do it only once
 
I need to copy the whole fetch.
 
@bwoebi not a solution to the issue in general, but maybe for some specific cases: 3v4l.org/ISgHJ
 
Eiiih… does ?? do a write fetch? oO
 
wait...
 
10:40 PM
Oh, it really does an isset() fetch
 
works as expected (imo), got unsure there for a moment.
 
Yes, works as expected. I just didn't remember that it did an isset fetch and not a read fetch
 
@JoeWatkins will the Exception you pass to the new assert() be instantiated/evaluated even if the assertion succeeded?
 
... why the hell is ?? lower precedence than boolean operators…
 
@bwoebi that's the whole point of the operator btw :P
 
10:44 PM
custom exceptions are a horrible idea…
@FlorianMargaine it makes no sense.
 
@Worf No, because you can't pass exceptions to assert
 
?? only compares against null
 
It's in the proposal, but it wasn't implemented ;)
 
@NikiC it was implemented.
see e.g. /Zend/tests/assert/expect_007.phpt
 
@bwoebi it's also called "isset_ternary", or ifsetor
 
10:46 PM
and boolean ops return a boolean.
 
@bwoebi really? I thought joe said on list that it wasn't
 
@NikiC aaaaah ok thanks!
 
@bwoebi 3v4l.org/FpQeC I hope you can sleep well tonight :D
 
@ziGi this hack (using a reference) is exactly why the ?? operator was added
 
> Because of this, we are not going to merge with custom exceptions
enabled, they should not be crippling, another RFC will have to be written
to deal with custom exceptions if that's something we want moving forward.
 
10:47 PM
@NikiC yeah, I'm a bit disappointed :x
 
Was it added back after the fact or was that mail just wrong?
 
I have no idea.
 
@FlorianMargaine interesting, it's a bit similar to the || in JS
 
@NikiC this text is not in the rfc page wiki.php.net/rfc/expectations
 
what? no
 
10:50 PM
@FlorianMargaine well that's nice but it's not working for 5.4 and 5.5
 
@ziGi did you read the link?
 
if ($var = condition() || $fetch['key'] ?? false) what does that evaluate to? Well… to a non-sensical if ($var = (condition() || $fetch['key']) ?? false) … That makes absolutely no sense. Especially as boolean ops never return null.
 
@Worf @bwoebi pointed out that it was implemented, despite the annoucement to the contrary
And to answer your original question, yes, the exception will be instantiated even if the assertion doesn't fail
 
@FlorianMargaine yes I did
@FlorianMargaine in JS var foo = bar || 1;
 
but actually it's not needed @NikiC - also, in another rfc i've read you intended to introduce a new base exception class, i'd make AssertionException extending that rather than ErrorException, because i'm pretty sure people use to catch(ErrorException) even if they shouldn't (accordingly to the expectations rfc)
 
10:54 PM
So I think it's pretty similar to the JS || in that sense
 
@Worf Yes, it was discussed but we delayed the decision on that until base exception is in ... guess this should be brought up again
 
nvm, did not understand. ok! you guys are doing a great job
 
Isn't this a Short-circuit evaluation
 
i couldn't have ever imagined such amount of awesomeness in one single hit
 
11:16 PM
what are you talking about?
 
11:29 PM
that is so cool
 
00:00 - 22:0022:00 - 00:00

« first day (1624 days earlier)      last day (3307 days later) »