« first day (1475 days earlier)      last day (3459 days later) » 

3:00 PM
@Rican7 :-). And my normal build cycle with that is about 1.5 minutes for the first build, and 10-15 seconds for the incremental ones...
@tereško holy crap dude...
 
@ircmaxell that's not bad at all. Not quite Go fast, but not bad. :P
 
@ircmaxell huh?
 
PHP isn't small, though, haha
 
@Rican7 no, not go fast, but plenty fast enough
 
@ircmaxell yea, definitely
 
3:01 PM
one point: if you change a header file, do a clean rebuild (make clean && make -j4)
that can make for some really weird and hard-to-track down bugs
 
@ircmaxell much better than the 30 minute loop I thought I was going to have to do. :P
ooooo, good point
 
Kinda wish TCL would use gfycat or something for their stuff.
 
@Rican7 your PR can't ever make sense, unfortunately. The format string (which is all you are really defining and all you actually can define for this) cannot specify the tz, and as such it could only work when used with gmdate().
It would probably need a function, if you want to add special handling for that date format
On the plus side, that new function would be about 2 lines of code
> I'm not an expert but I'd expect the new format to "cast" my existing date to GMT
(comment on the PR)
It's just not possible
 
@DaveRandom I was worried about that. There's two options to make it work, and I'm not sure which is better: Handle the new constant differently, or change the parser to understand the escaped timezone characters
@DaveRandom parsing escaped characters is like lying, though
so I'm not a fan of doing that
 
3:08 PM
Regarding Jimbo's article about global state, something caught my eye there that I've been trying to understand conceptually. He says that global state hooks you into a framework, so if you are trying to test your code you have to include the framework. He mentions this in the context of using statics to create global scope.
I get that, BUT, what about using interfaces in typehints? You'd have to mock the interfaces, or include the autoloader, which is sort of hooking you to a framework dependency. You could mock the static classes just as easily as you mock the interfaces that the test target needs....
 
@Rican7 Yeh I can tell you with absolute confidence that the latter is not an option
 
So, isn't typehinting to interfaces almost like using globals?
 
The new constant, unfortunately, just doesn't make sense
 
@Chris But you can't mock the static classes because their name refs are hardwired.
Interfaces -> polymorphism -- so long as you implement the interface it doesn't matter what the actual object type is.
So are you locked into using that interface? Yes, but that's not an implementation detail; static classes lock you into the the implementation, and further, all the foibles that come with global state (likely)
 
Ex Machina Trailer. Looks good.
 
3:13 PM
> To erase the line between man and machine is to obscure the line between men and gods.
^^ Dat quote is schweet.
 
I have a dummy object I use for test cases, it uses get/set/call magic to pretend to do basically anything. It seems trivial to make a similar object that uses callStatic magic to mock that as well.
I've cargo culted myself out of using global or static a long time ago, just that the test argument always seems specious to me.
 
@ChrisBaker But you're not creating an object, you're creating a class, to which you're hardwiring the name.
 
user895378
@Fabien I had the exact same thought yesterday.
 
user895378
@ChrisBaker wat?
 
PHP_FUNCTION(date_rfc7231)
{
    long    ts;
    char   *string;

    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &ts) == FAILURE) {
        RETURN_FALSE;
    }
    if (ZEND_NUM_ARGS() == 0) {
        ts = time(NULL);
    }

    string = php_format_date("D, d M Y H:i:s \\G\\M\\T", sizeof("D, d M Y H:i:s \\G\\M\\T"), ts, 0 TSRMLS_CC);

    RETVAL_STRING(string, 0);
}
 
3:14 PM
Yay, my last name is there :) I added it so I could stop getting chat notices every time Otherchris asks questions
 
@Rican7 ^^ I think that's the only sane thing you can do
 
@DaveRandom yeaa.... a new date function feels dirty to me, though
 
@ChrisBaker lol, you shoulda gone with "OtherChris"
 
@DaveRandom there are already too many. ;)
 
