Show #193 - 2020-06-04 - Show Notes This week on the podcast, Eric, John, and Thomas discuss testing in PHP, some new proposed RFCs, new hardware, and a lot more.
Show #193 - 2020-06-04 - Show Notes
This week on the podcast, Eric, John, and Thomas discuss testing in PHP, some new proposed RFCs, new hardware, and a lot more.
Show #193 - 2020-06-04 - Show Notes This week on the podcast, Eric, John, and Thomas discuss testing in PHP, some new proposed RFCs, new hardware, and a lot more.
Show #193 - 2020-06-04 - Show Notes This week on the podcast, Eric, John, and Thomas discuss testing in PHP, some new proposed RFCs, new hardware, and a lot more. * [Twitter Will Allow Employees To Work At Home Forever](https://t.co/4NI4Zv1hAc) * [Command and Conjure Remasterd](https://github.com/electronicarts/CnC_Remastered_Collection/) * [Episode 100: The Final Rant - /dev/hell](https://devhell.info/post/2020-05-31/the-final-rant/) * [The Grumpy Programmer's Guide To Testing PHP Applications | php[architect]](https://www.phparch.com/books/the-grumpy-programmers-guide-to-testing-php-applications/) * [Just shaved half the runtime off my tests in CI](https://twitter.com/michaeldyrynda/status/1260096613218840576) * [Microsoft Open-Sources GW-BASIC | Windows Command Line](https://devblogs.microsoft.com/commandline/microsoft-open-sources-gw-basic/) * [Stop Using Sqlite in Laravel Unit Tests](https://www.aaronsaray.com/2019/stop-using-sqlite-in-laravel-unit-tests) * [My new keyboard - Kinesi](https://kinesis-ergo.com/keyboards/advantage2-keyboard/s * [ErgoDox EZ: An Incredible Mechanical Ergonomic Keyboard](https://ergodox-ez.com/) * [RFC: nullsafe_operator](https://wiki.php.net/rfc/nullsafe_operator) * PHPUnit and Attributes * [Suspect Asks for “a Lawyer, Dawg.” Judge Says He Asked for “a Lawyer Dog.”](https://slate.com/news-and-politics/2017/10/suspect-asks-for-a-lawyer-dawg-judge-says-he-asked-for-a-lawyer-dog.html) * PHPUnit order of operations
[0:00] The one time I was arrested I made a mistake not necessary mistake I talked way too much had I read this before I wouldn't have
I think you buried the lead here
you are listening to the PHP ugly podcast and despite what the title may lead you to believe
this is a podcast about the joys and challenges of being a professional PHP developer
your host are three passionate developers who make a living coding and who live stream every week to discuss coating projects work Tech and running a business
and now here are your hosts Eric Van Johnson Jon Congdon and Tom right out I'm here.
[0:54] That's that's supposed to be the ending not the intro.
Oh screw that way I like it I like it gets us through much quicker she's already said our full name we don't need to say it again it's not like it's that important.
[1:06] I appreciate you guys recording early so that she didn't lie about having three,
passionate developers on the on the air right now no problem man what's the what's the deal you can you share your plans I can't share the places I don't know the plans other than
my wife invited me on a date tonight for the first you know for the first time you know in the past few months so her mom's coming over to watch the kids and we're going to.
Probably just go for a hike or something but the chances of me being back.
[1:38] In time for a show tonight was going to be unlikely yeah give it cool ma'am I personally get very upset when the wife goes out on dates without me.
It's very it is annoying that's right.
Some of the guys she goes that's what come on okay so wow look at that the trill aboard lots of trillo cards this is awesome.
This is exciting how's everybody's week it's been weird frustrating welcome to America.
Now get out yeah I get it it's been it's been cool
I mean just across the board it's been
weird world to live in so let's try to stay focused on work yeah how's these jobs we brought up politics once last week,
and look what happened they got better we change the world for the better mmm,
okay working on it.
[2:43] I've been testing you have you have been I saw that in slack yeah I don't like what
what brought that huh you don't like it now,
I got to admit when you first get into it yes it sucks and it's not fun no it's it's very much like them Thomas at first you don't see the point it seems frustrating but then you start to appreciate what you're doing.
Until you get a new keyboard we'll talk about that later we'll get to that point well since my system is a monolith and we're adding testing to it.
It's just functional testing it's not unit testing it's not really interesting man that's all yeah matters,
yeah it's just you know make this thing say okay I've been there I work in a monolith as well and adding tests after a decade of building a,
a piece of software is hard I have to say PHP unit is not great if.
[3:42] There's like a 500 error or something like that like if I'm just trying to check that a page is calling correctly PHP unit doesn't give me a lot to go off in what way what are you expecting and what's not happening so the first big thing was,
that I'm running in a test environment so we've had our three environments before local staging production but adding testing to it meant that a lot of stuff was just not configured to work correctly just because you're not used to having that additional environment right.
And so I ended up with a ton of 500 errors that I couldn't see what the error was because PHP unit doesn't give it to you it just says there was an error now why do you need a testing environment versus a local environment.
Because that gets into the other part is Authentication.
Laravel has this really nice built-in authentication system so you can pretend to be a specific user for PHP unit.
[4:40] But we're not using levels built-in authentication so that was a huge pain in the ass and what I didn't realize is that PHP unit doesn't somehow PHP unit is running as an instance of your laravel project when you run it
so like in the in the test you can login you can force a login as a test user.
And then when you make the get call to your endpoint it's still the same instant so you're trying to do.
You're trying to test your controllers which is a little bit different
obviously yes PHP unit well it can do functional testing isn't really meant to do functional testing right Butler vels idea of PHP unit is functional testing they like when you look at there.
[5:23] Their documentation page it's just functional testing there's very there's there's nothing on there's nothing on unit testing there's nothing on DDT or anything like that or tdd
it's not what dust is though is that what you're using now we're just using PHP unit okay this is it sounds like.
[5:42] I don't know I haven't done any real testing and laravel although we do have a application a green field application that we started.
A couple months ago where we have a couple of developers that didn't do unit testing prior or very little.
That have really taking hold of it in this application because it was basically a requirement and.
[6:06] The to developers on that have raved about their excitement around having all these tests and how.
It's kind of changed from other client work that they've done gave them a better perception of testing having that having the test upfront as Ben.
So helpful yeah it's great now it's just that because this is a monolith and the,
we're not set up for unit testing we were controller heavy it's more difficult yeah when you so the application I work in is the same way we're so much work is done in the controller.
[6:41] Refactoring becomes hard at that point it's only recently in the past few months that,
we've been able to write controller tests because of the just because of the sheer scale of the code base itself unit testing Legacy controllers is basically impossible.
[7:03] You having a framework such as layer of oh kind of probably helps you out there yeah a little bit it's right there it's been all week so it's it's not like it's been easy
so is it is it the fact that you boot up the application you bootstrap laravel when you are you saying when you call multiple,
endpoints you're having an issue because of the authentication piece God I haven't even checked for that I'm just authenticating with every test now but,
I probably don't mean to I probably just need to authenticate on the first test well no you test should live independently.
[7:36] So yes you should be authenticating and every test in my opinion because PHP unit in generals does not guarantee order of tests.
So while you could authenticate in one and assume that they're going to go in order you can't you shouldn't guarantee that are you shouldn't assume that especially if you ever want to get into parallel testing.
Because that was can't that was the other thing too is that we have a helper,
file that that's loaded by the auto load script that overwrites the routes method that laravel institutes and.
Something about how PHP unit is set up for laravel it's bootstrapping larval first and then loading the auto load from.
Your laravel bootstrap directory so it was doing it in the wrong order and I was getting a cannot override method error mean a lot of its.
It's doing something weird it's not like it's just making an HTTP request to pull the page.
It's actually loading laravel up in some way all right it's kind of on a separate topic what what is the impetus for you changing and adding these tests we've talked about it before and you just.
[8:51] Basically I know interest or.
[8:53] Not something you know I've I've had I've had interest I've wanted me to do this for a while I just haven't had the opportunity to and.
My boss gave me a ticket that's it hey update us too.
The latest you know set up for testing and yes sir I'm not to you dogs barking
no that's me is it you it's Thomas so I really don't I don't know what the impetus was but now we're doing it so I'm happy awesome well the more testing the better I mean once you work through these hurdles testing becomes easier,
right yeah as with everything else there's a learning curve you get better at it you can add tests and.
[9:34] Then you wonder how you ever lived without those tests yeah I think everything moving forward is going to be written for testing which is going to be nice yeah moving on moving your logic out of the controller's is going to be a huge step forward in that,
yeah and I think that's part of the overall larger project is we're moving towards,
react and API driven sites I'm going to find out who my dog is trying to murder okay
Eric have you have a question for you while he's doing that well you know I mean I've never seen intro love these orange tickets what is that all about.
Hahaha look at you you're you you have a Keen Eye my friend not only hit other the orange but they also have one with me in trouble now you can actually set the background of the ticket.
So you can send it to an image or you can set it to a color so that's what I say
so you're just trying to make them stand out just for fun yeah it also occurred to me that if we did this as a standard I would know who covered which topic.
[10:36] Not that that's an issue in the show notes but I don't know I just felt like it would be helpful information to have in the if we went back and looked at you all
these are orange it's something Eric or something like that or something you added versus having to go through the history that take a right
yeah well actually since we were just talking about PHP and I've had this ticket on my board now for a couple of weeks and it's kind of Timely.
Somebody shaved half after their testing time.
[11:07] By running PHP unit directly rather than through composer test this is never affected me I've never done.
I've never ran my tests through composer but it's something to think about if that's how you're doing it maybe that's not the best approach that is right I didn't even know you could rush it through composer that's how stupid I am.
I had no clue it either I mean it was a PHP Artisan command to run tests and I don't even use that I still use the vendor bin PHP unit,
and I think that's just habit for me see I do it all through I do it all directly through phpstorm at this point just because it's.
It's so easy to have it run I love the fact that can have it auto run every time a file is saved because I usually listen.
[11:55] Isn't phpstorm using your vendor bin directory or is it getting its own for yeah yeah okay yeah yeah it's running at directly,
I didn't know people were using a poser test but if you are and you're noticing slow down according to Michael during you can shave a lot of time off just by running it directly.
How's composer test even know what PHP ended you well I guess it's stickers it's just it's just a commander calls the vendor bin directory yes a I guess he figures it was just starting us.
Composer is smart and I mean then it does a lot I mean I have a I have commands in there.
That I can run doing composer run some can man I just don't use it all that often well also speaking about testing grumpy programmer.
King of king of testing.
[12:45] King of testing in the PHP world who has a new book out by the way there's the architect what's it called do you remember what's called.
Grumpy program currently testing the that was a very bad intro to that huh.
[13:00] I think of him would have been helpful if you have a title yeah
as he frantically tasted it on his new keyboard which will get to him and are they
were one of the first podcast I remember listening to them and listening to round table as far as PHP podcast go
and then Phil Phil sturgeons where the three PHP podcast I listen to back in the day they finally hit,
episode 100 of Dev Hill and these are low-fat they weren't as consistent with those I remembered I think at one point they took about a year to Hiatus and I'm doing any podcasting but um
apparently they're done it was like they're their last official Dev hell podcast and they didn't say that they would never going to record again or anything like that but that was going to be kind of like the.
They basically allow the alluded to it yeah yeah but it was good it was good to hear from him again and of course it was a great show to well one thing I discovered while I was playing with PHP unit is the use of dock blocks,
currently in PHP unit and that got me thinking about what we were talking about with attributes.
[14:20] The last two weeks that's an excellent place for attributes to be used hmm.
[14:26] Very much so you know you can have tests that depend on tests that depend on tests and.
Stuff like that you can have deprecations and all that kind of fancy stuff you need.
And I wouldn't be surprised if the next version of PHP unit uses attributes I mean it makes sense it's just a natural evolution of PHP you know it's funny I just interviewed Derek for,
this month's issue of PHP architect oh I that would've been a good for a question or have form for Community quarter yeah yeah,
yeah ask him a bunch of questions I wish I had thought of that one Thomas I would have been a good question to ask I think I think I do ask something like what what's the future hold for a PHP unit or something like that but yeah I don't remember,
I definitely didn't ask that question I didn't need to share this I'll put it in the trailer.
On phone burner I've often been very confused on testing because I used dock box a lot with at before.
Versus setup because if you use traits it's a lot easier to create methods and have a nap before.
Dock clock on there but what comes first the dock blocks that the Apple for annotations the setup the setup before class.
[15:45] So somebody took the time to figure out which what the order of running these methods is and running the app before in your traits is before the.
Parent it there's just a whole ordering here and that's always been confusing to me so I'll share that in the show notes page on what you've rearranged your office,
I have you look it looks much cleaner that's because on the other side of this door over here it is an absolute mess,
I've got this little eight foot by six foot basically cut out of an office here and with us closing down our office you know I wanted to bring,
my desk from there into here.
[16:29] I was going to put two desks in here but once I started put put things back together I realized it's really nice having it opened up and not taking up every square inch of this place so.
I'm still in the middle of setting it up I got my my desk back here which is a very desk which I like a lot,
got it back here everything was fine it was a standing desk so it was going up and down just fine and then all of a sudden decided to stop and didn't stop in the standing position of the sitting position.
In the middle awesome so literally it's no longer a desk it was literally in the middle I spent probably a good half hour trying different things finally look up instructions figured out how to reset it through,
the key combination got it reset it started working again I was happy and then it.
Stopped again this time at the very lowest position so I can at least use the desk it's lower than I want it to be but it was usable IP,
this is over the weekend I finally called them on Saturday and I figured it was a one-year warranty you know we bought it a year and a half ago when we open the office.
[17:37] Five year warranty they didn't ask any questions we're going to ship you a brand new desk so.
That should be here next week what you can do with the old one send it back they do want it back oh yeah that was only one option two.
It wasn't too far off of the title John it's cause the grumpy programmer's guide to testing PHP applications are available today on PHP architect.
[18:02] Web site so look at you cross-promoting amen it's my world now you know I got a question for you John yes the project you were talking about that,
uses the you the the developers are using test I didn't know one of those developers posted,
and our slack Channel stopped using sqlite and level unit test do you.
Do you know what prompted that that wasn't from my application it wasn't oh okay no no that was not from that was not from the application I worked on okay I keep me that asked him about that and I have them
that was from the Greenfield application I was talking about earlier they were using SQL light it's a common practice just to speed up your test.
But there are differences between SQL Lite and MySQL and if you're not aware of them.
[18:53] Your test could break mmm I don't wear or not private think is the issue is it I don't know I haven't,
delve deep enough into what was going on to figure it out it's a typecasting issue yeah well I'm sure SQL light actually has the ability to do like Json columns like my SQL.
[19:11] So maybe that's but that would break the test so I don't know if that was the issue the issue that I've seen is that if you have a if you have a type,
integer and you try to put a float into it my SQL will complain but sqlite won't there's also issues with
string length not being correctly applied to things.
And foreign key relationships not be incorrectly applied I don't think it's a I don't think it's necessarily need to stop using you it does like
the title suggests sits right it you need to be aware of what's Happening.
I still think SQL Lite is a good option to use for your test if.
If you're being careful I agree yeah and just knowing what the differences were okay cool I was just wondering if you knew anything about it.
Okay can we talk about the elephant in the room here because.
Fortunately we don't have a lot of people talking to us and Discord because I honestly couldn't reply to them right now,
II posted on Twitter earlier this week I'll try to I'll try to position my camera oh my God that is a I got my absolutely hideous keyboard.
[20:27] No no all right let me tell you first off this feels so good,
as far as typing goes I have never felt more comfortable on a keyboard that I do this keyboard so I got a new how do you pronounce this John.
It's the Kinesis advantage to Kinesis advantage to and it's this,
completely ergonomically correct keyboard for people listening to the podcast I'm showing it on the stream for anybody interested.
[21:00] It's extreme it's very extreme now I'm a big guy I have fairly large hands my favorite keyboard in in the past was this big Microsoft.
Ergonomic keyboard and I enjoyed it I then moved over to this I still have it actually plugged in
stas keyboard and you know it's just a regular keyboard I mean it's just a regular layout but but you know I was having issues with my wrists and my,
you know just basically my wrist so I wanted to give this a try,
my God does it it has really slowed me down these last couple of days but I'm gradually getting better.
[21:44] Um the biggest thing you can see is that first thing the the keys that the left and right side of the keys are physically,
separated pretty far and then there's this concave of keys so your hand fits in here very comfortably the one thing I really like about it is things like the space Barn into bar or down here by your thumb.
So this is nice what I don't like about it I like a lot of the key combinations I don't even think about how I do them.
Open up LastPass keep singing bass bass the open up one password or to snap my windows around.
I don't I couldn't even tell you what the key combination was and they're completely wrong on this key where like I can't use they're not wrong they're just in a different position.
So position for the for the podcast only listeners this thing looks like it's the size of a skateboard it's fan.
And it's got these divots on the far right and left side where half of the keyboard belonging and then it's not just economic keyboard it's explicit fine metal plate.
Yeah it's a split design ergonomic keyboard.
[22:54] It's actually very light the what you get did you get the foot pedals I I saw that I saw them I'm not sure what they're used for if I didn't get up so so one of the first things I did.
Because I'm a Vim person and I am I use the Ctrl key a lot between them and TMax is on here the control is this one key,
on the right-hand side of the keyboard.
[23:21] So on the left hand side where the cap locks is I actually remap my cap locks to control I think John actually has this exact board I think you re map just Apple no I haven't remapped it at all.
You can you need to upgrade the firmware on it and there's a new setting.
Where you can do it based on how long you press the key so it could be a caps lock if you just tap and if you hold it down caps lock it becomes a control key oh
I might have to do that,
or foot pedal fur if this is a total programmable keyboard it comes where you can do it as a QWERTY or Dvorak keyboard,
you can remap the keys as much as you want you can also record macros so if you are often typing the same thing.
You can set it up through the keyboard to do it.
For you which is really in the really nice thing about it is all that programming of the keyboard is in the keyboard so if you change computers everything you've programmed in the keyboard goes with the keyboard.
So all those mappings and stuff.
[24:25] One one of the things I didn't realize that that really messed with me and if you're if you're a developer you if you type regularly you know,
but on a typically he board the keys are tipped each row is typically offset from the row on top of it so like.
[24:44] To go s to X it would be you have to go down to the right a little bit but on these keyboards all the keys are in a line so so X is directly under s.
[24:57] That really kind of takes you really have to start to trust yourself with your typing and where keys are its.
[25:05] This is brisk keyboard is proven how bad of a typer I really am because right now.
I think my right hand was always off by a key like my home was hjkl
because it because that's the movement keys in them so my fingers were always off as is and then that's just that's probably the biggest thing along with.
My left thumb I think there's a majority of my spacebar so just.
Yeah completely threw me off the first day I had it I got to a point where okay I've got to get some work done and some videos I watched afterwards like don't.
Just make the switch when you have work to do waiting because you're going to be so frustrated that you get to throw the thing out the window I hate way totally feel that yeah wait till you have some time to dedicate to learning it.
[25:54] I think the same is true if you were to switch to the Dvorak layout a divorce I don't know how you actually pronounce it but divorced Devora
that's our pronounces to worry yeah,
I've actually wanted to switch to Dvorak for years the reason I don't is because,
all the research I've read on it it's such a better layout in so much less stressful and you can type so much quicker I had a friend I worked with years ago who swore by it.
In the only reason I haven't switched up because I'm not a great type of either especially back then and even now yeah I wasn't gonna pick sort of hyper so I figured I could teach myself Dvorak just as well as I was on the Corti
the reason I don't switch it is because,
so many other keyboards are Corey I don't want to be tripping over my fingers like when I go to my parents house or something like that because it's not
it's not super simple to switch between the two well there's been from what I've read yesterday because of this keyboard,
there's been no real scientific research showing that Dvorak is any faster than QWERTY oh really.
[27:05] Yeah it's mostly it's mostly and it's mostly anecdotal,
nothing nothing showing that it's actually any faster yeah it's like those studies about Vin don't start I even I mean I I find myself
I'm so happy I use them you can say what you want Thomas because I find myself wanting to leave the keyboard less unless I wasn't a big fan of reaching over from my mouse before.
That's why I had the VIN plugin installed on on my browser but now.
I'm so comfortable here and so much is accessible to me I really really don't like reaching over for my mouse now it's so frustrating to me.
But yeah this it's we're going further and further backwards in this this Computing age where you've got this gigantic steel like steel slab of a keyboard.
No more Mouse this Q gonna look you know what miss this keyboard is is.
[28:07] It's a little smaller than my previous keyboard.
[28:11] We're going to have you running tape backups soon for everything instead of cloud backups listen tape backups are awesome mmm I'm the hippie of the digital age but,
well I just I yeah I don't know I don't understand why you fight it so much but.
Well actually because I'm looking at building,
an ergo docks keyboard is thatthe is that is that the 3D printed one that is actual separated keep keys so yeah sometimes it's 3D printed but it's split into it's,
completely separate two separate.
[28:48] Pods it's actually three isn't it there's the left the right and then the thumb the thumb is its own Center pod
okay so I haven't seen that one but there are a lot of designs out there of course herb no doc keyboard.
ERG Odio X boa if it's one of thinking of again and doing a lot of research for this camisas one,
I saw that and that's one of the one of the complaints that they really want to see Kinesis offer that option of a truly split keyboard so the thing with the Ergo docs is that,
you can buy all the pieces individually and make your own looks like the key layout is exactly the same though
I'm going to sing that as a negative I'm seeing it's the exact same key layout is as this that's very similar no it's not very similar it's exactly the same,
I'm looking at it well it uses a Teensy 32 chip and,
I think it has basically the same feature set yeah so so the the one thing the one thing I did notice although the keys aren't marked it's funny John I don't know if you ran into this yet.
[29:58] You know in when we're coding in you're doing where you have to what's the rocket called the equal.
[30:06] What's that called the fatter is that equal to yeah.
[30:12] It took me like 10 minutes to find the equal plus symbol on this yeah it wasn't really what is that supposed to be.
I noticed that as well I was frustrated because I thought I was going to have to switch to the to the keypad every time I wanted to hit the equal sign and I'm like this is not going to work for counting
I realized oh it's on the left hand side at the top here.
Just under the Escape key that's awesome yeah but you haven't you have a contact in common a person in common that uses keyboard that swears by it as well.
[30:50] You and Thomas do oh what's that or who's that that's that's right your boss uses at Jose but he uses an ergonomic keyboard and didn't offer me one he uses this keyboard and he even said.
Give it a couple of days you'll get you'll get fast and I've already felt my speed increasing like the first day was horrible horrible but I will say I used it for 24 hours straight like I had made the decision.
[31:18] I was going to use it for 24 hours for sure and,
I was I was still struggling by the 24th hour but on the 24th hour I was in the middle of doing a reply to somebody I'm very,
lengthy reply to somebody in,
Facebook no less I was telling John it posted to Facebook for the first time like two or three years and I've decided you know what I need to pound this,
sponsor this is taking too long I reached for my other keyboard which I still have plugged in and then I'm dripping all over myself there's like I couldn't figure out whether the employees were anymore it's only been 24 hours and I slowed down just as much so I was equally shitty on both
But it's getting there I tell you just just I find myself constantly resetting because I try to get ahead of myself and I find my,
I start doing what I do on on a normal keyboard which is I typically hover my hands and then start picking and finding stuff.
[32:22] In this keyboard you really need to be in that position and just trust your fingers and just move them up down just a just an inch
hit all your keys and I constantly find myself resetting and putting my hands back on the keyboard where it belongs.
And just you know trusting and imp you're just trying to get that confidence and typing but I tell you the biggest thing I love.
Is on a normal keyboard
I was always accidentally because my fat fingers I was always accidentally hitting the enter key when I was either trying to do a quote or a single quote I was always sitting in Turkey I that is completely not an issue on this new keyboard,
with that in Turkey is is perfect it's like one in on the thumb.
[33:07] I never remember accidentally hit it or have an excellently hit it hissing that's that's been that's been another complaint of mine is I'm used to that enter key being over on my pinky and just like hitting it and nope not there,
see that that's that's one of the things I'm starting to try to use that historically I haven't used for typing are my pinkies I'm not a pinkie typer.
[33:28] And now I'm trying to train the train my pinkies and to say okay you know this is,
to work mouth stops laughing you gotta be yes sir you got some stuff to do here,
all right enough about keyboards story came across Twitter not about PHP going back to basic politics and crap that just floored me that I just thought I would share it because.
Again I had no clue that this happened,
back in 2017 actually you know that if you're arrested you shouldn't have talked to the cops the cops are not your friend
Audrey yes I've had to explain that to my daughter she didn't understand why right I totally agree with that yeah.
The one time I was arrested I made a mistake not necessary mistake I talk way too much had I read this before I wouldn't have thank you buried the lead here.
You like that but if you ask for a lawyer.
They have to stop any questioning until you have a lawyer but it turns out there are ways around that for the cops that absolutely just mind-boggling me where you could use,
very normal vernacular for where you're at back in 2017 somebody said I want a lawyer dog and that's perfectly fine binocular.
You're you're trying to say.
[34:57] Hey I want to I want a lawyer but because he said lawyer dog and the way it got chance cried in bye,
in transcription in the courtroom.
They actually wrote lawyer dog Gog it went up through the course up to the Supreme Court who refused to hear it and upheld.
Whatever the court below them is as if the person really wanted a lawyer dog and not a lawyer yeah Noah literal lawyer dog not even a dog lawyer so.
[35:32] My question when I read that are and I'm think I'm on board.
With what you're saying John there is no reason for a misunderstanding it's not like that was.
That weird of of wait to speak.
[35:49] But my bigger question was what if the person can't isn't able to speak English it's like and they asked for a lawyer in another language.
[36:00] Well I think if you if you can't speak English they're going to find a translator because you're not gonna be able to incriminate yourself anyway.
[36:08] Write in English at that point I think the whole the whole point of the message is be very clear.
[36:15] I'm not say anything I want to talk to you later alright I want to invoke my sixth amendment rights and I want access to counsel or I want a lawyer.
And that's it don't see any any more or any less another similar case was came up where somebody said.
I think it's time to speak to a lawyer or more no I think they said maybe it's time to talk to a lawyer almost like it was a question or it wasn't it wasn't a firm it is time and then they said some other things that,
we're then held against them so it's just being very clear especially with what's going on in the world right now
be very clear well hopefully I'll talk to him later hopefully with what's going on the world right now this won't be an issue again because police well I mean police reform is the big deal right now
and what they're doing and getting away with is.
Bizarre I mean horrifying but not when it's coming from the top the things that are being said from the top or just absolutely,
I will we'll have to see till it's telling telling Governors to rule with with might like dominance or dominance you needed Dominator you're going to look like a fool that's.
[37:29] Yeah but that's what's that's what's leading to this is that's the way the people are acting that's not how you treat your citizens not in the US so Thomas you got into it in our slack Channel this week and I was I was a little.
[37:42] What did you get into it with did I'm on the show about it yeah somebody had posted about an RFC that's being proposed see I see how a transition that
that was not a very good at that was that was not an Elegance segue at also somebody had posted about a RFC in the in PHP for null safe operators and yeah,
I saw it I'm like wow that is going to clean up code that looks really nice I like no you seem very much against it,
yeah it's going to hide errors I don't think it's gonna hide here's why how do you how do you think it's going to hide errors so this RFC allows you to add a question mark before the pointer on an object.
And if that question mark is there and the object being referenced doesn't exist then it just returns null instead of giving you a.
Undefined property or method on null,
error and boy I couldn't tell you who this is for except for lazy people who are coding poorly I'm out it's going to be great in the Legacy apps it's
if I says can be great and Legacy apps as we get better and better with type hints especially with return type hints,
it will become less of an issue but there are still so many applications so many methods that return an object or false or null.
[39:10] More as a as an early Escape Plan they just returned out of the method so it's basically avoid or no right but they shouldn't,
do that that's my Issue Number issue number one is that shouldn't ya objects should you should be throwing an exception When You're Expecting.
An object and get null instead and number two is just the examples where they chain this,
three layers down session user get address country if there's a failure here you don't know where the failure occurred is it,
was it the user that didn't exist or the get address method that didn't exist or the country that wasn't set or maybe country was null but the user account wasn't defined like maybe null is a valid country but here.
[39:57] So now you've you've pushed your error of a missing user on the session further down the stack where it can do even more dammit but there are times where you don't care where the error happens you so.
I brought this that's a smell is so the person that brought this to my attention.
Their comment was in a perfect world with well-designed and strongly typed PHP maybe it isn't as helpful and it does seem to encourage breaking the law to meter but there are lots of places like fetching a single entity from Doctrine where it'd be really nice.
So you you're calling Doctrine with we it will return a collection or null and if you're not catching it.
PHP throws an error so now you your you'll get back a annul item versus.
A collection yeah so you check your record first.
[40:50] You're adding additional code at that point they will but I need to I could implement this exact same functionality by just putting an ampersand or an at sign,
in front of the call so when it returns null silent stare.
You're doing yeah I doing the exact same thing you can't silence a fatal error though right is is calling on null
a fatal or is it an exception at just tell you press is error messages it doesn't stop from actually throwing an error I think that's the distant notice
it's just a notice yeah trying to get property of non-object and if you add that you get back a knowing that object or that variable yeah because there's no return no it can't be just a notice it's got to be a fatal error,
yeah I run into that often where its execution is halted at that point well I just did it in Tinker so Tinker might be suppressing it somehow where I swear I see this being useful is especially where you
calling a long chain of methods where when you expect to get back something maybe you'll check that for knowledge or not but.
You don't care where along that chain it broke and you don't want to have to say you know after every single argument hey did I get back that object that I was expecting or not mmm.
[42:09] Because that's just going to add to a bunch of if this is no then do something if this is null then do something
purses checking at once afterwards I think there are pros and cons to it yeah I'll admit I didn't see the cons until you guys started talking I liked it like when I saw that I'm like ah yeah that,
that because I still do this too and I'm like yeah I like that and that looks very clean but I do kind of you kind of see what you say even Thomas's point of.
[42:40] Of hiding where where the failure is at it seems legitimate to me but.
And I'm creating item equals new standard class D D item thing.
That's different though you're calling item thing on a class that's different than saying dollar item Arrow something,
without item with where item is null okay so that gives me trying to get property of non-object error exception right if I throw an ampersand or thrown at sign in front of it she still get that.
I get no I feel like it's an option if that's the case then this RFC means absolutely nothing.
Correct which doesn't make any sense which is what I've been trying to say this functionality already exists.
[43:23] And it's using its exactly duplicated their why is this coming up any other City maybe there's a better use case whatever but because
this is a special kind of error suppression this is a new kind of error suppression but all it is is an error suppression an error suppression is a code smell
I guess it makes the code Tighter and leaner,
but it does so because it's suppressing potentially and it doesn't errors or it's appearing to throw an error,
when there shouldn't have been one because null and null are different you know due to an exception and null due to an expected result are two different things so now
like I said with the country if you're expecting that the country may be can be null on a user account,
but it turns out the user account just doesn't even exist now you're getting what you expected to be null for a null country but not realizing that you've just skipped over three errors.
And Chad what's the name here Eric yeah Eric.
As is this similar to layer of optional I don't think it is because optional first thing I'm not sure if you can chain optional but optional is just that it says hey.
Yeah this if we have it use it if not.
[44:40] You know it's not a problem it's the same thing that sounds like the same thing though that that actually came up in.
Our slack channel of somebody saying optional optional optional yeah.
When we're talking about this exact thing so it sounds like it's very slick it sounds like it is yeah this is this the same thing as optional
there are plenty of existing ways to handle this you could make a programmatic version,
that just said or null and it checked every you know this is dumb this is a are you saying optional can be changed as well oh I see what they did optional.
And then an optional inside that is horrible-looking sure it's horrible looking but this what is the intention here because it doesn't clean up code it just obvious Kate's it doesn't.
[45:30] Prevent errors it just obvious Kate's them I mean this is it will so
I run into this often enough where I get something called on a null object I do have to go fix the code absolutely because it means that there's an error yeah
I get it all the time all the time I have it all the time I get a null object error and that means that there is a bug and I have to fix the bug what war or or check,
or check within the chain prior to calling what possibly could have gone wrong
right because if if there's if you're getting null and you don't expect it then you're not handling the null case
yeah this this would come up a lot using third-party libraries where if they're not doing strict typing they don't have good return values like if I wanted to I could see wanting to use this
in that case we're okay but then take the case where you have a crappy third party that is using this functionality,
and stops throwing errors for stuff you needed to throw errors for this this is a tool for bad programmers explicitly.
It means you're not validating your data or you have a bug and you're not addressing it all right I think you've changed my mind.
[46:40] There is no there's no there is no valid use case for this at all CIU he changed my mind because I used to think the same thing about the app operator again going back
20 some years ago you threw that operator everywhere because you,
they care about because you're at now if I saw that I would scream at somebody,
what are you doing this doesn't belong here so okay you've changed my mind yeah I mean I will record anymore let's wrap this shit up I've heard it.
[47:12] People saying well what about these expansive applications that receive Json data that's not
necessarily formatted the same way or its formatting changes or whatever well then you're not validating it you're not validating your incoming data so that's your problem you have to fix that or.
[47:29] You know if you've got something that.
There might not be a user there then you need to check for that and handle it but there's no I have not seen a good valid example of where
a good programmer would want to use this buttered crumpets disagrees says that if you're a good programmer you can fix bad programmers clear because you can now find it,
I mean it's so it's just start and we search for the apps search for the yet operator or search for search for bad.
I don't know search for to dues to me this is a to do hey.
It's like that but all the examples all the examples I keep seeing our are well you know inexperienced programmers will use this a lot.
Like good so they'll get into a bad habit we're going to promote a bad habit and this how this hasn't been accepted this was just an RFC so it's time to even.
Necessarily something that's coming it's just something somebody had suggested so this is interesting because it came up in our slack and whenever you have a strong opinion about something I like to bring it up on the show so.
Well and the in the RFC itself the example it says is currently checking for no leads to deeper nesting and repetition which is like there's a Assumption of wrong assumption number one.
[48:52] Is that you would have to nest in order to check the full depth of your.
[48:57] Your object you just it's replacing validation with a shrug yeah I don't really care that much.
[49:07] So Thomas you would have enjoyed ad John I just got off another another recording we recorded our interview for PHP architect this month.
Yes this month yeah it was with Eric man he's the person who writes the security Corner article for a PHP.
[49:29] Yeah that was I mean I don't know Jon how you felt about it but man that was a great interview.
[49:34] Yes I agree yeah he's always he's always been a good speaker I think that's why he's done so well,
at conferences he's been able to write so many articles for the magazine over the past few years and I said that to bring up the point that he said.
He mentioned that if you don't if you don't do anything else with your web browser.
[49:57] Install Adblock extension and install an extension called privacy Badger from EF F Technologies.
Are you familiar with privacy Badger Thomas I'm not that was just that was like his number one recommendation especially for people working from home yeah.
I want to give you a heads up had we had more time between recordings because I would like to your input on it but I have the tab pulled up.
[50:22] It says privacy Badger automatically learns to block invisible trackers stead of keeping lists of what to block so somehow I guess it has some sort of AI behind it,
I don't like to use or 1080i it may don't use the word I but it's a learning sort of.
What else are doesn't it doesn't send any of your information back to privacy Badger for for it to learn anymore.
Mmm so what damn it's one of the sisters just notice what it says here is that it sends the do not track signal with your all your requests.
[50:57] And if if it sees a website ignoring the do not track signal it will add it to a block list hmm.
Yeah so I have a cute up to install he mentioned that and then we asked a lot about Security on like communication my big grape was email.
Bad email was and how I completely failed with getting my family around idea P GP GP which the world the world couldn't get their head around pgp so
I mean I tried at am I try that doctors offices back in the 90s and I kind of get Ben to do it so.
Ticket people that deal with really personal information you're not going to get your average user saying hey can you pick up a gallon of milk on your way home.
To do it but he did mention that he's a big supporter of signal for instant messaging so I think what I have that I don't use it.
[51:56] But I have it but I think I might have to see about maybe turning the the girls my daughters and my wife on to it just to have a little bit more security and I communication.
So I just gave away all the all the interesting talking points we had on the other podcast and nobody's looking you can just listen to this podcast now I'm just kidding,
subscribe to the magazine please especially because he says if way more eloquently than we just did.
Oh yeah I mean he actually seems like he knows what he's talking about instead of us like regurgitating things we overheard that is helpful.
Yeah so all right I don't know I have we I mean feels like spinning our has it been an hour,
it's just been that just been under an hour I have shown over but hey whatever hmm I have an interesting thing and this is not necessarily PHP related but.
[52:53] EA has released command & Conquer remastered code onto GitHub what's that what's that mean.
Command & Conquer was an old video game that they just recently remastered as.
A new release and the full source code is now on GitHub.
As released by Electronic Arts is open-source I mean King I compile it yourself or what I could have sworn I had something similar to this on.
The Trello board and I don't don't see it there so good Segway Thomas thank you for sharing that yeah it's under the it's under the gnu.
The GPL okay Thomas have some trail oh no I have something similar not that.
[53:36] Oh Microsoft open-sourced gw-basic we have talked about that bass did you ever program in basic back in the 80s and 90s,
a kidney Iraq basic man named a over to make its comeback,
they made it open source like you can you can install it with go twos and data commands and all that all my this.
This was how I learned to program when I was 10 years old and I still I still have my reference manual,
where when I was first learning to program I would just flip through the reference manual and find a new command and be like oh.
Let me try this and then I would I would test it out are you sure right now Coco Coco Computing magazine and it would have pages of basic programming that I would then put into my.
I would I would copy into my system and it was awesome.
I know it's how I saw them as like just floored they're not they're not accepting pull request it's on GitHub but it really was just a hey here it is for historical purposes.
You know do with it what you will well I don't think they'd have to worry about pull requests anyways because it's not written in C,
what is ASM I don't even know what that is assembly yes.
[54:59] Is that assembly this is Assembly Language yeah oh my God so if you if you were to pop open first off.
I'm not sure how they did this.
[55:09] But it does say that the initial commit was 38 years ago you know you can you can change your commit history easily okay,
you've never seen people do that to change their little commit message at the bottom to say like hire me no yes I have I thought that was done differently.
[55:29] He's awesome you change your can your commit history so yeah it's it's raw assembly and boy I couldn't tell you a single thing that this does,
it's all it's real common and it tells you what each line does it's perfect but yeah this is this is insane man this is how people used to code
how machines used to code if Euros yeah this just it was just a bright spot when like just made me think back to my my childhood and made me happy,
told you man Microsoft's going to go going to go Linux,
feel it we talked about on the podcast today pay attention pay attention to the interview coming up in the next month mmm.
Yeah yeah I think I think we had predicted Microsoft was going to buy you but to but it hasn't happened yet okay I think that's that's getting me I'm.
Suspiciously tired I'm way too sober to be talking to you guys it's.
[56:32] Too much light outside yeah we're supposed you're supposed to start early when you're podcasting isn't that the rule.
So dirty that you did Oh Sees this is the first episode in history of her John's drinking and neither me or Eric we're setting we're setting new records,
I feel shameful for some reason I don't know but hey,
okay all right what great before you wrap up know before you wrap up just so I can clear this off the board because it's stupid Twitter is allowing all employees to work from home forever,
I bring that up just because I went to the dentist office for the first time this morning since all this crap has happened and talking to them they're like,
you get to work from home like I have been for many years it's not new so Twitter made the announcement that from here on out employees will be able to work at home forever if they want to,
so that was interesting weren't you I mean maybe it was just me I was surprised to find out that that wasn't the case for them I'm not shocked because a lot of the big companies Facebook was very adamant,
it would not allow work from home they just made the the switch recently as well where they're going to allow a portion of their Workforce to work from home.
[57:48] From my understanding most people don't want to at Facebook I don't know if it's because they just they're used to going into the office now.
Free food I don't know but Facebook was very adamant that they wouldn't hire remote you had to move to their office locations in order to work more on so maybe things will change.
[58:11] We'll see how that works out for them the 90s revolved around this idea of everyone's going to be working from home and telecommuting is going to be the future and so many tech companies jumped on that,
like Cisco and the turned out that none of the businesses wanted to allow that because it just disrupted things too much so now when it was mandated upon every business.
[58:36] We've got these tools to do it and the businesses are saying well now that we're here and we can close down three of the five floors that we rented a high-rise that's going to save us a huge amount of money,
so I'm totally fine with teleconferencing could you imagine 25 30 years ago where you didn't have the tools you have now for communicating with people,
it would have been completely different,
it would have been fundamentally I mean I would say 15 years ago wouldn't have been possible when you're talking about half the people having dial-up connections and and flip phones,
now it's I don't even need a home office I could work off of my phone from anywhere mmm,
well I think there's only part of it I think it's a big part I mean having having the technology around to allow it but I also think that companies didn't want to invest.
workflow figuring out what the workflow on making sure people are working and how how to you know how to track,
how productive somebody's being if they're not there at the office and we had we had that issue still I mean that's not never gonna go away you still constantly wondering am I paying somebody to
sit around and do nothing right now they watching TV or
playing games why do you never get it you're never gonna get away with that's that's why some some companies still don't want to do it right because they say if nothing else there at the office right we know we know their business here but I think
that this this pandemic,
force that issue a little bit and they realize that they oh yeah we can put some metrics in place to track their performance to track that they're being productive
they mate Maybe.
Coming comfortable with the idea of yeah I don't care if they're watching TV in the middle of the day as long as they're producing.
I'm fine with it and I think not to get too crazy socialist on you but it's empowering the workers as well to say.
[1:00:45] I'm not going to an office so you know when when you're looking for a new job.
Or something like that you're going to get a lot more people saying I work better from home.
My systems work better from home I have a smoother workflow I get stuff done that I need to get done and I get work done I don't spend two hours on the road for no reason,
right because if your commute like my commute from from Encinitas to downtown when I was working there could be an hour and a half each way
easing so why am I throwing away three hours of my day every single day to sit in an office where I could do the same thing at home that's a waste of my time it's a waste of the company's time
I could be doing so much more working out or working on hobby not doing those things but I could be,
I think they also realize that you know people with family.
[1:01:40] Your kids get sick you get sick but if you work from home your tolerance is a lot higher like,
I have to be really sick for me not to work from home or my children aren't young now but if might even my children
you know we're young if they were sick and I work from home I could still be productive yeah maybe I'm not working a full eight hours but I'm definitely yeah I could probably give you six or seven hours I just need a little bit more time with the sick kid quiet and listen to the doctor.
And you're not going to get sick as often,
the flu is not going to sweep through your house and disabled half of your workers yeah yeah I mean there's always been pros and
and cons to it and I think what the pandemic did was forced the hand of looking at some of the pros and trying to figure out you know stop using the cons as a crutch for not trying to implement
workflows that can help.
[1:02:38] People work from home and it kind of force these companies hand do that and like you said I think some of them are seeing the benefits like hey
yeah we don't need so much office equipment we don't need so much office space we can shrink these things save money and yeah I don't know we'll see well we had a friend number of years back who whose.
Business mentality was no work from home doesn't work for Developers.
There are some people that can do it but as a corporation I don't think it works out that well and he is now a huge advocate of work from home Tech so somebody I know yeah from the
the building where we would meet up in Carlsbad right oh yeah.
Yeah adamantly against work from home and is now a proponent of work from home Tech,
and I think is even working with startups that specialize in work from home Tech so he's actually working with the our most recent host firstly PHP if we're talking about the same person,
I'm sure we are,
I believe we are yeah I wasn't gonna I was gonna get that specific with it but yeah yeah so I you know mentalities are changing even at the higher levels even at the the.
[1:03:56] Advisors levels so I'm excited for it and,
you know I've looked at LinkedIn and jobs like job sites like Lair jobs and it's 90% remote right now because no one wants to open up,
and create a nuclear meltdown pandemic so that's weird why not I don't know it's some liability thing I imagine weird yeah.
[1:04:22] Alright okay are we done now can I wrap up yes bring us the patreons hmm
shit I forgot about the Patriotic I should head that up though I'm your ex-wife's that's why I said it that's why I posted patreons.
There we go he's still our patrons for supporting I show we don't.
We don't talk about you guys enough and we appreciate it but are you since you're listening you are still officially the longest running patreon supporter.
[1:04:52] Em I think Jeremy and I have talked about it we're going to get you something I'm gonna I'll reach out to you for an address or something.
Our Willow Wilson some International,
swag your way so I said it now it has to happen I appreciate it oh yeah I was supposed to harass you about sending out the key chains this week I forgot yeah I know I need to have the box in my garage I need to kind of
actually I don't I realized I don't have it in my garage I thought it was the box I brought home and put in my garage but I did take a couple boxes from the office.
And put it in my storage unit and I realized when I went into my box in my garage.
[1:05:33] That I didn't have swag in that boxes in the goddamn storage units and I got to go there and get the swag from that but yes you're right I do need to I need to get that out,
I'm slacking okay that's it I'm done talking to you bozos it's way too early and I got it I got things to do so.
That's going to do it for a pisode 193 appears basically we are thank you for joining us early.
I appreciate being able to be on the show the people who watch the live stream the people who listen to audio you know it's probably like the same drive to work that you're listening to us so it doesn't really impact you but yes.
I was going to say something oh seven episodes guys seven episodes 200 I'm just saying if we record an episode a day for the next week we could get there.
[1:06:25] I'm Grace they would be Grayson's birthday at that.
[1:06:28] Perfect really perfectly see everything lines up and maybe that won't turn oh yeah nobody listens to do a 7 hours a week,
we're getting close I feel like I want to I want to get there because I feel like now that the country is going to fall apart before it happened I think I think we should take a few months off.
[1:06:48] I say we get to 199 I just like give it a Hiatus for about 6 months.
[1:06:54] All right this is one maybe three is in the book I'm Eric I'm John I'm Tom keep it ugly thanks for listening to the PHP ugly podcast.
If you would like to support PHP ugly check out our patreon at www.pedestrians.org cam PHP ugly
you can also follow PHP ugly on Twitter at PHP ugly or join us in the PHP ugly Discord Channel,
show notes and RSS feed can be found at PHP ugly.com.
To catch the live stream be sure to subscribe to our YouTube channel at www.youtube.com PHP I Glee
you can also subscribe to the edited podcast on iTunes Spotify or your favorite podcast catcher of choice a reading of five stars is always appreciated,
and finally thanks to our sponsor the Diego Dev group if you are looking for developers who care about the code they create
the communities they built and the solutions they Implement then reach out to the Diego Dev group at Diego Dev.com.
Until next week keep it ugly.