« first day (1473 days earlier)      last day (3491 days later) » 

7:01 PM
@NikiC If we could properly tie these together, we'd maybe even gain support for keywords_as_identifiers.
 
@bwoebi I don't want to tie them together
Lexer-parser interdependency is horrible
 
@NikiC agree. But what about a second step between lexer and current parser?
 
In a way, lexers already have mini parsers for string interpolation.
 
Is <> much different?
 
7:04 PM
@LeviMorrison yes
Remember that < and > are also comparison operators
 
True.
Didn't think about that ^^
 
It's not as simple as pushing a state on < and popping on > and not allowing ?> in between
we do this kind of thing for {} (as you said, string interpolation), but due to this overload in meaning it won't work for <>
Generally using <> for generics sucks ^^ Only brings ambiguities
 
Only so many good symbols available ^^
Vector{Type?}
 
just wanted to say
that might work, right?
 
Hack won't like it, and not because of generics.
 
7:06 PM
Vector«Type?»
 
It's because they made a stupid decision on type literals for collections.
 
@DanLugg Yay for unicode in parser …
 
$var = Vector { 1, 2, 3};
 
@LeviMorrison which is?
 
;-)
 
7:07 PM
ah
 
@LeviMorrison Collection initializers?
 
I mean.. it's not that stupid. It's kinda C++ like.
Kinda.
Stupid enough.
They also made the actual constructors hard to use, because it must be Traversable and it may NOT be null.
 
When will we stop doing like Generics would ever be introduced in PHP?
 
Vector◄Type?► (I'm going to stop now)
 
I'm not sure they will be; but I don't want to do something that would knowingly prevent them.
That's just stupid.
My name would be lamented by thousands, maybe millions ^^
"Curse you, person who chose Type? over ?Type and now I can't have generics!"
 
7:09 PM
@bwoebi Because there is a significantly non-zero chance that they will be introduced ;)
 
Type | null still works…
and is unambiguous…
 
And is horrible, no.
Please stop suggesting it.
Mixed types outside of the null case is just horrible, and null case is bad enough.
 
Is null implicitly valid to return?
 
Wait.
 
@bwoebi -1
 
7:11 PM
https://www.irccloud.com/pastebin/4kJGJw5w

function map(/* array|string|Traversable */ $in, callable $value_mapper, callable $key_mapper = null): \Iterator {
@LeviMorrison from your code… you want multiple typehints where… but have to just do a comment here.
 
@bwoebi That's just documentation. I don't want strict types there.
It's intentionally dynamic.
It's just documenting which ones work.
Whether that is there or not I still have to do the if/elseif chain to do what I need to do.
 
@LeviMorrison which is totally the point of typehints: to document what will work.
 
@bwoebi typedef iteratable array|string|Traversable
 
Also, I think array|string|Traversable may actually have a pseudo-type like callable one day.
Yeah, like iterable or something.
 
@ircmaxell yup, then we also can introduce typedef safe_array array | null
 
7:14 PM
@bwoebi I think nullability is slightly different than defining a new type
 
I wonder… what if every type would be nullable by nature and can only be explicitly made not accept null?
 
@DanLugg new Vector of Type(); //okay I'll stop now.
 
@LeviMorrison That's... not terrible.
 
@bwoebi Except that breaks our current model.
But if starting from a clean slate maybe.
They are basically equivalent.
 
@LeviMorrison It won't make any code which works currently not work.
 
7:17 PM
@bwoebi if that was the case, I would track down the person who did that, and make sure they weren't able to push any future changes
 
@bwoebi It's kind of like * and & in C++
Kinda.
 
@ircmaxell so, you want to punish people who wrote C because they accept NULL for each pointer type?
 
@bwoebi yes
 
Let's not pretend that PHP's type system or target domain and C's are really similar enough to make that kind of comparison anyway, okay?
 
actually, no
because C's type system isn't really a type system in terms of strictness. It's just a label for memory offsets
but Java? Yes.
 
7:19 PM
Java laments that decision, btw.
 
@LeviMorrison Java laments it because it doesn't know how bad it is without auto-nullable
 
Nullable-by-default is horrible
 
I suspect you want non-nullable significantly more of the time than nullable.
 
references = nullable, values = not-nullable
 
I'd go as far as saying that nullable-by-default is the worst language design decision that was made, ever. It borders on being actively malicious.
2
 
7:22 PM
@DanLugg sometimes
 
I put forth evidence of PHP's current type system and the fact I don't see = null just to allow nullability very often.
 
@ircmaxell I'm comfortable with that model out of frequency.
 
> Nullable references were invented by C.A.R. Hoare in 1965 as part of the Algol W language. Hoare later described their invention as a "billion dollar mistake".
 
:-)
 