@ChrisBaker They have no state....you are coupling you code to another bit of code, but not to the other bit of state.
 
3:16 PM
@Rican7 Me too, but there's simply no way to guarantee that it gives the right result. The only other thing you could do would document that the new constant only makes sense with gmdate()
 
user895378
@ChrisBaker Globals are bad because: mutable. global means any code can change any value from anywhere at any time. Interfaces have nothing to do with being able to modify or change values. They simply form a blueprint for your code.
 
Don't get me wrong -- I've stopped using globals and staticglobals a long time ago. That was probably one of the first significant changes in practices I picked up from hanging around in here.
When I try to explain this to other developers, like coworkers, I find myself running out of arguments sometimes, though, which tells me that I have a deficit in understanding still
 
@DaveRandom yea, I'll get a thread going in internals about what a proper solution would be
/crosses-fingers
 
I see a piece like Jimbo's raise the specter of testing, and I'd like to make that argument myself but I am not confident that I understand how mocking an interface and then mocking a class that implements the interface is easier than mocking a static with the name your code expects.
 
user895378
@Rican7 good luck with that ;)
 
3:18 PM
lol
yeaaaaaa
 
user895378
@ChrisBaker Start with this: how would you mock a static value? Spoiler alert: you can't.
 
@Rican7 Have fun with that :-P
 
@Fabien not this Ex Machina
 
@Rican7 it would be worth talking to Derick first, btw, he's usually in #php.pecl on efnet
 
user895378
3:20 PM
> it would be worth talking to Derick first
 
user895378
Said no one, ever.
 
class TheClassMyCodeExpects { static function theMethodMyClassExpects(){}}
 
Yo Trevor
 
@JoeWatkins haha, I've wanted to get into internals for quite some time now
 
@rdlowrey actually...
 
3:20 PM
Seems very similar to class whatever implements TheInterfaceMyCodeExpects{}
 
@Rican7 understandable, you see how much fun it is for us and think "I'll have some of that" ... it must be because of all the fun we have ...
wait ...
 
hahaha
 
I am still creating an environment for my test subject in both cases.
 
yea, exactly
 
user895378
@ChrisBaker No, it's nothing like that. It's like saying the blueprint for a house is the same thing as a house. They're fundamentally not the same thing.
 
3:21 PM
:)
 
user895378
One is implementation and one is interface.
 
My house is made entirely from blueprints
It falls down a lot
 
heh
Should have went with cards, man
 
They were too drafty
 
@Fabien agreed
 
3:25 PM
@rdlowrey That's true of live code, yes, and a solid point -- the global (or a global hiding in disguise as a static) makes coupling and leaks implementation details. I've got that one down, and can explain it to someone else. I'm talking specifically about the testing argument, where you may have to mock something to test a bit of code. Mock this, mock that, it doesn't seem like there's much difference what you mock, so I have a hard time understanding the point specific to testing.
 
@ChrisBaker Have you ever actually tried to mock static methods for testing?
 
user895378
@ChrisBaker Which takes me back to my first point: please explain to me how you mock a call to a static method?
 
Just because I still don't see how the mock example you showed above would actually work
Unless you did something with the autoloader or include path for tests to include your mock static class and not the real thing
Either way the code under test is gonna be hardcoded to 'MyClass::myStaticMethod'
 
The code you're testing makes the call, all you would have to mock is a static... thing that has the right names and methods. Which is also what you mock if you're faking up an interface and a mock implementation.
Have I ever tried this? No. When I was using statics and globals, I didn't really do unit testing.
 
No. I can easily mock an interface and pass it in as a dependency
 
3:28 PM
Another change in practice I picked up hanging around in here.
 
