« first day (2699 days earlier)      last day (2474 days later) » 

21:05
shit... reminds me... I need to pay a toll before they fine me again
what annoys me are toll roads that have no way of paying the toll at the road...
21:19
how is that a thing?
Wes
Wes
are the php7.3 gc improvements already a thing? was wondering if i should try compiling it
we don't really have toll roads here, there are a few bridges and tunnels and the public race track M6 toll and that's about it
we have toll lanes here.. basically you get to pay to avoid some traffic
on my way down to phpsc17 I went down the M6 toll at about 4am and at one point glanced down at the speedo and was doing 69.5 mph the whole way
that's what I mean, sorry
that's below the speed limit for a lot of freeways here
and you're expected to be going at least 5 over
21:24
What's the highest limit in the US?
85 I think
huh, I was under the impression it was unrealistically low (55), although now I think about it I always ignore/forget the fact that you are basically 50 separate countries
Is that one of those insanely long straight flat roads where it disappears over the horizon because of the curvature of the earth?
dunno, never been there
21:28
I want to watch Cars 3 again now
@DaveRandom some cities don't invest in their infrastructure, i.e. roads, bridges... so they become privatized, and a toll is charged to keep it maintained
at least as far as I know toll roads are the only ones privatized, but there probably are some public toll roads
just comes down to... the tolls are to keep the road in shape
the roads here are public, with the toll management farmed out to private industry
what's the whole "Adopt a Highway" shit I see on signs?
i think they just pick up trash
yeah, googled it. thought they were buying parts of highways or some shit.
21:31
Anyone know of a library similar to this that's actually maintained? gitlab.com/MazeChaZer/soundless
@Tiffany I have all sorts of opinions about this model but if I start then it will turn into an ideological rant, tl;dr is "nice idea, shame about the people". The UK has a particularly bad track record with this sort of thing, most notably with the railways.
I'm looking for something very close to html structure, not a templating language + lib.
How is using a mock method any different than just using the entire object? That seems to completely go against the whole idea of unit testing?
@LeviMorrison /cc @ThW
@DaveRandom it will inevitably reach back to taxes and yeah... that's a mess of a discussion that I don't want to get into
21:33
The test is no longer independent, it requires the use of real external code? @Wes
Wes
Wes
uh?
@LeviMorrison should be pretty easy to whip up something like based on dom
easy-ish, but looooooooong
@PaulCrovella Each piece is easy but is a lot of work.
And I'm looking for context-aware escaping based on attribute name, attribute value, etc.
I'm sure this exists somewhere; it seems too easy to not exist.
@Wes In PHPUnit you can create a mock object with stub or mock methods.
Wes
Wes
21:37
i told you to avoid mocks unless absolutely necessary
I see that case where you would use a mock method, but doesn't that defeat the purpose of unit testing since you are actually dependent on a real world method which belongs to another object in order to do your test?
Wes
Wes
i have no idea i've never used phpunit's mocks thing
You do use PHPUnit though, yes?
Wes
Wes
yes
I'm mostly used mocks to ensure that certain methods were called - I didn't want to actually run the method.
21:39
I have a factory which takes MySQL rows and uses an abstract factory to actually call new.
I either have to rewrite the abstract factory (easy but annoying) or just use the abstract factory's method.
public function create(Array $catalogData) {
		$catalog = $this->abstractFactory->create(
			$catalogData['localId'],
			$catalogData['name'],
			$catalogData['description'],
			($catalogData['active'] === "1")
		);
		if (isset($catalogData['catalogId']) && trim($catalogData['catalogId']) != '') {
			$catalog->setCatalogId($catalogData['catalogId']);
		}
		return $catalog;
	}