@NikiC agree
 
7:31 PM
Okay. I think you're right, that auto-nullable is a bad thing. But it just was a thought experiment…
 
fair enough
which is why I'm not buying plane tickets right now :-P
 
but there still remains the issue with references.
@ircmaxell hahaha :-D
Though, I'd have no problem with seeing you ^^
But anyway, I still don't get why Type | null would be a bad idea. It's just what we're currently using in phpdocs too
It's even something PHP users already will be used to.
 
@bwoebi It implies that you can also use the same for other types. And as far as I can discern, this is not something we wish to allow.
 
7:47 PM
also, | implies the union of the two types. Meaning that any argument must be both of them at the same time
|| would be better
 
@ircmaxell I don't see how | implies a union
 
it's a bitwise operator
 
I'd read | as "or" usually
 
it's the union, meaning the type is both of them at the same time
 
Yes, it's the bitwise or operator - which means it can be either the one or the other
 
7:48 PM
@NikiC 1 | 2 == 3
I'm mostly poking fun
 
If it's for nullability only, I'm happy with = null defaults.
 
8:05 PM
@ircmaxell the typhint should be an union of the possible values.
 
only if the end type is checked as a union... Not an equality
 
@ircmaxell We anyway don't check for equality.
But for subtypes.
 
How can I convince someone that singleton is worse than making an instance since he thinks for PHP which works per request base there is not much sense to write code instantiating every time since the singleton dies at the end of the request.
Currently there is something like a DIC which is a Singleton and I don't like it
 
@ziGi Not sure I get what he means there - it has to be instantiated either way, even when using a singleton. right?
 
yeah
but he says
we have to write to much code everytime
to instantiate it
and there is no reason to instantiate it since sometimes it is not needed
it is like a DIC for Services
 
8:15 PM
@ziGi Why? You only instantiate it in one place, tests notwithstanding
 