That's the ONE problem I have with the OOP paradigm.
Many times it makes sense to have simple behaviors not tied to a object value, and so a static method (or in PHP's case, even a namespaced function) makes sense to use sometimes. But then you're tying behavior to a concretion. And that's fail.
 
The SUT doesn't take the static method as a dependency, it is hardcoded in
 
user895378
@Rican7 functions > objects. Objects are just functions coupled to state.
 
@rdlowrey agreed
 
Right, so you mock what the hardcoded SUT expects in your test setup, and you'd be okay.
 
3:29 PM
which is why static methods make little sense in PHP, other than maybe factory methods
 
Except I still don't see how you'd do that without manipulating the autoloader/included files
 
user895378
@ChrisBaker Chris, write some code that mocks a call to a static method first, please.
 
I haven't tested statics, but as I said, I used to use them heavily for stuff like database access, and I can conceive of a static mock that would work fine
 
So that your tests only include the mock static and not the real thing
 
user895378
@ChrisBaker So test them. Then come back and tell us how it goes :)
 
3:30 PM
@ChrisBaker no, you can't, it's what we're telling you
 
SplFixedArray::fromArray() makes sense, as its tying the behavior directly into building that class
but say you're doing string handling
Maybe you need a function to convert a camelCased string to snake_case
 
user895378
@Rican7 100% agree. I'm on the downslope from OOP myself. I think a lot of it is snake oil. It's definitely very useful in very many contexts, but it's not a silver bullet.
 
yea
 
user895378
The right approach in every situation is to use the right approach for that particular situation :) And sometimes often that means mixing different paradigms.
 
the problem is that I'd build a function or static method to do that string conversion
but then, what if someone made a faster way of doing that?
they can't change my static calls to that function
they can't "inject" that function call
unless I do something horrific like php.net/manual/en/splfileinfo.setfileclass.php
:P
 
user895378
3:36 PM
@Danack I've eliminated the redirect socket checkout silliness in dev-master. Haven't had a chance trawl for memory leaks yet. I haven't seen anything concrete to suggest that any exist, but I'll hunt them when I can.
 
@rdlowrey Cool. PHP really needs a 'dump where all the memory is being used function'...
 
lol that title @tereško
 
user895378
@Danack yeah it can be very difficult to find leaks in long-running php. I usually resort to static public properties that I can increment/decrement on object creation and destruction and then use repeating reactor events to echo out counts of things to find where objects aren't being GC'd and go from there.
 
Unfortunately with mysql_query being deprecated and the design needing a major refresh I am going to have to undertake a huge task one way or another hence I am hoping that a framework will save me some time whilst also addressing the issues which need to be addressed — bhttoan 51 mins ago
Lame reason...
 
3:41 PM
@tereško sort of reminds me of this (quite different, but similar intro and pacing)
 
heh, brings back the freshmen year in university
 
morning @ircmaxell
 
word
 
Okay, bearing in mind I am not making an argument that globals/statics are good, only trying to understand this "you can't mock them in tests" argument, I took a peek in a coworker's code and grabbed the top of his user class. This is how I would mock that static: gist.github.com/GRMule/a4a740b8fd5e26aac989
 
user895378
@ChrisBaker but you haven't actually mocked anything.
 
user895378
3:44 PM
You've put a call to your test class in your production code.
 
eih
 
And still the question must be asked... how is the User code calling db:getRow going to use the test mock and not the real thing?
 
Because I won't include the file where the "actual" db static class is created.
 
@ChrisBaker it also means that you are not really testing the same code as the one that you are running
 
Yea, now you're not mocking as much as you are re-writing with the same name
 
3:46 PM
@ChrisBaker Manually keeping up with including specific files is gonna turn into a huge PITA
Especially when you want to start mocking different return data
 
Fair enough, tereško, but let's say I was testing that same user class, but instead of using db::getRow it expected a database interface to be passed into the constructor. I'd mock that database object... same test
 
also, how exactly you achieve "testing in isolation" ?
do you add some "reset to defaults" method, which you call before every assertion ?
 
@tereško hi, am I mistaken or you were the one who writes and uses his own MVC modules for work?
 
Good Afternoon Everyone!
 