that title-case Array makes my face twitch
(he said, unhelpfully)
Wes
Wes
how's this class named
Models\Data\Factory\MySQL\Catalog\Catalog
@DaveRandom It seemed best to stay consistent with capitalization.
I mean...they're all types...even primitives. (I think?)
Wes
Wes
catalog... factory?
@Wes No, that's in the namespace.
Wes
Wes
21:43
this create() method where is it?
I just alias it when I need to. I have to write use anyway.
What do you mean by "where is it"?
@Allenph sure, totally unimportant, 100% personal/team preference. Just not my preference :-P
@DaveRandom It's not just your preference
It's a 99.9-percentile de facto standard that array (and any other primitive type for that matter` is written lowercase
Wes
Wes
the only thing that can save us from this discussion ^ is tabs vs spaces
oh wait...
@NikiC I'm going to fairly confidently guess that a statistically significant number of people who prefer title case have written a lot of VB.
Wes
Wes
21:45
@NikiC phpstorm used to autocomplete to Array :B
Of course, the absolute worst would have been Public Function Create(Array $catalogData)
Array<String, Int>
array<string, int>
It's such a shame php keywords are case insensitive at all
@NikiC I had never even considered that before... jesus.
@PaulCrovella I've seen code doing that in the past. It damaged my eyes, that's why I have to wear glasses now.
Wes
Wes
21:47
@Allenph in which class..
what kind of monster would do such a thing
Wes
Wes
and i have no idea how you are using "use". use is just a way to save you to save a full class name every time
@Wes Are you talking about the abstract factory or the one in the class I just told you the name of?
Wes
Wes
it's not imports, it's not dynamic
@Wes I just meant that I don't feel I need to name my class CatalogFactory when it is evident by the namespace.
That creates conflicts when I need multiple classes named Catalog.
But I'm writing a use at the top of anywhere I'm using those classes anyways.
So I just use as.
21:50
Opinion: namespaces should be used to avoid naming conflicts, not to hierarchically organize code.
@LeviMorrison What do you mean? It mirrors the directory structure and that's like...the point of directories.
Extensive\Usage\Of\Nested\Namespaces\Annoys\Me.
I do that pretty much everywhere. I'd rather have more folders than longer filenames. Maybe I'm wrong though.
@LeviMorrison You can overdo anything, but having some modularization seems quite sensible and namespaces are currently the best way to manage that.
Anyways @Wes You see why I'm confused? The whole point of Abstract Factories is avoiding the new keyword in your other factories (which makes sense). But in order to test those other factories I either have to use the actual create method on the abstract factory, or I have to call new all over the place.
Which defeats the purpose if I have to change all my tests.
Wes
Wes
21:55
if you don't provide code i will never be able to help
@PaulCrovella visual basic people. I spent the best part of 2 years writing mostly VB and I never got used to it, my misses did it on and off for 10+ years, I really cannot understand how.
@NikiC For me 2 namespace segments are okay, 3 maybe for larger organizations, anything beyond is excessive.
For instance, it's ridiculous to me that this uses 3 namespace segments: Psr\Http\Message\RequestInterface
Let me go make a gist.
@DaveRandom visual basic people aren't real. I refuse to believe that.
@Allenph just do new class extends AbstractFactory in the tests
21:57
@Wes Code above.
@DaveRandom That's the same thing as using a mock method, is it not?
Wes
Wes
it can't be an abstract factory if it's a concretion
interface CatalogFactory{
function create(String $localId, String $name, String $description, Bool $active);
}
class ConcreteCatalogFactory implements CatalogFactory{
// ...
}
@Wes " In normal usage, the client software creates a concrete implementation of the abstract factory"