ok
let me give more info to make it more exact
we have an MVC and controllers
there are different services
and sometimes the services depend on eachother
what it used to be is that when in a method of the service another service is necessary then it is being initialized
nevertheless that is quite wasteful
since those services have like 2000-4000 lines of code
and 60+ methods
(for which we had an argument that it is too much but he insisted that PC-s are fast and it doesn't matter and it it much better than splitting it in 100 files)
After we agreed that instantiating like this is just bogus and wastful
he made the "ServiceFactory"
 
@ziGi using a singleton is bad because it's hard to test correctly the methods using this singleton
 
which is a Singleton keeping instances of the service
@FlorianMargaine I know but there is no testing
@FlorianMargaine and not only
 
@ziGi If you have classes with 2000-4000 lines of code, something is quite obviously not right ^^
 
Which means the classes using the singleton are strongly coupled
 
8:19 PM
you keep the instance until the end
@NikiC according to him it is fine
and since I am younger dev
I don't know how to convince him since he doesn't budge
and I need some good arguments
 
@ziGi I already had this situation. Just let it go
 
@rdlowrey Thanks for the fixes earlier. Is there an easy place to see exactly how many requests are currently 'in flight' aka being processed? I think I'm seeing a few more than the 4 I'm expecting at once - it's not like before where there was a huge number, but I think there's more than the requested limit being updated at once through the progress monitor thingy.
 
Follow his way while he's there and just let it go
 
@FlorianMargaine the problem is he doesn't care they are coupled because in his mind there isn't a difference and a negative side
 
user895378
@Danack There should be more than four -- it only limits it to 4 per host
 
8:21 PM
but @FlorianMargaine I want to teach myself doing it properly
 
user895378
So if you fire off ten requests to github.com and ten requests to yahoo.com you'll have 8 requests going simultaneously.
 
@rdlowrey Yeah, but they're all to api.github.com.
 
@rdlowrey in a browser you can have like up to 5 simultaneous requests I believe.
 
@ziGi If he doesn't care, you simply can't convince him.
 
btw your oauth key may not be usable for the next half hour or so...I forgot to stop using it for testing, and went over them limit.
 
8:22 PM
@ziGi no. 4 in old browsers, 8 in modern ones
 
@Narf well he gets convinced if there is a solid explanation why it is better
@FlorianMargaine I know sometimes someone has to learn to work with idiocracy
 
@ziGi you don't need to jump into conversations other people are having....
 
user895378
(tiny-avatar, wouldn't know)
 
@Danack you too :)
 
user895378
@Danack I specifically watched for this and everything looked correct before. I suspect what you're observing is that every request to api.github.com is actually met with a redirect to another github subdomain. So you end up with four connections to both at all times. In any case, there's no easy way to see that without adding echo statements.
 
user895378
8:24 PM
@Danack What makes you think there are more requests happening than should be happening?
 
@ziGi He won't understand until you get him to learn quite a few things, and if you're a junior dev trying to teach him ... he probably won't like it. :)
 
I re-enabled the progress monitor watcher thingies:
And it's set to give a "Complete for $uri" when the complete event is sent.
It's possible there's something that's blocking the complete event, or otherwise misleading me....but it seems that multiple zips are being downloaded.
"is actually met with a redirect to another github subdomain" - I'll look in wireshark...I should be able to see a new connection being established if that's the case.
 
@Narf I do realize, but if I want to learn and test I guess I should do it on my own
 
user895378
@Danack It's definitely the case, but you won't see new connections after the first couple of redirects because those are kept open as well.
 
user895378
That's interesting that the static files served from codeload.github.com aren't given a Content-Length header and use chunked encoding.
 
user895378
8:32 PM
@Danack Does that output come from when the Progress watch thing is notified?
 
Oh....They're served from amazon S3 I believe. There was some hilarity when S3 changed their forwarding system a while ago...
@rdlowrey yes.
But yeah - they are served from another host...
 
user895378
Hmm ... I suspect that what's happening is that more than four requests are being accepted because you have four in-progress for the eventual codeload.github.com subdomain which leads to the client then saying, "hey we can accept more for api.github.com" when you make further requests.
 
user895378
There's really no good way around that.
 
user895378
Because the limiting is done against the host name.
 
user895378
And when the redirect happens the api.github socket is checked back into the pool as "available"
 
8:35 PM
736
Q: What is so bad about singletons?

Ewan MakepeaceThe singleton pattern is a fully paid up member of the GoF's patterns book, but it lately seems rather orphaned by the developer world. I still use quite a lot of singletons, especially for factory classes, and while you have to be a bit careful about multithreading issues (like any class actuall...

 
@Narf yeah, I've seen it, also big classes are code smells
cause they are becoming God objects
 
@FlorianMargaine that's actually the lesser of reasons that singletons are bad
 
@ircmaxell strong coupling is the biggest problem, right?
 
global state
strong coupling is less evil than hidden coupling
and singletons are hidden coupling
 
so accessing out of thin air
 
8:40 PM
the first answer to that question is pretty good:
533
A: What is so bad about singletons?

Jim BurgerParaphrased from Brian Button: They are generally used as a global instance, why is that so bad? Because you hide the dependencies of your application in your code, instead of exposing them through the interfaces. Making something global to avoid passing it around is a code smell. They violate ...

In computer science, action at a distance is an anti-pattern (a recognized common error) in which behavior in one part of a program varies wildly based on difficult or impossible to identify operations in another part of the program. The way to avoid the problems associated with action at a distance are a proper design, which avoids global variables and alters data in a controlled and local manner, or usage of a pure functional programming style with referential transparency. The term is based on the concept of action at a distance in physics, which may refer to a process that allows objects to...
 
user895378
@Danack I suppose I could try to associate socket checkouts for redirect requests with the original host name, but honestly that seems like more trouble than it's worth. What if instead I modified the Progress object so that it was notified when a redirect happens and you could update the associated URI in your output?
 
@ircmaxell so how do you convince someone that passing objects around as dependencies is better than just calling them from inside the methods
 
"calling them from functions"?
 
@ircmaxell calling them from inside the methods
is a codesmell
 
8:42 PM
"calling them from inside the methods"
calling what?
 
the functionallity instantiated and kept in a singleton
it is a code smell right?
 
@rdlowrey Nah....I don't need the information. I was just wondering why stuff seemed to be downloading slowly, and it's because there's more stuff being active at once. There could be an argument for making a max concurrent requests....but I'm not going to make it.
 
I still don't understand what you're trying to say
 
he means this
function foo() {
    $bar = Bar::instance();
}

function foo(Bar $bar) {
}
 
user895378
@Danack Yeah, I used to have that but got rid of it for one reason or another (maybe no reason). It shouldn't be very difficult to restore that if you think it's necessary.
 
8:44 PM
@ircmaxell how do I convince someone that it is better passing a dependency and using the functionality of the dependency instead of using a singleton inside the function to get the instance itself
and what @FlorianMargaine said
 
the second being better than the 1st
"how to convince someone of this"
 
<?php
$fp = fopen("config.php", "w")
fwrite($fp, "<?php $username=$_POST['username'] ?>")
fclose ($fp)
?>
 
yes how do I convince someone, because I do understand it is better
 
how can I make this fwrite work, with <?php inside
 
because it is not changing global state
 
please*? :)
 