Consider every time you want to return a different set of data you need a new 'db' class. How would you handle making sure the right one was included for the specific test? You can't just blindly include all "mock" db classes because you'll get a name conflict error
 
3:49 PM
@ziGi I dont have "MVC modules"
 
user895378
@ChrisBaker Except your class knows about things it has no business knowing about. Namely global static things. To understand your class you now have to know about some other static class. You've instantly doubled the cognitive overhead required to understand and troubleshoot your code. Good code is, maybe more than anything else, about being easy for humans to understand with as little cognitive overhead as possible.
 
:+1:
 
user895378
I don't want to know about what might be going wrong in the Db::staticMethod() to be able to troubleshoot a problem in your User class.
 
You guys are explaining why statics and globals are bad, I am specifically trying to understand only the argument that you cannot mock them. I see it brought up every time.
 
@tereško ok so how do you start a PHP project, I guess you don't use frameworks but you have some code that you have written and reuse. Can you give some overall insight about it?
 
user895378
3:50 PM
@ChrisBaker You haven't mocked it though. You've created a hack the relies on changing your code in the test environment to do something different than it does in your production enviroment.
 
I have used mostly frameworks but I believe they provide a lot of unnecessary functionallity
 
user895378
The whole point of testing is to ensure that the code running in production works. And that's more likely to be successful if you aren't doing hacky testing workarounds and instead testing the code exactly as it will execute in production.
 
and I want to make my own project and implement those things by myself
 
@ChrisBaker well of course you can find ways to mock them, but you will spend less time refactoring to do it properly than you will implementing your workaround and ensuring it really is performing something useful (which it currently isn't)
 
@ziGi in my case: start a virtual machine, login, start xampp, open notepad++, having fun, saving it in my root, enjoy it :)
 
3:52 PM
I work on a huge huge codebase, huge, 30m loc, there are statics everywhere, we have ways around it, but that doesn't mean we shouldn't invest time in doing it properly, we should and do ...
 
@MikeM. I have all that but the question is not to have fun but to have a structured way of making your components more modular
for example let's say you need a router
to be able to send your requests to different controller files containing actions
 
@ziGi I start by running composer create-project fracture/project:dev-master <directory>
 
This room has helped me expand a lot of my skills, but I really feel like this particular conversation isn't getting me anywhere closer to understanding the argument at hand. Every single article about statics make the case that you can't test code that relies on a static method's existence, and I still think that's a specious argument. Anyway, thanks for taking a look guys... I'll keep reading :)
 
@ChrisBaker the testing is not the most important part
 
user895378
I heard that @JoeWatkins has to periodically adjust his watch due to electromagnetic interference from the supermassive 30M LoC he works with.
 
3:54 PM
but the fact that you introduce spooky action by allowing your file alter/get static state that might have been altered by other classes
 
@ChrisBaker It isn't that you can't mock them; it is that doing so is going to be a HUGE pain in the ass. Seriously, how would you mock a different set of return data in the example you gave? You'd have to write yet a third class named 'db'. (the real one, the first mock, the second mock)
 
@ChrisBaker I compare it like this -> Using singletons is like sharing a toothbrush - you never know when someone is going to wipe his ass with it.
 
That is a huge amount of complexity in your tests. And if your tests become too complex nobody will ever want to write new ones or use your tests at all.
 
@ChrisBaker my main problem with static classes sis that they effectively cause tight coupling to the name of the class , which means that, when you make a DB class, there is no way to change the behavior. If you need to switch to a different RDBMS (rare case) or additional persistence source (much more often) you are basically fucked
 
@ziGi This is another way to state the argument against them, but does not further my understanding of the cannot test the code argument.
smh
 
3:56 PM
@tereško isn't composer part of Laravel?
@ChrisBaker I am doing testing now and I see the problem
 
@ziGi are you trolling ?
 
@tereško no actually I have no idea
 
The best way to test your scripts: get a monkey, let him type (punch) your keyboard and see if both your script and your keyboard survived, it passed the monkey test, else you're doomed ^^