https://en.wikipedia.org/wiki/Abstract_factory_pattern
Wes
Wes
yes but your abstract factory is missing
abstract literally means "interface" (or at most "abstract class", if you are mad :P)
@Allenph That job of that unit of code is to map some input values to another method. You cannot test that unit unless you test that it invokes the other method in the way you expect it to. You cannot test that unless you mock the method in some way.
@DaveRandom So...I should be mocking?
22:01
I feel like you confusion here stems from something that I do a lot, which is to forget what you are actually testing and get caught up in "purity".
@DaveRandom I definitely do that a lot.
@Wes That seems very strange to me. I want to be able to have a create method on a bunch of factories that all take data in different structures...MySQL rows, API responses, etc and have them all use something else to call new.
@Allenph you should be doing "something" that allows you to perform a sane set of assertions which actually test the unit. imho the best way to do this (produces the most readable tests) in by just injecting an anon class
but in reality the exact nature of "something" is irrelevant as long as the test is built in such a way that it passes when everything is OK, and fails when it isn't
after that it just making it as readable as possible
@DaveRandom It's just that there already is a test for the AbstractFactory class.
It makes no sense to test it twice.
Well, I guess there is. That way if MySQLFactory fails AND AbstractFactory fails, I know where the problem actually is.
Wes
Wes
i can't stand "testing + abstract factory"
you definitely have to change that name
@Wes I should probably change the name.
Wes
Wes
22:06
and i still don't know what you are doing
I just misunderstood. I'm not sure what I would call that object though.
I thought it was pretty clear...
Wes
Wes
with the code you have now you should extend that class and override the method
in the override you check that it's being called with the correct parameters
The mock builder in PHPUnit is just a shortcut to doing that. Why don't you like it?
@Allenph disclaimer
I do have more to say but am somewhat busy, will try and write it out in a way that makes sense in a bit
Wes
Wes
$catalogFactory = new Catalog($innerFactory = new class extends AbstractCatalogFactory{
    function create(...){
        $this->arguments = func_get_args();
        return parent::create(...$this->arguments);
    }
});
$result = $catalogFactory->create($data);
self::assertSame($yourExpectedArguments, $innerFactory->arguments);
22:10
You know more than I do.@DaveRandom
!!should anyone listen to me about anything?
No.
true story
@Wes That makes sense. Thanks.
Wes
Wes
but name the stuff properly
22:13
Will do. Any ideas?
Generic maybe?
Wes
Wes
that's like CatalogFactory that constructs Catalog objects
then maybe DBRecordToCatalogFactory
eeeeee I'm building my first android app
finally got my phone all set up for debugging
so excited
sorry, had to share that with someone
@Allenph ftr I don't like that you have two separate classes for creating instances of a single class that appears to be concrete and not replaceable, I would probably bin the whole thing off and just new it, I don't see what you are gaining by proxying a ctor there (unless there is an interface for Catalog that we can't see from your code).
Catalog#setCatalogId() irks me a bit as well :-P
@DaveRandom The setCatalogId is because I have remote and local ID s. Local are generated at construction and are immutable.
catalogId may or may not be present.
will the presence of the remote ID change during the lifetime of the object?
22:22
Yep.
in the interests of not having to think about it too hard rn, I'll allow it
<bangs gavel> next case
It's definitely a cluster fuck.
@DaveRandom I'm planning on adding an interface for all the other factories other than the CTOR. I have multiple factories because there are multiple sources of data. An API and a MySQL cache.
That way each of those data source factories can use the same concrete class dependency injected into each factory...and use it for all of the translation methods avoiding quite a bit of duplication.
meaning there are multiple concrete implementations of the entities?
What do you mean by that?
The idea is that regardless of the data source the same entity will be produced?
as in, is there a MysqlCatalog and a ApiCatalog?
22:26
There's a MySQLCatalogFactory and an APICatalogFactory.
OK, and they call new on different classes?
Neither of them call new. They are dependent on what I was calling the "AbstractFactory" before West told me to change the name.
omg I am so going to start calling @Wes "West"
westworld just got a bit more frightening
@Allenph so what I'm getting at is, what does the thing that you were calling AbstractFactory gain you, vs just doing new?
Wes
Wes
22:29
i've been called westminster
Just abstracting away new yeah @DaveRandom.
and what does that gain you? It is totally worth doing that if you have multiple possible implementations of Catalog and you want to decouple. afaict though, all you are doing right now is adding another layer for no real benefit
this is something I used to do all the f'ing time, btw
one day I realised (I think because @rdlowrey pointed it out) that it is completely pointless, gaining nothing and adding bloat
I'm generally pretty happy as long as code is testable.. I don't know if that makes my standards high or low
I asked this same question of Wes yesterday and he linked me to an IoC article.
Seemed like a good enough reason to me.
And with Auryn it's pretty trivial.
22:35
isn't that essentially what @pmmaga was shooting for?
Wes
Wes
yes, we all
also marcio. asked him on twitter
we should do that
iirc pedro had a pretty well-formed idea that seemed doable and solid w.r.t how it could be implemented
I'm up for contributing, but equally I don't know what I could usefully do, pedro is at least as good and probably much better at php-src than me, especially all the oops stuff
Wes
Wes
also there's ircmaxell implementation that quite possibly will be mostly valid also for php7
@Allenph no worries. I remember having this exact same conversation from your side of it 100+ times before I changed the way I was working, and also I may be wrong.
@Wes dunno, 2013 is a looooooooong time ago
Wes
Wes
@Allenph ioc is all good in theory but in practice if you wanted to use a factory for everything you easily end up with tons of files
22:41
@Wes Yeah, I have 3 factories for every aggregate.
Plus an interface.
I have such a love-hate relationship with sysadmining, today is very much a hate day
You know what though, I think the two factories and the interface are neccesary.
Otherwise my data mappers would be insane.
Wes
Wes
sometimes i get keys pressed that i didn't press
either my keyboard is broken or someone hacked my wireless/computer/whatever :B
it's quite scary
pop off the keys and clean the bed underneath.. it's scarier
Wes
Wes
it's not... for now :B keyboard is new
22:51
@PaulCrovella There have been some dark times in my life. I have been to rehab for addiction, I have worked at McDonalds. All those pale in comparison to the job that caused me to write this.
> Report gist
23:02
@DaveRandom I get headaches from reading that code
imagine how I felt writing it
@DaveRandom I strongly hope you transpiled that from C# or such to VB.
it's VB6, mostly VBA-compatible
@bwoebi I hope C# wasn't a thing when it was written
@PaulCrovella C# exists since 2001. Chris isn't that old yet.
23:08
I'll have you know I was writing qbasic in the early nineties.
10 PRINT poo
20 GOTO 10
technically programming
@DaveRandom I mean, I was writing PHP around 2009 … completely insane thing in these times to start with it.
I think my first PHP version was ~5.2.10
so whenever that was
@DaveRandom 2009.
lets start a "started with PHP in 2009" club
haha
23:12
y'all missed all the fun of the 4 to 5 transition
yes and no, I still write code for 4.3.10 occasionally
wat.
I started writing PHP in 2006, I think.
true, 4 did hang around well into 5.3
We all really like CentOS, right?
23:14
meh
daverandom@CS5100-0007D900A5C3# php -v
PHP 4.3.10 (cli) (built: Jan 20 2005 09:40:04)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with the ionCube PHP Loader v3.1.24, Copyright (c) 2002-2006, by ionCube Ltd., and
    with the ionCube PHP Accelerator v1.3.3r2, Copyright (c) 2001-2002, by Nick Lindridge
@Ekin ^
:-P okay.
ioncube, the destroyer of upgrades
@bwoebi I do, pieter does, so yeh it's unanimous
I'm not really sure why ioncube is on there, I might disable it and see if anything breaks
@DaveRandom That's so archaic I'm pretty sure I can't even compile that locally :-P
At least not without changing some things about my build env
23:17
you'd be lucky to be able to build the parts you'd need to build it
@bwoebi I would be interested to see if you could build a compiler env for this box actually (if you were willing), I have tried a few times but I don't really know what I'm doing. I'm pretty certain it would at least run php5, it would make a lot of shit so much simpler.
it's a phone system that runs on a extremely ancient version of embedded linux
@DaveRandom let's start with … what kernel and distro versions are you running?
> Linux CS5100-0007D900A5C3 2.6.18 i586
@DaveRandom my condolences
@DaveRandom I've already compiled compilers locally … well, I'd have to try
23:21
it even has ioncube loader
@DaveRandom bit bored right now, so if you want me to fiddle around a little, just give me access
.. takes me back to days, when I was young .. emm ... younger
@DaveRandom euh … you're actually talking about cross-compiling?
well, did that only once, don't remember anything about that
I assume so, like I say I don't really know what I'm doing once we get out of the realm of things that have gcc easily available
23:30
if you cba then don't worry about it, if you are bored one day and feel like buggering about with it then give me an ssh key :-P
@DaveRandom you have my key, it hasn't changed :-P
oh right, lxr
You guys let each other into your servers?
Skeeeetch.
well lxr is a communal box for the room that I happen to operate because I have the ability to do it for free, and I trust Bob
@DaveRandom Jeeves is Pieters server, right?
23:33
aye
Ahhh. I see.
afaik i have root on nevis, lxr and jeeves regarding servers of people in this room
They gave you root? Wow.
hi i have a question
there is a posting for junior developer which required 10 years experience
i mean... is this supposed to be normal?
Wes
Wes
lol
23:38
10 years experience + degree required
Wes
Wes
doesn't sound normal
ok..
wanted to make sure my sanity was in check
@Allenph well… if what you want/are supposed to do requires root … well, then either one trusts you and gives you root … or they have to do it themselves…
Wes
Wes
bob secretly uses jeeves to mine dogecoin
haha
@Allenph It helps that I have met him so I know that even if he did decide to do something nefarious he would get distracted by some random interesting bug and forget about it before he got anywhere near actually doing it. Similarly Joe will just forget what he was going to do, probably before the end of the sentence, either that or get lost while attempting to access the server and somehow end up in central France.
otoh @PeeHaa and I have more of a cold war thing going on, where neither of us will ever make a move for fear of retaliation
we just settle for doing stuff like this fabor.daverandom.com
I, on the other hand:
Jan 20 '17 at 13:46, by Danack
!!alias alias friday
should not be trusted.
@bwoebi twatter DMs
!!blame @Danack
oh ffs
23:53
\o/
I keep forgetting, 3 self-owns and no victims :-/
It was 2016 when I wanted to improve reminder and then I wrote a brill tagger and an interval parser
... I don't think I can say I completed one of them, at least
@Danack me neither.
I'm writing a talk about how telling the difference between good and bad is hard, and this article is just awesome: marketwatch.com/story/apple-should-pull-the-plug-on-the-iphone
@PaulCrovella the trick is to make sure the side project gets used in production, then some other sucker will have to add to it.

« first day (2699 days earlier)      last day (2474 days later) »