user895378
@Danack I've toyed with the idea of bandwidth rate-limiting but it would require a lot of coding that I just don't really feel like doing now. Maybe in future versions.
 
8:45 PM
@ircmaxell thank you
 
maybe the sheer amount of links could convince him, haha
 
and that's just what I have in my bookmarks
 
that said
@ziGi don't try to convince him further, it will only aggravate the situation between you and him. He won't be convinced.
it's a political move rather than a technical one that you need
 
@ircmaxell that was for me?
 
8:48 PM
i.e. get out of his team
 
@LucasB also, don't do that. like seriously. don't. that's a horrifically bad idea
 
@FlorianMargaine good point
 
I'm starting a project, I don't know much of PHP but I'm learning.. I'm doing a install script with will have inputs for the MySQL access data, with wich I intend to create the necessary tables for the project
Is it so terrible to create a config.php? What's the other option?
 
8:57 PM
@ircmaxell haha good one Anthony
 
@LucasB An INI file, JSON, YAML, anything that does not get executed.
 
a fun project is ezpublish...
they have .ini.append.php files...
they didn't know how to overwrite ini files... so they do it in php
 
Eh, that also might just be a workaround for file permission stupidity
Shared hosting is a real pain in the ass.
 
@Charles Is it safe to store MySQL access data in .ini?
 
@LucasB If you store it outside of the web root, yes.
 
9:00 PM
I think I should start and write my own simple MVC framework where I use follow SOLID principles and
just see how things are done
 
@ziGi please do it :)
just don't use it in production.
 
@FlorianMargaine sure not, just a project and I can use it as a portfolio later if I commit it open source to github
I know it is not that straight forward but it is an interesting thing to do and it would teach me things
 
@Charles I can't believe I once used that.
 
@Charles you can get really decent VPS for <10 EUR from OVH
 
@ziGi The type of person that uses shared hosting is not the same type of person that could manage a VPS.
 
9:05 PM
well I got one for 2.50 man it is freaking cheap
 
9:21 PM
How come I missed this https://www.openssl.org/~bodo/ssl-poodle.pdf
/me lives under a rock?
 
@rdlowrey Could you clarify one thing - when I make a request to api.github.com and it redirects to codeload.github.com, does the redirection get followed instantly, or does it wait for there to be less than OP_HOST_CONNECTION_LIMIT connections present?
 
user895378
What happens is ...
 
user895378
Hmmm ... you know what? That question makes me realize there's a logic problem with the way it's handled right now.
 
Yeah - I like neither possible answer.
Waits is bad. Not waiting is bad.
 
user895378
The redirect response is received and the api.github.com socket is checked in immediately, but the next request (to follow the redirect) goes to the back of the queue to checkout a socket for whatever host is needed to follow the redirect.
 
user895378
9:36 PM
So in theory the request to follow the redirect might have to wait for lots of previously queued requests before it is finally dispatched.
 