Warning: I am **not** responsible for damaged scripts or keyboards
 
@ChrisBaker just accept that people mean should not, there is almost nothing impossible, example code is not good for understanding, because someone can always come in and say "you can do it this way" ...
 
@MikeM. I have a guy at the office who is effectively a monkey that smashes all inputs as quickly as possible. I really do use him for UX testing. He always clicks the most broken thing on the UI immediately, it is uncanny.
 
3:58 PM
@ziGi it's a standalone package manager. and developed by different people.
 
@ChrisBaker I will give you a concrete example. A colleague of mine has created a Service Locator which is a Singleton and keeps the session in there. He has created a "ServiceFactory" which uses the Service Locator directly. When I make tests I want to be able to test for different users and companies (using the services created by the factory), but I have to change the global state because the ServiceFactory doesn't get dependency which I can replace with a Mockup company and user.
 
In computer science, a Monkey test (aka. Mark Testing) is an automated test that runs with no specific test in mind. The monkey in this case is the producer of any input. For example, a monkey test can enter random strings into text boxes to ensure handling of all possible user input or provide garbage files to check for loading routines that have blind faith in their data. The test monkey is technically known to conduct random testing, which is in the category of black-box testing. The name 'monkey' comes from the adage that ‘ thousand monkeys at a thousand typewriters will eventually type out...
 
I was trolling about an actual monkey...
 
@JoeWatkins @ChrisBaker yea, "cannot" is practically not a word in dynamic languages like PHP. Hell, you can pretty much do whatever you want with evil things like Runkit: php.net/manual/en/intro.runkit.php
 
32
A: How is testing the registry pattern or singleton hard in PHP?

GordonWhile it's true that "you can write and run tests aside of the actual program execution so that you are free to affect the global state of the program and run some tear downs and initialization per each test function to get it to the same state for each test.", it is tedious to do so. You want to...

 
3:59 PM
@MikeM. I know. Just telling you it's a real term :)
 
(please don't really use Runkit)
 
I know it is,
 
or uopz, because shiny ...
 
I get ASL :)
 
@ChrisBaker additionally the global state runs constantly, so to be able to remedy this I have to re-instantiate the whole application over and over before each test which takes a lot of time
 
4:00 PM
Now we're getting somewhere.... statics that return classes that use other statics.... gah you'd never mock that.
 
@JoeWatkins holy shit, Joe. I didn't know that was a thing. Why, man, why?
 
Easy for the other guy (our hypothetical noob) to say "but I don't do that", but still, that's something
 
runkit caused our massive test suites to fail, and is extremely awkward code ... so we got something shiny and I was allowed to release it ...
 
@ChrisBaker that's what I am saying
 
haha, oh man
 
4:01 PM
@JoeWatkins very shiny :)
 
I am sitting here watching this discussion and I am like"derp derp, what the fack is that for thing?"
 
The database static is still really hard for me to argue down. It's a database connector. It returns arrays that it gets from the database. You can make a PDO connection anywhere in your code, so I still struggle to answer the question "why not encapsulate that in a static variable for efficiency?", my answer right now is "errr.... ummm... statics are not good because someone could change the state"
Response: "someone could change the state of the database anyway."
 
transactions
 
user895378
@Rican7 super shiny! also: I can mock function call results for testing \o/
 
@ChrisBaker what happens if you want to make 5 connections with different users that have different rights to the DB? 5 singletons
 
4:03 PM
the "state", when dealing with DB connection abstractions (pdo, mysqli, postgre) does not refer to the database itself
 
user895378
This helps me move closer to the panacea of "Functions! All of the things!"
 
@tereško Effective rejoinder, but the type of programmer using statics and globals is probably not using transactions
Hmm
 
@Gordon github.com/composer/composer is this the right composer
 
@rdlowrey haha, yeaaaaa. Much better than doing things like this: github.com/chriso/klein.php/blob/…
.... which I did for 100% test coverage
 
@ziGi yes
 