@rdlowrey That sounds a lot like the thing I was talking about earlier, where being able to push requests on the head of the queue rather than the tail would be useful.
 
user895378
@Danack yeah, related. I'll work on it later this evening. That's definitely not a desirable situation.
 
@rdlowrey cool. btw I'm investigating a reference/memory leak. It seems the Reactor keeps hold of the $readCallbacks and $writeCallbacks. Is it likely they would contain references to the data that has been transferred?
 
user895378
@Danack Are you calling Reactor::onReadable() or Reactor::onWritable() directly in your code at any point?
 
@rdlowrey Nope.
I thnnk - let me double check.
 
user895378
9:42 PM
But yes, IO watchers are always kept around until they are explicitly cancelled.
 
So the progress watchers....
 
user895378
If you ever use those functions you have to explicitly call Reactor::cancel() with the resulting $watcherId or the memory will never be cleared.
 
Request rate limit has been exceeded, try again in 96 seconds
/stupid github....
 
user895378
lol
 
user895378
In any case, I'm pro at finding these leaks by now, so I'll do some diagnostic testing later and see if I can't ferret out any leaks in the artax code itself.
 
9:44 PM
thanks.
 
user895378
It's also possible that the redirect thing we were just talking about causes a "leak"
 
I'm not certain it's in there....but I can't figure out where it would be in my code either.
 
user895378
Because if the next request in the redirect chain has to wait behind a ton of other requests you're then stuck holding references to all the things you needed for that first request much longer than you otherwise would.
 
I doubt that would cause enough memory to be kept, it's not making that many requests. I would have guessed at a reference to a response and the large file being kept around somewhere...
 
user895378
Will look into it ...
 
9:50 PM
btw I changed my code to now attach the progress monitor to the Promise. It still seems that the readCallbacks and writeCallbacks are growing. However I've just realised that all most of the entries are just an empty array.
So shouldn't possibly have that much memory associated with them.
 
user895378
10:02 PM
@Danack When you say "readCallbacks and writeCallbacks" what exactly are you referring to?
 
@rdlowrey $artaxClient->reactor::readCallbacks
 
user895378
@Danack Okay. I'll look hard at that area in particular. I'm off to walk the dog and gym after that. Will be around later.
 
That's just from putting a breakpoint in ArtifactFetcher::processDownloadedFileResponse after 30 files have been downloaded. But as I said, most of the entries appear to just be empty arrays, not large references.
 
10:20 PM
migrate a mailserver they said...
 
@PeeHaa I feel your pain brah
 
@PeeHaa Have you considered breaking into where the existing server is and just farking moving it physically?
 
@PeeHaa What did you do wrong to have deserved such punishment?
@Danack alternatively, twice dd should work too. But everything else… no chance.
 
@Danack In my experience imap gets utterly confused when you do that.
@Danack Ow wait. Now I see what you did there :P
Yeah that would have been sooo much nicer
#FriendsDontLetFriendsMigrateMailServer my friend did...
 
@PeeHaa and you call him friend?
 
10:33 PM
$session->get('token') || $session->set('token', $this->token);
Is this valid?
I forgot PHP.
That explains why life was good these past few weeks.
 
It is.
 
Yeah.
 
@webarto surely it's valid. just run it through php -r If you only get fatals, but no parse errors, it's probably valid.
 
@bwoebi Oh, yeah, it's valid syntax, but should it be written like that. When I said valid I meant sane.
Thanks.
I'll change if someone nags 'bout it.
 
@webarto Well, then you just can put an if () there. That'd be saner
 
10:38 PM
One line, one function.....
 
Yup, yup, thanks.
@Danack $session->get('token') OR $session->set('token', $this->token = sha1(microtime(TRUE))); ONE LINE ALL FUNCTIONS
 
@webarto When I write such things it's usually with more || and then to avoid too deep nesting.
 
Yes, I'm so "few lines per method" these days.
 
@webarto You don't want to know what I've written all in one line in my life.
 
I sometimes stalk your commits and cry.
I have no idea what it's doing.
 
10:40 PM
@webarto haha, funny.
 
I've been dissecting simple (as in not too many lines) extension @JoeWatkins wrote... I'm not the sharpest tool in the box.
 
@bwoebi Not anymore...
 
Isn't Auryn a bit like Java Guice?
 
@ziGi hmm?
 
I read about it
and the idea seems similar
just the implementation is different
 
10:44 PM
@webarto You sure like queries with 674 chars. one line. =)
 
Haha, that's wrong on so many levels.
 
@webarto hmmmm?
 
@ziGi Yes. And equally as unpronounceable.
 
haha :D
Guice pronounced like Juice
Auryn as Orin?
 
@ziGi Neither me nor Daniel are intense Java coders who'd know this lib…
@ziGi I always pronounce it like it'd be German…
 
10:46 PM
> papa johns taking their "better ingredients" assertion very seriously with their FUCKING FRITOS CHILI PIZZA.
 
@bwoebi that doesn't mean that the necessity for something doesn't allow people to make implementations
 
What's with the pizza in the USA?
Everyone on my facebook has been complaining 'bout it today.
 
@webarto fyi, that query is production code, run each ten minutes and takes 3 seconds.
 
@bwoebi to me Auryn sounds like a character of LOTR
 
@ziGi could be as well ASOIAF.
But I think he's explained the name somewhere in the README
 
10:48 PM
@bwoebi That's not bad at all... my former manager forced me to use ORM to run cron and it took few gigs of memory and few minutes to run.
 
@bwoebi I've read the whole README didn't see any explanation
 
Because "plain SQL" is bad OOP.
 
@ziGi I thought.
 
> Auryn, stylized as AURYN, is a 5-member British-style Spanish boy band founded in 2009. Signed to Warner Music, they sing in English and Spanish.
hahaha
 
^ no, not that :-D
 
10:49 PM
@webarto ORMs are bad OOP too, so...
 
we know now what kind of music rdlowrey listens to :D
 
Well, RoR and all, you know...
 
@webarto ActiveRecord is even worse.
 
@webarto Rub… you've lost me!
 
No, he made me write Ruby in PHP.
 
10:49 PM
Why are ORM's bad OOP?
 
@ziGi Yeh buys the master tapes with all the individual tracks separately, so he can listen to them asynchronously
 
@ziGi There's no sense in them. They abstract an abstraction away. (SQL string being the abstraction ORMs abstract away)
 
@DaveRandom hahaha hardcore :D
 
@DaveRandom I still think it's because of async pr0n.
 
@bwoebi so I should understand that you don't believe in more than one layer of abstraction?
 
10:51 PM
@ziGi He doesn't believe in unnecessary layers of abstraction.
 
@webarto I... can't and don't want to imagine that
 
@LeviMorrison correct \cc @ziGi
 
@bwoebi Nicely put. **tipshat**
 
It's kind of like a PDO wrapper. Not specific to certain types; just a generic PDO wrapper. I see this all the time and it saddens me every time I see it.
 
@ziGi SQL is already a generic language. Why would you abstract that away?
 
10:52 PM
There's no benefit; only pain.
 
I believe that ORM's allow people to be more lazy and to search a way to use something that is too abstract in really complicated situations. I have seen people that try to use the ORM only to be able to make their own complicated query and it becomes even more unreadable.
 
@ziGi A thousand times that last sentence.
 
@bwoebi why don't we just send SQL statements from the frontend then?
 
@ziGi because they could be manipulated by the user.
 
haha ^ it is just a joke
but I have seen a guy does that from Javascript
 
10:54 PM
@ziGi Well, that's a security issue then. Nothing else.
 
send SQL which is generated by JS
it was lightly said, pathetic
 
Yeah - it's not supposed to do that:
 
^ where there people in?
man that was a real fail
still smaller than the guy who writes code and decides to put checks and throw exceptions so if he forgets and passes the argument as an array but a string instead
example:
function lazy($array) {
    if(!is_array($array)) throw new Exception('You have to specify array here!');
    foreach($array as $item) {..}
}
that is a piece of code I saw today while refactoring some things :D
 
Had a quick glance at Doctrine tutorial.
 
@bwoebi ahaha
 
user1804599
10:59 PM
@Danack Must have been programmed in PHP.
 
@rightføld you're damn right :D
 

« first day (1473 days earlier)      last day (3491 days later) »