4:04 PM
more as an exercise than anything
100%, not worth
Klein really needs a caching interface
and a major refactor of the main Klein class into separate matcher, router, etc classes
 
user895378
I used to do all sorts of nutty things in my own personal quixotic quest for 100% test coverage. However, the older I get the fewer fucks I can be bothered to give.
 
yea
fuck 100%
its ridiculous
 
@Gordon I remember now, I have seen the logo
 
@Rican7 eloquent
 
@JoeWatkins lol
 
4:06 PM
@Rican7 I would also note, that it's not so small anymore
 
haha, its not
 
@rdlowrey The bell curve of testing. You start off not testing anything, then you reach middle age as a programmer and test EVERYTHING. Then you get old, and lazy, and start testing less until you finally test nothing again. Because you're dead.
 
user895378
I think realizing 100% coverage can be an anti-pattern is a rite of passage.
 
damn.. where is the function_exists('function_exists') code?
 
user895378
4:08 PM
@ChrisBaker lol: because you're dead.
 
I didn't know numbers went that high ...
 
user895378
 
thanks, bookmarked
 
@Gordon Nice writeup, thanks
 
@ChrisBaker you're welcome
 
user895378
4:09 PM
markdown formatting s-s-s-s-s-s-super ping!
 
@rdlowrey I can connect you to principal consultants who will argue that 100% is a necessity
 
@rdlowrey I got inspired by your nice markdown of Auryn and wrote some README's of my own today and I am really happy how nice formatting is :D
 
user895378
@Gordon I'm sure they exist.
 
@rdlowrey yea, it was definitely a big moment for me to realize how much of a pain it was, and how it wasn't really necessary to get 100%
 
@rdlowrey not that I would agree with them. Actually I very much agree with "test the critical stuff"
 
On the subject of markdown, I just saw dillinger.io for the first time today, likeee!
 
@Rican7 I actually found this to be more painful to look at: github.com/chriso/klein.php/blob/master/src/Klein/Validator.php
 
user895378
@ziGi Great! I've gotten really comfortable with the github markdown. It makes documentation fun. Well, it makes it less terrible, anyway.
 
I totally agree
 
@tereško yea, FUCK the Validator
and FUCK the "ServiceProvider"
 
user895378
4:11 PM
@ChrisBaker wwwwwwwwwwwwwwwhhhat! How have I not seen this?
 
@Rican7 for the record, apc isn't needed anymore since php 5.5
 
first things I'm axing in Klein 3
@FlorianMargaine it was using APC for the app-level key/val cache
@FlorianMargaine not for the opcodes
 
then you need apcu
 
yea
 
(since php 5.5)
 
4:12 PM
APCU uses the same function names, though
 
brace yourselves, I'm going to leave apc in the past ... it's wank ...
php7 will get something shiny ... deal with it ...
 
@rdlowrey look at stackedit
 
really, though, it all needs to be abstracted behind an interface
@JoeWatkins really?
 
also, @Rican7 , github.com/chriso/klein.php/blob/master/tests/Klein/Tests/… read about @provider for PhpUnit .. it might make your tests a lot cleaner
 
yeah
 
4:13 PM
@JoeWatkins I would still love an in-memory cache for simple things like regex patters
 
@ChrisBaker that's cool
 
but but ... regexp are cached internally once compiled
we'll get a usercache, but shiny interface, one that isn't from the late 90's ...
 
user895378
@FlorianMargaine nifty
 
@Rican7 you sound like you have experience billions of unique regexes that have to be in memory cache to see any difference in perforamnce
 
4:14 PM
totally impossible to believe that's the first issue @DanLugg
 
@JoeWatkins you have me excited
 
@rdlowrey ikr, found it in the sidebar on Jimbo's post --->
 
user895378
@DanLugg Don't ruin the fun!
 
@tereško it's @dataProvider :)
 
tnx , couldnt remember the name =/.
 
user895378
4:15 PM
We don't want them to, you know, actually remove it.
 
@rdlowrey Flood it with :+1:
 
@tereško thanks, I've used it in other projects
 
@rdlowrey BUT I MUST KNOW WHAT THEY WERE/WEREN'T THINKING!
 
user895378
You cannot know the void.
 
@rdlowrey Is that like, the "nothing"?
 
4:16 PM
@DanLugg dan, I don't see how you can call function_exists in the first place if it doesn't so I guess !function_exists('function_exists') would always be false
 
user895378
@DanLugg I don't know, but welcome to @rdlowrey's philosophy hour. Forgot to do the intro.
 
and while I am at it, @Rican7 , what is the responsibility of THIS class: github.com/chriso/klein.php/blob/master/src/Klein/…
 
user895378
okay, afk. back in a couple hours if I don't accidentally fall asleep.
 
morning
 
4:17 PM
noted
 
a lot of this stuff was just moving things from Klein 1.0 for BC
 
moin @NikiC
 
I didn't want to be like "hey Chriso (project owner), let me delete all your work"
 
@rdlowrey I was making a Never Ending Story reference :-P
 
but I most likely will for V3 now that I'm a maintainer
:P
 
4:18 PM
@Rican7 there is always this gap between people that have implemented something by using intuition and experience and those who have read at least bit about how to use better practices and apply them
 
@Rican7 what happens if I want to post application/json query for my REST API: github.com/chriso/klein.php/blob/master/src/Klein/Request.php ?
or hell ... what if I post something with foo/bar?version=1.21 content type ?
 
@tereško what do you do when you create your project with composer
 
You have to handle the parsing yourself
@ziGi huh?
@tereško anything else?
lol
 
do you know what actually will happen ?
 
if (!function_exists('function_exists')){ die('WELCOME TO THE VOID'); }
 
4:20 PM
@Rican7 because in pre-5.6 the php://input is "read-once"
 
I guess what they are trying to convince you is to have the class have a single responsibility so basically split it, otherwise you tend to create God Objects
 
I haven't done anything today ... still, feel like I deserve ice cream ...
 
damn
I want ice cream now
 
@tereško Right, the $request->body will still be intact
@tereško you'll just have to handle the collection filling yourself
 
@iroegbu danke schon, content good though? Any elaboration?
@Farkie Job is good, they're wanting me to work toward technical architect ;p
 
4:22 PM
@Rican7 cookies are part of the response =P
 
@tereško just an example
 
Isn't it usually a bad sign when a class has 20-30+ methods
 
@FlorianMargaine this?
 
a lot of behaviors for a single class
 
@ziGi yeah , but things like Request class are kinda tricky
 
For example I am reading the README now and I see that for a `$response object you can set headers , set cookies, redirect, send stuff
 
yea, it needs a lot. I had to refactor in steps
 
In't that too many things, shouldn't there be a Sender that uses a Response or a Request and sends it
 
@Rican7 next step: separate the router and dispatcher =P
 
@tereško yea, said that in my link
 
4:28 PM
heh
also github.com/chriso/klein.php/blob/master/src/Klein/… ... this one is reaaaaly painful to look at
at lot of work needed there
 
Ugh, I hate fund drives. Twice a year, they always make this so stressful. "Hey, Chris, we're going to go ahead and change 20 things about our production code 2 days before processing a few hundred thousands dollars in credit card payments, that cool?"
 
@tereško yea, definitely
@tereško thanks for the quick look and chat spamming, though ;)
lol
@ziGi yea, funny you mention that, I was just explaining that to my coworker:
 
@Rican7 yeah, that is really simple actually
 
... about a 1/5 of people in this chat room have their own routing library , you just linked you yours, so it was "up for a review"
 
Why not reuse
 
4:31 PM
styles differ
 
true, everyone thinks he can make a one that is more comfortable for himself to use
 
also, not everyone used his/her own every time
 
or "better" than the others if they lack something
 
@tereško I linked it to joke about the problem of 100% code coverage, not for a public review ;)
 
there is always @ignoreCoverage or something like that
 
4:32 PM
@tereško Holy shit, that's not a method.
 
@tereško yea.... I think you're missing the point
 
@Rican7 Any public repo on github is up for public review. It will be okay. I find tereško's input, while abrasive, is often the thing I needed to hear the most.
 
I kinda find coverage stats as more of a tool then a goal (helps me see what execution path I have forgot to verify)
 
@ChrisBaker absolutely. I'm just saying I didn't post this library as a link to my best practices, the whole point was to show the fail
haha, the fact that its still the topic of conversation is beyond me
 
Btw do I always have to do
function __autoload($class)
{
    $parts = explode('\\', $class);
    require end($parts) . '.php';
}
to be able to load namespace files or can't I set a global autoloader?
 
4:35 PM
@ziGi you can
 
@ziGi use Composer and be done with it. ;)
 
Are you talking about with composer?
 
@Rican7 it was either that or trying to explain things to @ziGi
... I chose the less demanding activity
 
@tereško sick, dude
 
@tereško no problem thank you
 
4:36 PM
@ziGi Please use spl_autoload_register instead of __autoload
 
QOTD: did some aliens abduct @tereško and replace him with a more considerate person?
 
@Gordon no, the aliens abducted the wrong @tereško and now brought the original back.
 
^
 
hi guys
 
php.net/supported-versions.php - Shouldn't it say "in 2 years and 10 months" for 5.6?
 
4:38 PM
@DaveRandom I'd keep the list() splat thing out of that RFC. That is somewhat harder to implement and in PHP has rather questionable semantics, due to our god-arrays
 
@tereško that was a compliment ;)
 
@FrankLiepert nah it's "until $DATE, which is in $IN_TIME"
 
does any one here has an idea about mysql master master replication?
 
@Gordon =P
I have been trying to work less this week
also, have been doing frontend-development lately
 
front end with?
framework or vanilla
 
4:42 PM
@KevinMGranger Still don't get it ... see 3v4l.org/kEUGT
 
People are like machines, just with much more settings and conditional statements than a computer. Those settings are not infinite but sufficient enough to make us mostly different but at the same time similar. This said, it means anyone can be changed, reprogrammed. We just need to know the right way. And culture is like default settings installed on someone after their creation. We as people are free to overwrite those settings but not many of us do, and even protect them zealously, since change is mostly expensive in nature and people do the natural, go with the flow.
 
Front end stuff always seems to put me in a good mood too, which is kind of weird I guess. More rewarding work, no unit tests.
 
@ChrisBaker you don't write much CSS do you?
 
@ChrisBaker Front end stuff always makes me realize I shouldn't do frontend stuff
 
Loads of css
 
4:44 PM
@FrankLiepert oh I misread, I thought it was a grammatical complaint.
 
I used to build houses, and in retrospect I found that work more rewarding that working with computers. You walk up to a hole in the ground, and at the end of the day there's something to see. That probably extends to front end work. You can write all kinds of backend, it is the engine, but the front end is visual and progress is more obvious.
 
@ChrisBaker yeah, if you do optimization work it is still rewarding since you see increase in % of speed and memory and that is also rewarding but otherwise mechanical CRUD is kind of boring because you know it has to be there and work properly and nothing more
someone gives you data -> validate-> insert/update
someone wants data -> get data -> format -> return
 
@ziGi i dont agree to that statement
 
@Gordon too oversimplified ain't it
 
4:47 PM
@ziGi yes
 
A little too philosophical for the room, probably, but I have 2 kids, and I can say for sure that they have ideas, likes, and personality traits that have nothing to do with my wife and I. My son LOVES trains, I couldn't be less interested in them. No one programmed that, and we definitely never suggested it or even incidentally encouraged it. My daughter seems to take after my own interest in science, so my influence there is obvious. I don't think much programming goes on.
 
@ziGi mostly vanilla
 

« first day (1475 days earlier)      last day (3459 days later) »