Coding Blocks - Clean Code – Writing Meaningful Names
Episode Date: September 28, 2016In this episode, we take our first dive into the book Clean Code by Robert Martin and specifically we talk about writing meaningful names for all things code related. You’ll be amazed at how follo...wing some decent rules that you can start naming things that will help you and fellow coders understand your code at […]
Transcript
Discussion (0)
And ready when you are, sir.
I believe.
I can fly.
I believe.
I can touch the sky.
I got two R. Kelly wannabes up.
Wait, that's not.
Is that R. Kelly?
It is.
It's like a seal or something.
It might be seal too.
I didn't like him.
I don't remember.
All right.
You're listening to Coding Blocks, episode 47.
Subscribe to us and leave us a review on iTunes, Stitcher, and more using your favorite podcast app.
Visit us at codingblocks.net where you can find show notes, examples, discussion, and more.
Send your feedback, questions, and rants to comments at codingblocks.net.
Follow us on Twitter at Coding Blocks or head to www.codingblocks.net and find all our social links there at the top of the page.
With that, I'm Alan Underwood.
Easy for you to say.
I am Alan Underwood.
Sounds like a robot.
I'm Michael Outlaw.
And I'm Joe Zach.
Right, and Joe's not with us today.
He's got some things where he couldn't make it today,
but he will definitely be back with us on the next episode.
But we will dearly miss him, as I'm sure you all will.
So we apologize now that you only have to listen to the two of us.
Yeah.
So, no, we don't apologize.
No.
The third dynamic is gone.
It does stink.
We're not going to have all these weird interruptions
and all that kind of stuff or maybe we will we'll figure it out yeah um so the thing that we like to
do here is read off our itunes and stitcher reviews people and gl beatrice these are for you
because you said you liked this portion of the show so really i. Yeah, it was in it was in one of the iTunes reviews. So or yeah.
Yeah.
So here we go.
I'm going to take a stab at the iTunes and then Mike can do.
Oh, man.
Or do you want to switch them up?
Now, go ahead.
No, no.
Let's switch them up because I actually some of these other ones look good.
So you got the iTunes.
OK.
Thank God.
Well, then I say that.
So, SMIC03, maybe?
Alexi22, DavyYB66, Tingu, I messed that one up.
Tingu666, maybe?
GL Beatrice, Eric, the guy who has the most normal sounding name on here.
Lambs?
How would you say that?
I probably would have said lambs.
Lambs?
Yeah.
Lambs?
Okay.
CW Woodwa.
Jason Clerkin.
Zach Brady.
Brady.
Brady.
Brady.
Oh, what did I say?
Man, how are you going to mess him up? He's all up in our Slack channel. Zach Brady. Brady. Brady. Oh, what did I say? Man, how are you going to mess him up?
He's all up in our Slack channel.
Zach Brady.
Because I'll tell you how I'll mess this up, because this is me reading names.
This is my kryptonite here.
I can't do this.
Vzilla and iPad 2, which maybe you want to upgrade.
There's a new iPad.
I don't know if you've heard.
Man, why are you going to hate?
Oh, sorry. All right. So Stitcher reviews. Yeah, these are kind of ridiculous. Let's see. I don't know if you've heard. Man, why you got to hate? Oh, sorry.
All right.
So Stitcher reviews.
Yeah, these are kind of ridiculous.
Let's see.
I think that one's Swedish.
Jory Triedig...
Not sure.
Greg PB.
Anemone Worcestershire.
Or Worcestershire.
Yeah, yeah.
That's like the sauce.
Like nobody can say Worcestershire.
Yes, exactly.
Seifer. Mahit the Geek. shire yeah yeah that's like the sauce like nobody can say worcestershire yes exactly c for my heat
the geek joshua garrison 27 active fire daisy chubb and sacco so that's you practiced those
though you read those way too easy because there was one like oh this one's going to trip him up
here he goes and he's like oh my heat the geek i'm like wait what man these roll off the tongue man
oh so thank you everyone who took the time to do this it was funny when i first looked in itunes
i was like man we only got two reviews we haven't recorded in three months there should be like at
least five and and then i went and looked at the international and you guys were all over so
thank you very much everyone who took the time to do that. Really super appreciate it.
So with that, let's get on to a little bit of news.
The most exciting thing has happened.
Yeah, yeah.
And you've talked about this in the past,
so I'll let you lead into this one.
Samsung has introduced their latest version of the MVME M2 Factor SSD,
the 960 Pro and the 960 evo and i gotta tell you it's drool worthy man it's pretty amazing 3 500 megabytes per second sequential read time
and and for those that listen to the one where we talked about the 950 pro that was 2500
yes so this thing's like a magnitude it's like 50 faster yes it's insane it's absolutely nuts and
for and just so that everybody's aware there's a big difference between pci based and the um
sata base so this is pci based ssds and they go all the way up to 2 terabytes. Right. So
quadruple the capacity
of before. Yep. And
that'll only set you back about $1,300
for that one. But I mean, you know,
but if you need it, I mean, or if you want
it, you know,
yeah, that's going to be killer. You were going to buy an iPhone
7. And so it was the choice between
you know, I could just Mac Daddy it out
with the 960 pro 2
terabyte or i could have the jet black iphone 7 which is it going to be right man i want to raid
two of those terabyte oh my god oh man that would be amazing you get close to probably well here's
the beauty of it though so now that these are being announced the 950s are coming down in price
yep yep so it's like oh i could pick up a second one and rate it.
Well, the cool part about these 960s is looking at the pricing,
they're probably about $0.60 a gig somewhere in that ballpark.
So they're not astronomical.
They're still not down there.
You can get some terabyte SSDs out there now for $250.
They're not going to be the fastest Samsung Evos.
I'm still waiting for that 60 terabyte, 3.5-inch form factor to come down.
When that guy comes out for consumer purchase, that's going to be amazing, right?
You can take all your current drives that you have rated together and your Drobo or your – I'm trying to think of some of the other ones now that are better than the Drobos.
But whatever your storage chassis of choice is, right?
And throw in a 60 terabyte SSD.
It's ridiculous.
And then rate it together with other 60 terabyte SSDs and it'll be amazing.
You can now take over the fox television network with with
you pretty much could man you pretty much could oh it's killer yeah so yeah that's that's a bit
of fun news um one thing that i want just a bit yeah one thing that i want to talk about is sql
server 2016 is you know here and column store is now a big deal because that's what a lot of uh indexing
engines use when they're doing like search engines and that kind of stuff and so it's made its way
into sql server so now you can do real-time operational analytics and we'll have a link to
that here in the show notes i'm gonna have to read up on that one yeah that looks pretty cool
that's pretty interesting oh speaking of there was another thing that i had to read up on too that someone brought up
on our slack channel uh about azure being able to has a has a data uh has a dependency
an ability to manage your dependencies or report on or something like that oh that's
killer i'm gonna add that to my uh my reading list excellent uh if we find that
we'll put that on the show notes too and then there was another bit of news that if for anybody
that listens to security now with steve gibson you'll probably be aware of this name but krebs
who does krebs on security brian krebs to be more specific brian krebs his site was actually taken
off akamai because he got hit with the biggest DDoS attack we believe that has ever happened.
And this thing went all the way up to 665 gigabits per second.
Yeah, he sent out a tweet here on the 21st.
It says, holy moly, Prolex reports my site was just hit with the largest DDoS the internet has ever seen.
665 gigabit per second sites still up hashtag fail yeah so you know and and we were talking about this as we were putting
together and i'm guessing that it has to be a ddos amplification attack that's the only way that i
could see that they were getting um I mean, because a lot of people
are familiar, might have heard the term DDoS, which is the distributed denial of attack. So
instead of having like... Of service attack. I'm sorry, of service. So instead of having like
one machine trying to bring down a service by flooding it with data, you get thousands and
thousands of machines to all request a little
bit of data but the amplification attack the way that works is that the client can request say you
know a small amount of data but the server then has to respond back with a larger portion of data
and that's what will bring it down um so here's stating that correctly it was not an amplification
but no no he says krebs called the attack unusual
as i'm reading this off the zd net um article here the ddos appears to have originated from
a massive botnet of compromised devices leveraged to create vast amounts of traffic through garbage
web attack methods rather than amplification no reflection techniques which are most commonly
used for ddos because really the whole purpose of doing the amplification is reflection techniques, which are most commonly used for DDoS.
Because really the whole purpose of doing the amplification is you can create like massive
problems with smaller amounts of machines, right?
But this sounds like they literally just hit tons and tons of devices and use those to
hit it.
So that's pretty crazy.
That's a different take on it.
I'm trying to remember like an example of an amplification attack i think there was an attack on dns where the if you sent like a malformed dns
request then the response would be far larger than what the query was and that was the example
of the amplification right so you sent this small little request, but the response that had to come back was gigantic.
And because it was also malformed and bad, then who cared?
It's not actually coming back to your machine.
So your machine, or hopefully not your machine, but whatever the machine is that's being used to issue this query, it's not actually resolving back to it which is also part
of the problem or can be part of the problem yep so yeah that's actually really impressive then that
it was the largest attack and it wasn't a a amplification or reflection attack and i'm sure
that there's probably somebody like you know a security now or uh uh um defensive security that's
probably like oh my god these, what are they talking about?
Yeah, it's pretty cool stuff.
But you brought up security now.
You know he's been taken down several times here lately.
Yeah.
Unfortunately, people are attacking the people
that are actually trying to help out in the industry.
Well, and the difference between why it's maybe
not nearly as big a deal, though,
is, well, compared to Brian Krebs, because Brian Krebs is on like an Akamai service, whereas Steve Gibson is not. CDN type network or something like that is because of the services that he's offering requires the low level network connectivity to be able to receive unsolicited requests.
Yeah, he's on the backbone directly.
Yeah, he's like directly on level three.
And so he has to be able to, you know, for some of the services that he offers,
he has to be able to accept, you know, requests that he didn't initiate or anything.
So he can't have any kind of a proxy between him or else he wouldn't be able to do it.
Right.
And it's unfortunate inside that they take them down.
I hope nobody decides to do that to us because we definitely are not hosting on anything like that.
Well, I mean, the bulk of our content, though, is coming through.
It's a podcast so
it's different yep so the topic of the show today and this is one that i think a lot of people have
been waiting for since we announced it on slack is we're going to dive into the book clean code
by uh well it's the robert uncle bob yeah uncle bob martin series and it i gotta say before we
actually get into this i wasn't looking forward to this really and i guess the reason is is we've
all been programming for a long time and and i was expecting a boring technical manual and
surprisingly this is actually so it's hard to call it a fun read but it's entertaining and it's
informational at the same time well i gotta say one i'm a little surprised how high my voice went
up just then when i said really that's that might be embarrassing so if you could edit that out i'd
appreciate it 14 year old outlaw yeah pretty much i don't know if you noticed i'm going through
puberty again um but yeah i mean there's a lot like i have a few notes here i don't know if you noticed i'm going through puberty again um but yeah i mean there's a lot
like i have a few notes here i don't know if you noticed alan um there might be like a sticker or
two that i've placed in here to mark you know a page of interest um yeah these guys have some
things to say and uh it's all good stuff so it it i'm not really sure you know i mean it it says it's robert c martin series
and has him as the author but there's actually like a collection of authors that you know are
writing different parts of the book um you know or there's a lot of stuff from other you know
names that you've heard of in the industry so um but a lot of these are topics it's like
oh yeah i've totally thought that now there were some things are topics that it's like, oh, yeah, I've totally thought that.
Now, there were some things in here that I was like, no, God, I disagree with that.
There were some that jumped out at me, but then it was surprising to me how many of them that I implicitly do while I code, but I feel like I could do a better job of, especially after reading some of this.
And we'll get to some of it.
Like, there's definitely some of these things that i'm 100 guilty of um but you know we'll get into
it but the first so these are go ahead oh i'm sorry hey joe's not even here and i can still
over talk somebody um so um yeah i mean like right away i gotta love it though because it starts off with this this
awesome drawing right that we have to describe here right here in the introduction where uh
you know it shows two doors there's the good the good code review on the left and the bad
code review on the right right and it says that this is the only valid measurement of code code
quality is the number of wtfs per minute so the good code review has you know two wtfs like just
randomly being spoken like wtf wtf right but the bad code review is like wtf wtf dude wtf wtf wtf is this right and it's so true because often like
you'll see good code and you make what uh that is awesome but then you'll see bad code you'll be
like what uh who would do that Why would you ever do that?
Oh, man.
What's really funny is when a new person joins a team, like where we work now, several of us joined at the same time.
And we saw some of the code.
It got the job done.
It wasn't pretty.
It got the job done.
It got the job done.
It was not easy to work in.
But it's funny because as you're going through and trying
to make improvements and clean it up, you know, you're, you're feeling good about what you're
doing and how you're enhancing the code base. And then a new person comes along and they're like,
what in the world are you guys doing? It was like, dude, don't come in like throwing,
throwing stones. I don't know what we've been through there's always yeah yeah there's actually uh and
i'm trying to think there is a there is a good quote from a book and i'm trying to remember which
one it was now where they talked exactly that oh no um i think it was the robert l reed series that
we read where it's like programmer you haven't been in that person's shoes yet so don't go
insulting what they've done yeah totally i mean it, you don't even know that they wrote it.
You don't know who wrote it.
Don't make assumptions.
Well, I mean, Git doesn't lie.
Well, Git does if you just initially put it in there.
Oh, well, that's not fair.
All of a sudden, Outlaw did all the bad good.
Wait, wait.
Why did we take that tangent?
Why did it have to be my name thrown out there?
Because you're the one who creates the Git repos.
Yeah, well, there's that.
Yeah, I mean, I also love this idea too.
And this is, you know, before we get into like the main meat of tonight's topic, though,
but along the topic of, you know, staying within the confines of this book,
was there's this concept of the grand redesign in the sky, right?
And it's always like, okay, fine.
Let's just, we'll make it work, as you said, right?
We'll just, let's make it work for now.
And we will come back to this thing later.
And we will make it better later.
And that's always, it's always later.
There's never, it's never like, I'm going to do this tomorrow.
It's never, I'm going to do this in an hour.
Let me get it done right now because we have some commitment.
And I'll come back to it in an hour after lunch or something like that it's always
like we will redesign this whole thing and it won't just be like we're going to do this one
small thing it's going to be like the whole thing we're going to redo the whole thing this whole
architecture is going to change and we're going to make this entire architecture better and that's
why like there's a friend that we have who i mean you got to love this amount
because he's always like don't ever think like that always think about like just iterate on what
we've got right just make what we've got better you know do what you can a little bit at a time
and he's so right absolutely because that grand redesign in the sky never happens
he this friend that we're talking about he has has worked in consulting roles where he sees this kind of stuff all the time, right?
And he's been in management roles and all that.
And after you've seen it so many times where somebody talks about a rewrite or a redesign, you start to realize that that's not realistic.
You start to realize that if you really want to improve things, you start making small changes until you get your way there. Right. Like you never ended a race by, by just being the one that, that, you know,
ended there, you had to start somewhere. You had to make the steps to get to that point at the end.
And, and I think that's a key piece. Yeah. And often, you know, the, the problem about a grand
redesign is that it's scary, though, too. Yeah.
Because you may recreate all of those bugs all over again.
So you're basically throwing away all the lessons learned, all the knowledge gained, and you're trying to start over from scratch.
And very likely you're going to recreate bugs.
I mean, Windows has famously done this.
When they went from, I think it was Vista, right, that was the complete rewrite.
It was garbage, yeah.
Or at least, let me rephrase that.
An example was the TCPIP stack.
If I recall, for Windows Vista, it was a complete rewrite from the ground up.
And they made a lot, not all, but a lot of the same mistakes over again that had been previously corrected in XP.
Yeah. And we're going to get into a lot of ways that you can mitigate those problems by going through these chapters
but so the the last thing that i wanted to say about this though which i felt went really well
with it though is that like forget the grand redesign in the sky and do the iterate but
or you know the iteration on it but part of how you get there, though, is the Boy Scout rule.
And we've talked about this before,
but there's specifically a small little blurb in the book
where it's talking about if you have to edit a piece of code,
don't just do the thing that you had to do.
Do something to make it better.
Even if that was to delete one line or rename one
variable to make it you know uh more easily understood or one function name or whatever
whatever the one little changes that you can make to make that code just a tiny bit prettier than
where you found it is great right yep i agree with with that. I have one thought on it, though.
Like, if you're going in to change a label on something
and your entire file turns green when you do a compare,
that's a prop, right?
Because nobody can now validate that the change did what it was going to do
and isolated and all that kind of stuff.
I feel like you're pointing that at me.
No, no, no, actually I'm not.
But if you're talking about like, well, okay.
It's just, it's just one of those things.
Be cognizant of, you know, what you're attempting to do and allowing people to actually see
that it was done.
Right.
If, if you end up rewriting an entire file, it's a little bit harder to do that.
Not saying that it shouldn't be done sometimes, but you know, it can be difficult.
So with that, the very first chapter we're going to talk about is meaningful names.
That's chapter two, correct?
Yes.
We're going to be starting with chapter two in the book, just kind of talking about various bits from it.
Yep.
So one of the...
Oh, and are we talking about...
I don't think we've mentioned this yet either, right?
But, you know, we're doing something with these, hint, hint.
Oh, yeah.
Do we even talk about that yet?
I think we mentioned it in a previous episode.
Well, so here's the goal, guys.
Like, I think, so how many chapters are in this book?
I haven't even, I haven't looked at it.
And starting reading it, we weren't sure what we were going to do.
But with what I've read so far, and we'll talk about this a little bit more, but I think we might cover most everything in the book that is relevant to what a lot of people do.
Oh, we're not going to be able to cover everything in the book.
Well, maybe not everything, but we'll probably hit several of the chapters.
We'll talk about it.
There might be some areas that get scared.
I'm not saying we're talking about every part of it.
But when we're done with this, we have three fresh copies of clean code that we'll be giving away oh no wait a minute i
thought that's not the way no that's the way we're doing it i thought we were going to do like for
every episode that we do clean code we were giving away three copies oh is that what we're gonna do
that's well i threw it out there now so i feel feel like, Alan, you're on the hook. I mean, whatever.
So, yeah, we'll figure this out.
Apparently, we had differing ideas.
But, I mean, so either which way, somebody's going to win.
So we're going to talk about chapters 1 through 50 tonight.
Yeah, this is the only episode that we're recording.
So, yeah, I mean, definitely we are going to give away copies of the book it's like i said it's a fantastic read sometime between now and the end of the show we'll figure
out how that contest is going to work yeah but because we forgot we did forget to go over that
in our show notes before uh we decided to hit the record button interesting so you're going to see
some thought process on the fly might see see some corrections happening in real time.
Well, hold on.
Let's look at how many chapters there are.
Let's do this real quick.
Oh, there's like 18.
Okay, so there's 18.
If we figure we do three per, and maybe we have four or five episodes.
I'm sorry, 17 chapters.
There's 17 chapters, and then there's like some really long appendixes.
All right, so that's what?
Probably four to five
episodes we'll say oh yeah i guess maybe i don't know how about we give away two books per episode
two okay two per episode because we don't know how many of these are going to drag out to
and we're not rich yet well i didn't think we would talk about everything in the book either
though yeah i don't know so that's why i was thinking like you know if we're doing it per
but okay let's put it this way well we're at least on the how about we agree that for this episode
we give away the three okay i mentioned yep and then maybe we revise it maybe i talk you into not
revising it maybe our slack channel talks you into not revising it someone's going to talk you
into being on my side here i think what it's going to boil down to is what kind of response we get
like if nobody actually says hey we want that book then if everybody's like oh great you're
giving that boy a book from like 1990 whatever actually this book was made like 2005 ish i think
yeah so so yeah that's what we'll do we'll gauge it by response we'll give away three for this
episode and if people are excited about it then then we'll we may keep it at that so i can work
with that that's fair we'll still have to figure out the contest rules in real time as we go through the show but we're going to start
with chapter two here of meaningful names yep and so one of the very first quotes that i pulled out
of the book that i thought was awesome is if a name requires a comment then that name does not
reveal its intent oh right that right. That's so good.
Yeah.
Yeah.
There is a lot to that.
But have you ever done that?
Have you ever seen that done?
Yeah.
Oh, wait.
Which one are you saying yes to?
I'm not sure.
Well, I'd say you're honest, not you're only saying you're not sure so
so i don't know if you're being honest i've definitely had a named variable or method where
i was like yeah i think i need to explain what this thing is doing and and that's that's wrong
right well yeah i mean the example they give here is like you have a d and then to the right of it
you say elapsed time in days whereas you could have just named it the last time in days and be done with it right so
have i ever done this hmm i'm probably sure i mean at some point we've all we're all guilty
of everything in this book yes like everything bad that they that they point out so i gotta
believe that i'm definitely you know guilty of this at some point i can't think of a recent one but i mean people have a great one is when you have like
outer loop counters and inner loop counters and that kind of stuff and the problem is people do
like i and then j and then k and then l and nobody can read that stuff like it's completely useless that was the one case though where they were said by
convention that uh i say they i forgot who wrote this chapter was it featherstone um where you know
that because it's just convention that you have i and i'm sorry it was 10 no but that was only for
a single loop that was only for something that was a simple thing that you could quickly look at.
Well, that's why you would have a J, though.
No, but I and J.
They specifically called out other letters, too.
And they were like, yeah, this is because it's convention, so it's okay.
On a one loop.
But if you start nesting loops, they said no.
Rewrite them and name the list.
Actually, it's on the next page.
Page 19, you'll see that they rewrote the for loop from page 18 into named lists and that kind of stuff.
So it's, yeah.
No.
Yeah, totally.
No, they still have the same.
They just rewrote, but there wasn't a nested loop there.
So that didn't apply.
But there is a spot, trust me, where they specifically called it out.
And I don't remember
because it's been you know a while since i read this but there was a spot where they called out
uh you know i i j and k i think was as far as they went and i said only because this is convention
that you know those were those letters are okay but they also made the point though of saying that
uh you know there's another part where they get into – they start talking about function links and whatever.
And it was only acceptable because if you have a small function that's easy to digest, then yeah, fine.
Then it's okay. you know, loops here and then, you know, nest and then they're nested on top of that.
Then yeah,
you can totally lose,
uh,
you know,
your place in it as you're trying to read it.
Well,
we'll get to that because I've actually got that in the show notes is what he
refers that to is like brain mapping,
but we'll talk about that here in just a little bit.
Um,
so yeah,
like you said,
though,
naming your variables can reveal the entire purpose of what that block is.
But and that's really the point.
But there was also another great section that was kind of like this about the intention revealing names, which was, you know, don't avoid disinformation is the way they worded it.
Yes.
But, you know, don't give a name that doesn't really convey what it is.
Right. you know, don't give a name that doesn't really convey what it is, right? Like, as software developers, we have certain ideas about certain things, right?
So if you tell me that something is a list, right, if that's the name of the,
if that's part of the name of the variable,
then I'm going to have certain expectations as to what that thing can do
or what that thing is underneath, right?
You're going to think it's a list because as a programmer,
you hear a list and you think, gonna think it's a list because as a programmer you hear a list and you think oh it's a list right and if it comes back that it's actually like a dictionary then i'm gonna be a little upset why did you name it list right yep and they
actually go on to say like you know don't even bother to put the type name in it at all which i
actually like better i completely agree um so like what they were talking about is if
somebody might say hey this is an account list.
And the problem with that is, again, as a programmer, that's a problem because we think in terms of programming terms.
So instead of calling it account list, call it accounts, right, or group of accounts or, you know, something like that, something that doesn't have a programming term
in it. And that, that can be really key. It's not confusing somebody that comes behind you,
but it doesn't even have to be based on type name either. I mean, we've talked about this before,
about part of the beauty about knowing the design patterns, for example, going back to the gang of
four, part of the beauty about knowing those and understanding those is if you see something
that's called something, something, something factory something factory you know then you already have an idea
about like what this thing is and what you can do with it and how you can use it right
if it doesn't actually if it's not actually a factory yeah then you're going to be upset yeah
you're going to be well why would you name it that because this is how i wanted to use this thing
right yep yeah so i mean that's another example that they didn't uh exactly cover that but i mean it's still relevant yeah it's still
part of it's still part of disinformation any kind of programming terminology that you know
people are used to you should be very aware and not name your variables things like that that
would mislead somebody else um another one that they pointed out that I thought was good and is so true,
don't use characters.
If you're naming just a single-letter variable, don't use a capital O.
Don't use an L, a lowercase L, because they look like zeros and ones,
and you can't see.
If capital O equal equal lowercase L because they look like zeros and ones and it is, you can't see. Right.
And then if capital O equal,
equal lowercase L,
right.
That line is beautiful.
I mean,
and the thing is they even went into in the book saying something about,
you know,
somebody even went as far as say,
we'll change the font in your editor.
Oh,
right.
But that doesn't make sense.
I'd have to slap somebody.
Right.
Right.
Because,
okay.
That is legal grounds for where one developer should be allowed to slap another developer and be like, what'd you
just say? What was that for? Change my font. But I mean, think about that, right? Like even,
even if you said that that was going to work for your current group of developers, like you're
going to use a serif font with, with all this stuff, right? The problem is the very next person
that gets hired that installs visual studio or weborm or whatever the IDE is, they're not going to have that.
And then all of a sudden they're going to see 1 equals 0 as opposed to I equal,
you know, or L equal O.
And that's a problem.
So never use variables that can be substituted out for numbers easily
when you're looking at them.
Well, I mean, going along that same lines
of these single-letter crazy variable names, though,
they made the point of, like,
you should make your variable names searchable.
Yes.
Which I loved that idea.
Yes, yes.
I'm like, you know, I never really thought about it like that.
Like, I try to give them meaningful names.
And I totally take advantage of that,
you know, the searchability
of it especially in javascript um but i never thought about it from the point of view of like
you know oh i want to make this greppable right even though that's technically you know what i'm
doing yeah because if you name everything uh i you cannot you cannot go to find that right
it yeah again i was only allowed as an indexer as
an indexer for a loop otherwise you should get away from it another one similar one would be
name right like so you're gonna have if you have tons of classes in your application name is almost
invariably one of them one of the instance values on it right like you might have um oh like a
property value so you would have some
class let's say let's say you have a class customer and a property of it is called name
yes and then you're going to have a class employee and his is going to be named so when you search
all this stuff name's going to show up everywhere so that's not informative and that's what he's
talking about with having a good greppy name. Now, the one thing that was frustrating about this.
In the case of where they go with the address, though, it kind of goes against what you're just saying.
Sort of.
They do give an example of if you were to have two different address type classes, and it's like, well, which one do you use in this situation?
Yep.
Right?
Whereas if you just had one address class, a postal, a postal address class, then, you know, you could have street name.
Yeah. So one of the things that I noticed a lot in these chapters is they'll give some information and some of it will even contradict stuff that they've given previously.
Because when we were talking about the searchable names, they say longer names trump shorter names, right?
Because then it's more searchable.
Like having, you know, customer name is something that you can search for, right?
But then at the very end of that chapter, they're like, you know, prefer shorter names over longer names.
And it's like, well, come on, man.
Well, no, no, no. There was actually, and it was one of the things that I wanted to call out that I thought was an awesome idea,
was that the length of the variable name should directly correlate to its scope.
Like if it's, you know, smaller variable names are only in a smaller block scope, right?
Yes, totally.
The larger the scope that that variable is available,
the longer its name should be.
Yes.
Right?
So that's where that's coming from.
Because I didn't read...
I don't know about the contradiction parts
because I didn't necessarily read that they were contradicting.
I thought they kind of carried on from one to the next,
but that was my take.
And dear listener, when you get a copy of this book maybe you'll read it as uh something else you know maybe maybe
you'll have a different take on that it was more towards the end of the chapter where they're kind
of doing like a summary on it and they said that shorter names are generally better than longer
ones so long as they are clear but then that goes against the searchability thing is kind of what
i'm getting at now how about this that well no because Well, no, because if it's short, but its block scope is short,
then you're only searching in a small area, right?
If you have a five-line function,
then you can afford to have a variable that's only three letters long, right?
Because you can visually scan those five lines.
In terms of gripping a project, though, is what I'm getting at.
If you're trying to search your entire project. But my point though is that like you're not going to search the entire
project for a variable that's only scoped in within five lines if you know that yes if you
are well you could see that you could see its scope is only in those five lines no but what
i'm getting at is if you have name right like we said a second ago and name shows up in a bunch of
different classes,
and you're searching, you know that there was something
called name, and you were trying to find it,
and now it shows up in 80 different files.
That's not helpful. I guess where I'm
thinking of this, though, is more along the lines of
constants.
Because constants aren't going to be as
part of an object like what you're describing.
Whereas in a modern editor,
and they even make points of saying in modern editors in modern editors you can find references of a particular
variable right so in your name example you could say like okay show me all the references of this
name which is going to be specific oh i think my audio cut out there for a minute which is going
to be specific to that um uh object type right right so so it's going to know that now the one like here's where the example
kept going through in my mind that was like okay let's find let's take a java or c sharp where i
might have a really nice uh feature rich ide and because of the strong typing and compilation
that's required then it can know those kind of things but then on the flip side now let me talk
about uh you know something like javascript side, now let me talk about something like JavaScript.
And even though I might be using something like WebStorm,
which is an awesome IDE,
because it's not strongly typed,
there are times where it falls short
and it can't find something.
And so that's where the kind of variable searching
that you're doing would come into play.
But even in that scenario,
you're not doing come into play but even in that scenario you're not doing uh
a search across you know you know that's where like if it's only five lines and you can see that
it was just varred in those five lines then okay fine i don't need to search everywhere but that's
where your name issue would come up so i'll give you that yeah mine was more about searching across
a project as opposed to you know a, a known class or something. Yeah.
Now, how do you feel about the Hungarian notation, though?
I also agreed with what they said because the Hungarian notation that they talked about in the book was don't prepend like STR to a variable, right?
Well, it wasn't.
Like, back in the day, though, it was even less than that.
It was just I remember doing it as just S.
I hate that stuff.
So for those who aren't familiar with Hungarian notation,
let's rewind the clock here.
And old C, I remember doing this in old C programs
or C++ programs.
And they talk about doing it in BASIC.
But the idea was that, let's say if you had a string, right, whatever your variable name.
So you mentioned name a moment ago.
So your variable name might be lowercase s, uppercase n name, right?
If you had a Boolean value for is valid, you might have lowercase B, uppercase I is
uppercase V valid.
I hate that stuff.
You hate it now.
I will give you that.
But there was a time where
that was how you knew
what it was.
You could easily tell. You could look at
some documentation.
Keep in mind, this didn't necessarily have to be your code. You could look at win 32 API calls, and you would know what the type was coming back to you or what you
needed to pass in just by the name alone. But so there was a time for it. So there's the problem
that I have is exactly what you said is true until somebody changed the type. They made it
a Boolean initially, right? And then they realized, oh man, it can't just be true or false. It needs
to be 0, 1, 2, or 3, right? And then what would invariably happen is they would leave the variable
name the same as it was because they don't want to have to go find everywhere that it needed to
be replaced because back then the editors weren't as good as they are now.
And so you'd have this B is something,
and all of a sudden it's no longer a Boolean, it's an integer,
or something like that.
Well, even in that scenario, they were still going to have compilations.
If you change the type, you're going to have compilation errors, so you'll find your references if it's a strongly typed language.
But that's what I'm saying.
It won't matter.
They'll leave the name there, so they would have changed it from uh yeah but my point though is that's
just laziness at that point because they're going to find because because they change the type
they're going to find the errors more often than not so that's kind of where i'm going though they
almost always lie and they're almost so you hate lazy people is what you're saying they're almost
always obvious like people like i'll never forget when people would do databases they put table and then the table name and i was like what no
what else could it be okay so you have views and you have functions okay like tables are the core
of a database why are you naming everything table customer table whatever you know so i mean i i'm
no longer in it,
but there was definitely a time where I valued the Hungarian notation
because, like I said, it was the easiest way.
Once you got familiar with it,
then you could easily just look at any call
and you would immediately know what was happening.
But here's where like I started.
It started to break down for me was that like once it got to be multi letter ones, you know, right?
Then it was like, okay, like, you know, OBJ for object and for object.
And it's like, okay, like pretty soon here, we're going to be problematic and we're we're even during the time that i liked it but where i
struggled with it is if you had a long class name right um you know i can't think of a really good
example so i'm going to say out a horrible one only because it was the first thing that comes
to mind but um you know if you had something like customer shipping address, home shipping address, whatever, then – and you used each first letter of those words as your abbreviation, then it got to be a little bit carried away.
It was like, okay, wait a minute.
I don't even know what this type is anymore right it like the hungarian notation worked out great for simple uh primitive types but once you started
using it for your complex objects and you used something other than just o then that's where it
fell apart for me now today with today's editors yeah no way you shouldn't do it now there is one take on it though that i kind of
i don't know that i necessarily agree because part of the hungarian notation was back in the day
for member variables of your class you would uh prepend them with m underscore right yep and now it's kind of that's fallen away and but you still do an underscore
for your privates and i still kind of like that and i'm still guilty of it i still sometimes name
my private variables with underscores i definitely if they are if they are private i usually at least
lowercase them i mean it's usually it's just i i kind of follow suit with what's already
there if i'm doing brand new code now that's a great example because there have been there's
definitely in times even in recent years where i've like followed suit with somebody else's
hungarian notation just to keep it consistent even though a little bit of me died inside yes
although okay fine i'll do this yeah so but but no what i'm saying is like what i like to do is
like let's say let's say for some reason i have a private uh let's talk specifically about c sharp okay
so i have an auto property and maybe i have it private for some reason or even protected
but um point is is it's not public right um but behind the scenes there's a you know a private
data member for that guy i'll still have underscore and then lowercase whatever that
name is.
And I like that just so I can see my private variables, even though that property that
goes along with it will not be lowercased.
Right, right.
I'll propercase that.
Yeah, I mean, so for anybody out there that wants to dig deeper into something
like that there's there's guides like idiomatic guides for almost every language out there like
there's tons of them listed for like javascript there's some for c sharp there's some for java so
every one of them kind of uses their own conventions and i'd say it's probably
best to stick within the convention so that anybody that looks at it
that's familiar with that language can pick up on it quickly um going back there were a couple
things i did want to hit on is noise words like data or info should be avoided because just about
every object wait what was the first one data or info okay so if you have customer data or customer
info what's the difference and why wouldn't that customer object have data in it or info in it you
know what i'm saying i might be bad about the data one though and in in specifically what i'm
thinking about is there's like some charting packages that come to mind where you know you're specifically throwing some data at it
and you know in that case I'm bad about I'll name it data I should probably name
it something more meaningful like array you know or series series or something
like that like yeah I should okay fine slap my hand I'm horrible there was also
the so those are what they they non-informative words, right?
Like data and info, because they don't tell you anything.
You have no idea what that really means.
What kind of data are we looking at?
What kind of information is this?
Yeah, well, there was another point that they make that was kind of similar to that,
where they said, you know, what's the difference if you have a controller and a manager and a driver on the same code base?
Right.
What's the difference between these?
Right.
Right.
But the one take on that that I had, and I specifically, you know, I went back and looking for it because I remember reading it.
And like I said, it had been a little bit since I read it.
But I remembered reading something in here where they specifically harped on the use of the word controller as part of your
class name do you remember reading that too it's in there it's right there in that section you
talked about and i and i couldn't find it uh to go back and mark it because i specifically want
to quote it out but i was like wait a minute that's not fair because that's controller specifically
goes back to what we talked about a moment ago about like there are concepts that programmers
and software developers are familiar with right and so if you tell me that something is a controller
then i'm automatically thinking mvc right right so i feel like that one's fair to have in your
code base like that's a gimme you're allowed that one but you know what this is also like you said
no 2005 man was mvc a big thing back then? I don't know that it was.
But it was out, though.
Okay.
I mean, it was definitely out.
I don't want to argue about it being a big thing or not,
because that could be subjective.
Right.
But, yeah, you're right.
I mean, not everything should be taken completely.
If you have some variable and it's called a view,
or you have some variable that's called something
controller, like I'm automatically going to make my assumptions about what that thing is. So I feel
like controller when I didn't. But the funny part about that, though, is that coincidentally,
as I was preparing for this show and reading that section, not like just days before there,
I created something or I was working on something that I created where the
class name was manager.
And a little part of me was like,
Hey,
wait a minute.
Why did I do that?
That's not,
wait,
no,
the manager,
that one's okay,
right?
That one's,
that one's good.
Is this like the data thing?
So getting,
getting back on,
I mean,
this whole section is about names,
but there were a couple of
other things that i thought were kind of kind of good and you hit on one a minute ago with obj
they say avoid encoding names so taking something and shrinking it right like table should be table
don't name it tbl right um don't name something obj because in different contexts, those might actually mean different things, right? I mean,
who knows what they are. So, so those are big ones.
Like type the name out. Who cares if it's a little bit long,
we have editors now that'll auto complete those things for you.
Yeah. I, you know, but, but to that point though,
there was one great point here. So, made the point that there were times, even in recent past, where I've done the Hungarian notation and felt bad about it.
But they talk about a consistent lexicon is what really matters the most.
And they were specifically referring to the whole concept about the manager controller and whatnot but i kind of felt like that same principle
applies even to the hungarian notation which is why i did it because yeah you know ultimately
you know a bad a consistent pattern is worse you know even if it's a bad consistent pattern that you don't,
you might not be a fan of.
Okay.
But if it's consistent,
then you can at least work with it rather than,
you know,
interjecting a bunch of things here and there that,
you know,
don't make sense.
Right.
Totally.
So,
um,
hold on.
Let's see.
I just lost my place.
Oh,
so one of the other things to make the names pronounceable and. And they get into a whole lot deeper into this particular topic than really what I'm going to go into.
But the thing is, our brains work with vocabulary that we know.
And so if you use names that are pronounceable, it'll be easy for you to talk about it with somebody else, which is a big deal.
I think that was in section two where I was talking about having to make a mental map between what something translated to or meant, right?
No, that was actually the variables, and that's what I wanted to talk about.
So with the I's and the J's on that real quick, seeing as how you brought it up, is one of the problems is when you do like nested loops and you're trying to just make your variable names as short as possible, the problem is it makes you mentally have to map things.
Right.
And so if you did something in code that was 30 lines up, if you're making it to where people have to think about and remember what each one of those variables map to, right?
So I was an account, and J was a user, and K was some transaction.
If you have to map all that in your mind, it's going to break down, and you're going to have problems.
Well, again, I mean, from start, though, if you have a 30-line function and it's already too big.
That's what he said.
He wants to keep them short. Yeah, this was specifically.
So now that I went back to look at this, this specifically was the area where it was like, okay, single-letter variable names.
There is a problem with single-letter variable names.
Certainly, loop counters can be named I, J, or K, though never L uh if the scope is small and that goes back to the
point that i was talking about earlier so if the scope is small then you can easily see what it is
and and and it says that uh these single letter names are okay for loop counter counters because
it's traditional right yep i mean i mean i think for int i equals zero is just ingrained into my
everybody's yeah that's just how i talk that's
probably how everybody learned their four loops oh no here is an interesting one though that
it was talking about like uh you know don't make a pun in your in your names and um specifically
this one this one kind of threw me because it was talking about ad it was saying like don't
don't have a method name they give this specifically the example of don't give them
don't have a method name like ad unless it's actually adding two things and returning back
a result yep and i don't know about you when you read this section but immediately i thought of
list dot ad and i'm like wait, that totally breaks this example.
I mean, they even give an example where it was kind of along the lines of list.add.
So they did.
And what they said is the problem is like your list.add is growing a collection.
And they said if you have another class and you're just trying to stay consistent,
but you only have a single value to set, if you do a dot add there, the user has, the programmer has this expectation that you're adding to a collection.
And so it's not clear.
And when they say pun, they're not talking about funny puns like what we might do.
They're literally just talking about you have the same name type thing so you expect them to do the same
but one does something differently and that's the problem right there well yeah i mean they
specifically say in the you know as it relates to the collection that you should use a dot insert or
a dot append as the method name because also uh the dot add in uh the mind of the author was that
you know kind of implied that you could chain it right so you could do dot add dot add dot add in the mind of the author was that, you know, kind of implied that you could chain it, right?
So you could do dot add, dot add, dot add.
But because it's returning back a concatenated result of whatever the first two were.
So I thought that was interesting because that means that that's one that Microsoft made a boo-boo on,
and it wasn't me this time.
So here's one, speaking of Microsoft and actually Java,
and this is one that has come up in Slack several times,
is decorating interfaces or classes with a prefix or a suffix.
So in.NET...
That was in here?
Yeah, dude.
So in.NET, it was about midway through the chapter.
In.NET, it's pretty standard that you name your interfaces with i
and then whatever it's going to be right oh right there it was yep and yeah and it was funny so
i completely disagree with the author on this particular take because he preferred if you're
going to do it that you do class ample or class imp and i i can't stand that i don't know why but i it
drives me crazy but i will say i do agree to a certain extent that what he was saying is
naming your your interfaces with i interface or your classes with class imp is telling the
programmer too much about what it does.
You're giving them something that should be able to do something, so it's a type.
You shouldn't have to care that it's an interface that has no real implementation.
So if you have a car, it should be car, not iCar.
So I get that, but just by practice, at least in C Sharp and the, the windows.net world,
that's just kind of how they've done everything.
So it's easy to follow suit,
but I do on,
on a very base level of,
Oh,
Oh,
I agree with the whole,
it's a type.
You shouldn't have to call out that it's an interface.
Yeah.
I mean,
this is one where again,
if I'm doing it, okay. If I'm working on my own thing and it's all greenfield and I'm left to my own devices, then I like the I prefix better than the impl or the imp.
Same here.
You know, either prefix or suffix depending on which way you want to go. But if I'm working in a code base where one or the other is already the common pattern,
then fine, I'll follow suit with it.
Yep.
But, yeah, I'm with you.
I'm not against that.
And I think that that's because, though, that the author was more of a Java developer,
or at least at the time.
Well, I mean, looking at all the code samples and everything he referenced, it was all Java.
Yeah, well, like I said, there's a mix of authors, and so each author is coming from their own language choices there.
And that's why I called out the list.add, because I thought that was interesting. Now, when I was talking about the factory means something, right,
they were specifically referring to that as solution domain names.
So they made the point of if you name something a visitor,
then it better follow the visitor pattern
because that's what software developers think of
when they see something called visitor.
Yeah, they call that out directly, and that's smart.
If you have a class that's a factory, name it something factory.
If it's a visitor pattern, name it.
If it's strategy, whatever, name them.
And that's actually twofold, right?
That not only makes it so that programmers will see it,
but newer programmers will learn from it, right?
Like I feel like that's a good way, it's a good teaching mechanism
because now they get to see that in practice.
And so the next time they see that pattern, it'll automatically click.
Oh, I know where to go in this code to figure out what it's going to do.
Yeah.
Well, I mean, even if you don't, if you see something that's, let's say, air traffic mediator, right?
And you look at this code and you can't even understand it, but you could at least say, okay, well, it's a mediator. It's a mediator right and you look at this code you can't even understand it but you could at least say okay what's a mediator that's a mediator pattern let me go make sure let me
study up on what the mediator pattern does and then now that this information is fresh in my
mind again let me take another stab at looking at this so it it not only does it help but it
gives you like another uh way to like try to reason the code. Yeah, totally. And I think that's killer.
Here were two things that are quick ones
that I've never thought about.
It makes so much sense.
I've probably followed this and didn't even realize it.
Class name should be nouns.
Method name should be verbs.
Yeah, I definitely think I remember hearing that more
like as Java was taken taken off i remember that
becoming a bigger thing but maybe i'm just thinking of the getting set so that was the
other thing he said you know at least by or whoever this particular author was you know
getting set and is are java bean standards so that's why those should be used so i mean whatever
your preferred language is if there is a particular set of ways that they do things,
you should follow suit because it'll be familiar.
Yeah.
I feel like the,
uh,
C sharp with its sugar kind of blurs that a little bit though.
Right.
Because if you have auto properties,
then technically behind the scenes,
you know,
it's creating getter and setter methods,
but you might have a property named after the noun that it,
um, you that it represents.
Right?
Yeah.
Like you might have a person property,
and you just call the –
but behind the scenes, the compiler is creating the get person,
set person for you, but you're calling it a noun,
even though really behind the scenes it's going
to be a verb right but i guess it is verbalized verbalized verbalized that sounded it is i mean
i verbalized verbalized but um so i mean i guess behind the scenes it does get verbed so the the
here was one that i really liked and i'm trying to find it back in the book i wish
i tried not to mark the book up because apparently we're going to be giving some away but i guess not
this one you know a few oh so i was totally going to give this one away with all my pretty notes
this is one that i really like dude when constructors are overloaded use static factory methods with explicit names oh right in this this comes back
to there's another later in the book they get it talking about how um functions with uh where you
pass in a lot of variables the more variables you have to pass in the worse it gets right so if
you're having to overload your constructor because you're passing in more variables or different variables, then it would just make more sense to
use either a factory or a factory pattern, you know, method pattern to create that object.
Yeah, that's so cool to me. I mean, I'd never really thought about it. And for anybody that doesn't get what we're saying here, like when you have your class and you have a constructor, if you have two or three constructors, right?
Well, we talked about this before, right?
So there's the factory method pattern, which is not a factory object.
Right.
But you could just say, like, let's say you have some kind a um class name that i don't know what would be a good one let's do let's do a person
with uh well well i have a specific one because this goes back to the conversation at that time
and i don't remember what episode number that was but you might have a factory method called
create pepperoni pizza and it already knows everything that has to be done for a pepperoni pizza so it's going to return
back the pizza object as pepperoni you know as it needs to be configured as a pepperoni pizza
and you could have a you know create meat lovers pizza yes uh you know factory method that would
return back to the other one now there is the factory object that you could use as well where
maybe you pass in you know an enum as to like
what type you want, but there's the factory method pattern that you could also follow here, which is
what they were talking about in this example. So the difference is, is instead of calling a pizza
class that now has four different constructors in it, right? One for your pepperoni, one for your
supreme, one for your meat lovers, instead of having to call new pizza and then pass in like your toppings,
your various different toppings, now you could just say, you know,
pizza factory dot create pepperoni pizza, pizza factory dot create Supreme pizza,
and it's more readable.
And that's one of the key things that they talk about is being able to look at
and read the code like it's a paragraph.
Right.
Like it's English. You can understand it as a person because you can look at and read the code like it's a paragraph right like it's
it's english you can understand it as a person because you can look at it and see that this
function name okay i know what that does you know as opposed to new pizza and then a whole list of
parameters right yeah if you had if you had a whole list of ingredients you know i'm not a chef
right right so you might pass in that whole list of ingredients into that you know you might have a pizza dot create method or even just a pizza constructor and you pass in a list of
ingredients well i'm not a chef so i'm not going to look at those and immediately go oh i get it
that's a meat lovers pizza but if you have a if you have a factory method pattern that's like
pizza dot create pepperoni pizza that returns back a pizza object that is already configured then everyone's
going to understand oh by the way guess who now wants a pizza well by the way i'm pretty certain
that if we saw a list of toppings on a pizza factory i'm pretty certain we would pick it out
i'm just saying it depended on it would depend on like how granular the list of ingredients got, right?
Okay.
If it's like oregano and I don't even know what's in a pizza.
Is oregano even in it?
Yeah, it can be.
This is where I'm saying I'm not a chef, okay?
I just eat it.
I mean, you put awesome food in my face, and I'm going to put it in my face and eat it.
But I don't know what went in eat it but but i don't know what i
don't know what went in it yeah i don't know that that's other that's someone else's magic job you
don't use those online tools to build your own pizza come on man what yeah but but they're not
getting to but that's okay so that's your point is that maybe if you saw uh the list of ingredients
as pepperoni bacon ham uh ham, meatballs, or whatever.
Maybe you would look at that and go, oh, that's meat lovers.
But if you saw, in addition to all that,
a lot more granularity in terms of the ingredients, then you wouldn't.
And that's the point that I was trying to make with that,
is that if you saw a granular list like that,
you're going to look at that and go, wait, what are they doing here?
Yeah, so the key there is create a method that the name is completely obvious as to what it is.
So I know we kind of beat that one up, but whatever.
I don't think so.
We haven't ordered a pizza yet.
No, we haven't.
I'm about to, though.
Hold on.
What's your address?
All right.
One of the other things was they said, don't get cute with naming.
And we've probably all done this.
There's an inside joke that you and your group of people that you work with, you all know about.
It's somewhat in context of what you're doing, but it's funny.
The people that come after you are going to have no idea what that is.
Oh, right.
And so it's lost, and now you've created confusion
simply to get a laugh that's basically going to disappear.
Yeah, I don't remember the example that they had.
They had, like, some long name where everyone had abbreviated it
by just the first letters, and then they were pronouncing it funny.
And I don't recall what it was, but I'm trying to think, like,
if we've ever been involved in this,
or if I've ever been in a situation like that.
I can't remember a situation if we've ever been involved in it or if I've ever been in a situation like that, I don't,
I can't remember a situation where I've done that,
but I'm not saying I haven't.
I've definitely,
I've definitely heard of projects that get that type of status about it where like,
you know,
here's that,
that server that's sitting out there that's been sitting out there for the
past decade.
That's running some app that was originally written out there for the past decade that's running some
app that was originally written as just a pearl uh you know a piece of pearl code that wasn't it
really intended to become what it evolved into but now it's this full-fledged you know application
thing that has kind of like just grown over time but a single variable name or class or function like i can't i couldn't i couldn't think
of that example yeah so here we're i think we're kind of getting close to the end of this one
one of the uh one of the things that i thought was interesting is when you can use technical
terms that other programmers are going to understand when you're naming things this
goes back to the solution domain.
The domain, right.
When there's not a term that you can come up to describe what you need,
then you fall back to the business domain.
So if you're working in a customer service type environment or something like
that, if you can't explain it in words that other programmers are going to
understand,
then you need to fall back to what their terminologies are and use that.
And then that way there is at least a domain of knowledge around that.
So in other words, no foobars.
Probably no foobars.
Well, I don't know.
Everybody understands foobars.
Yeah, it means nothing.
It does.
You know, another one that's kind of like that, though,
but that actually I guess does mean something is widget.
I hate it when I see that.
Yeah, widget just complete garbage,
right?
Because it's like that.
That's like the one term you use in school to describe like a factory that
creates something and you don't want to actually have to make something up.
So you're like,
let's just pretend to create something and we're going to call that something
a widget,
which is a meaningless thing.
And then,
but by the way,
we get into real world scenarios and we're like,
okay,
so we're going to create a widget.
We're going to have this class as a widget.
You're like, wait, but what?
I can't stand widgets.
Unfortunately, several frameworks out there use the term widget,
and I don't know.
It just kind of proliferates.
It's a thing.
Another one is one way that you can make things make more sense
is put them in context right so so you talked
about earlier putting name inside a class now has the context of that class right so so instead of
propending a bunch of names so what they talked about is like let's say that you have a person
class like some people do person first name person, person, last name, person, you know, whatever. Right. And that is redundant and just becomes cluttered.
And if you go to try and use auto type or auto complete and you hit P, now you've got a list of 50 parameters that show up.
Instead of doing that, put those values inside your class.
So now you have a person object that has first name, last name, whatever.
So, yeah, I mean, I specifically gave the example about the addresses,
and that's what this section was referring to, was talking about addresses.
And they actually gave the examples of things like an account address or a customer address.
Those might be fine instance names for instances of that object,
but the object would just be address.
Right.
Right.
But maybe specifically as it relates to address,
they did give a little bit of leeway that you might be better off to name it
something like postal address.
Yep.
So, yeah.
Hold on.
Hold on.
Two more.
You got two more.
Two more little things.
Holy moly, man.
One is a quote.
It's amazing.
Like we've always said, the hardest things about programming are naming.
Oh, the two hardest things of programming are totally naming things, right?
Cache and validation and off by one errors.
So, I mean, I know that this one's kind of gone long, but naming is huge.
Like it really is the hardest thing
and especially making it so that other people can follow suit but one of the quotes here that i
really liked is the hardest thing about choosing good names is that it requires good descriptive
skills and a shared cultural background i thought that was so key because, um, if you're working with somebody
that's from another country or even another region of your country, certain concepts aren't the same.
We talked about this in the past, like they had asked, um, there was a survey done just to kind
of find out about cultural differences. And if you ran out of ketchup, what would you get to
substitute? Right. And depending on what area of area of the United States you lived in, some people kept their ketchup in their pantry.
Others kept it in the refrigerator.
So they had different substitution things in their mind depending on the vicinity of where their ketchup is stored.
And so that whole thing is amazing to me.
Well, I mean, here kind of going along with that though like not all english is the same right so even if we were to just compare for example uh you know the uk versus
the us right there are words that's the same word spelled the same way that each you know country
uses but they have different they'll mean different things especially like if it's you know in a slang uh you know uh instance right and if you were to um you name your variables something like that
going back to that don't try to be funny but if you did then maybe it might have a completely
different context it could be completely offensive yeah you know to someone else yep hopefully you're
not doing that in your code yeah i mean it's it's just one of those things to be aware of and it's so true it really is sometimes hard to do because you have to be
you have to be analytical as a programmer but you have to be very descriptive in the way that you
that you make these things and so it can be difficult the thing i liked about that um
that paragraph or section or whatever where they where they mentioned that though was that
it almost felt like it was talking about,
okay, there's different-brained people, right?
And being descriptive isn't...
That's a level of creativity that is not what we are good at.
Yeah.
Right?
We're good at problem-solving and analytical kind of things,
but naming something means being creative
on the other side of your brain.
And that's why we're so bad at it.
That's why it's so difficult.
Yep, totally.
So from now on, I'm just naming all my variables after CSS values.
There we go.
Well, at least you'll have an infant number.
They're all colors.
Hex colors.
I think that would be meaningful right oh man ff00bb
fob is oh and then the last thing here and this goes back to what michael said about the boy scout
rule is renaming things that don't make sense as you work in your code is a good thing period it
is yeah i mean if you got an opportunity if you see something that doesn't make sense as you work in your code is a good thing right it is yeah i mean if
you got an opportunity if you see something that doesn't make sense then in my opinion it is your
duty to to correct that you should see that as a bug and fix it honestly it kind of is because if
you can't read it if you have to look at it and it takes you a moment to figure out, like, they actually, oh, it's coming up later in the next chapter.
There was another section where they actually time box it.
If you couldn't look at a function, and I want to say it was three minutes was the time that they gave.
If you couldn't look at that function within three minutes, know exactly what it does, then something's wrong with that function.
It needs to be rewritten.
Right?
Yep.
Like, it's doing too much or it's too confusing.
It could just be that there's a bunch of bad names in it.
Who knows?
Yep.
But yeah, if you see something that is named poorly that doesn't make sense
or maybe it's misinformation or maybe it used to be typed a certain way
and now it isn't, that is a bug.
It might not be a functional bug, but consider it a literary bug.
And it could actually create bugs because of misunderstanding.
It could.
You're very true.
It very well could.
So here we go.
Now we are actually getting into the next chapter, which would be chapter three.
Man, that is functions.
Wow.
You should look at the timer.
Where are we at um all right so
yeah i mean do we want to we want to try to do all three of these tonight or just uh maybe do
two wait where did you put the timer okay um it was in the notes i can ping it back to you but
yeah i can't i don't see it um i don't want to see oh here it is yeah it wasn't open so
wait where are you let's get into functions, right?
Wait, I still don't see it.
Oh, my gosh, Alan.
How do I share things with you and you not see this?
Okay, I'm going to send it to you again,
and we're probably going to hear your computer ding because you didn't mute it, did you?
Or did you?
Wait, is this in Gmail?
Where are you putting this?
No, no, no, no.
It was just in the dock there.
It's not.
All right.
Special for you, Alan. Here it comes.
All right. Where are you giving it to me? Bing. I binged it. I binged it because everyone uses Bing.
All right.
I don't believe any of this.
You still didn't get it.
Hold on. You sent it to me in the other one. I can get that. Hold on. Let me take a look. Where are we at?
All right. It's right here.
Wow.
Right.
Yeah.
So we've talked a while just about names and naming.
Oh, it's kind of the point that I was making.
Hmm.
This is what happens when Joe isn't around.
We have to do these like real time edits on the fly.
So I'm going to say like we just do the two because we've already gone on for this one.
So in which case, then we want to ask, dear listener, for a special favor.
Yes, and it's my turn to beg.
I like how we just are so blatant about it, like we're going to beg.
Is this begging? Yeah, I guess it is. I like how we just are so blatant about it. Like we're going to beg. What is this?
Yeah,
I guess it is.
Look guys,
if you,
if you enjoy this show,
which hopefully you do,
hopefully you're listening because somebody told you about it and they wanted to share the joy and the knowledge that we sometimes drop on here.
Um,
you know,
please do take a few minutes when you get home or after you're done cutting your grass or whatever and
just go into itunes if you haven't installed and you know click the five or click whatever you feel
is appropriate it's totally a five star totally a five star and leave us a comment man like it
seriously makes our day if you were like me and you hate itunes and you don't want to install it
you know head over to stitcher and you know sign up for an account or something and leave us a review
there. At least you can do all that on the web. Um, but seriously, that is like the one way that
you can give back to us. That is absolutely amazing. Cause it helps us get out there and,
you know, get a bigger audience and we have an amazing Slack channel and that's all growing
because of this type stuff. And, and when I say that we have an amazing Slack channel, and that's all growing because of this type of stuff.
And when I say that we have an amazing Slack channel, like, it is.
And we get compliments on that all the time.
People love that.
And you know what?
We love the opportunity to be able to interact with you.
And apparently you guys enjoy the opportunity to interact with each other, which is amazing.
That's the most amazing part about it.
Yeah, because, I mean, there's days like this week I was kind of slammed a little bit,
and I didn't get to jump in there as much as I wanted. But come back and the conversation's still flowing and it feels amazing one of the most amazing comments that i
read in the slack channel recently and i don't remember the name uh you're gonna call me out on
it i know and i'm gonna feel bad for not remembering this while you look it up but there was a guy... Benjaneer. Okay, yes. He said it was 120 miles between him and the next closest developer around.
And so that was one of the things that he enjoyed about the Slack community
was it was an opportunity for him to actually be able to talk
and communicate with other developers, like-minded developers,
while being so distant from you know other developers and i
thought that's amazing right yeah i mean we really have and it's not it's not me and michael and joe
i mean yes we get in there and we talk and all that but but everybody that's in there have created
like seriously one of the best communities i've ever seen there are some great personalities in
there too yeah i mean there's helpful stuff going on. There's funny things that happen, like people constantly
helping each other out. I mean, it's absolutely killer. And we've got a ton of different channels.
There have been examples of just people saying like, Hey guys, I'm updating my resume. Can
somebody take a look at this link and tell me if you think this looks good, which is an amazing
idea, right? Like what a way to get feedback if you're
actually on the hunt for a job and here's a community of hundreds of developers that you
could just be like you know randomly throw it out there and you're going to get back like you know
pull requests on your own resume yeah yeah it's pretty crazy so and seeing as i was speaking of
slack you can head over to www.codingblocks.net slash Slack, drop in your
email and you'll be in the club. Um, as far as leaving us a review, we want to make that easy
as well. So head to www.codingblocks.net slash review and, you know, choose your platform. You
can click the iTunes or the Stitcher link and it'll take you over there. But seriously, thank
you for those who have filled out a review and, and for those of you who are considering it now please please do that if you
get a chance so here's one of my favorite parts it's the survey says section ding survey says
all right so man what was the name of that show a family feud man family feud yeah really oh man i love that
show maybe that should have been the next survey what's the name of that show um all right so
the question from the survey from last episode was what's your favorite source of caffeine
oh yeah i forgot about that all right wow i think uh joe must have left this i think joe did it
the show notes last time yeah he did i think he left it open for uh people to
write in their own there's like spice because there's some amazing ones in here
um that wait are these even about am i looking at the right one? It should be episode 46, right?
Yeah, because there's a, oh, wait a minute.
Like, for some reason, it seems like it's showing me mixed ones.
I'm seeing results that are from, oh, yeah, totally.
I'm seeing results.
That's interesting. In our polling software here, it's showing me the answers that are also written in from other ones.
So I'll have to be careful to avoid those when I'm giving you your options here, Alan.
So listen up.
You ready?
I'm listening.
So option number one is coffee.
And not just any kind of coffee.
Uh-uh.
As I wiggle my finger.
Uh-uh.
We're talking about fancy stuff here.
Expressos, cold
brews. We're not talking
about just give me black coffee.
Right? Or
there's coffee, like
for normal people. Like, you know,
you take it black. Maybe you want a little bit of
cream, a little bit of sugar, but none of this
cappuccino or espresso.
None of that.
Why did we have to say that?
I was trying to be fancy about it.
Okay.
That's all I was honestly trying to be was fancy.
I guess I'm bad at being fancy.
Or the hard stuff, which is like the five-hour energy drinks
or caffeine pills.
I noticed that straight up injections were not offered as an option there.
Somebody wrote it in.
Um,
no.
Oh,
okay.
Okay.
Um,
or anytime I can hear Michael's voice,
it would be awesome.
Oh wait,
that was from a previous poll,
but it is still probably relevant because you get to hear my voice.
Um,
let's see. I think that might've been it, but there's a lot intermixed here. Okay. Still probably relevant because you get to hear my voice.
Let's see.
I think that might have been it, but there's a lot intermixed here.
Okay.
Energy drinks such as Red Bull or Monster, your choice here.
Would Jolt Cola count as an energy drink, though?
Yeah.
I mean, it's a cola.
It is.
It's in the name. It's just nothing but sugar. I don't even know how it energy drink, though? Yeah. I mean, it's a cola. It is. I mean.
It's in the name.
It's just nothing but sugar.
I don't even know how it's liquid. Well, okay.
Speaking of, then we get sodas.
Mountain Dew, Dr. Pepper, Coke Zero.
Really?
Why is that even on the list?
Definitely, Jolt Cola should at least be given a mention.
Yeah, I would agree with that.
And then you bring up the sugar because you have like the the throwbacks
that pepsi has brought back so you have like the mountain dews made with real sugar man those are
so or the dr pepper is made with real sugar which i think yeah maybe it's good but it's also sad
that it's come to that that they have to actually real qualify that this is a soda made with real
sugar and this other one we're not really certain what it's made with,
but we don't exactly want to tell you either.
But legally, we had to put some name on it,
so we're going to make it a lot of letters that nobody can pronounce.
High fructose corn syrup.
Yeah.
All right.
And then there's the option of none.
My body is a temple.
It's a wonderland.
I don't need caffeine.
I'm high on life, baby.
So I'm going to go ahead and say that that was nothing.
Wait, there's one more option.
There's one more option for you, and this is for all of our proper English friends.
All right.
Okay?
So we're talking to you people.
England.
Yes.
London.
Tea.
Hot.
Cold.
Doesn't matter.
All the tea.
Give it to me.
Right?
Which if, you know, I mean, hey, with your Southern accent, Mr. Californian,
Southern, you know, tea, sweet tea is an amazing thing.
Speaking of sugar, real sugar at that.
Sweet tea is sugar with a splash of water.
Yeah.
Otherwise, you didn't make it right.
So I'm going to go out on a limb and say the body is my temple that's like maybe one person ever even said anything
about that okay um so that one's not going to win i i honestly think that it is going to boil down
to either energy drinks energy drinks okay or coffee regular you know give me some cream and
sugar type okay well let's say you have to pick one.
I'm going to go with the coffee.
Okay. You want to put a number behind it? You feel confident enough?
Or are you too afraid?
25.
25 percent.
So you think coffee won by 25 percent and the other ones are scattered evenly enough to where they weren't.
They were, you know, maybe because 25 is a small number.
So they're all relatively close.
But 25 is the overall winner. Well, by Price is Right rules, you know, maybe because 25 is a small number, so they're all relatively close, but 25 is the overall winner.
Well, by Price is Right rules, you win, my friend.
Sweet.
This is the first time.
But you're way off.
Oh, is it way higher?
Coffee had just over 50% of the vote.
Normal coffee.
Normal coffee. Not the espressos, not the fancy stuff.
Just normal coffee with just over 50 of the vote
now here's where it's also interesting too that you're wrong the the nun option my body is a
temple and a wonderland yeah that was actually a lot more popular than you think really it was
more popular than the soda was man we're programmers we don't care about our bodies i don't understand
that i don't understand that at all actually i take that back i've actually known some programmers that are hardcore like
workout nuts oh no there totally are there totally are a lot of those guys i'm one of them thank you
have you seen this check this out totally totally work out every time i walk around i work out work
out so uh yeah no the the soda option was actually the least popular.
Really?
Which blew me away.
But I didn't say soda.
I said energy drinks.
Oh, I'm sorry.
Well, okay, then fine.
That was not the least popular.
Right.
I would imagine that's up there.
That's pretty close, right?
No.
No?
No.
Actually, the coffees, both coffee options were the top picks. I destroyed it. The none option was actually third. No. Actually, the coffees, both coffee options were the top picks.
They destroyed it.
The none option was actually third.
Interesting.
Yeah.
So it was either people like regular coffee, fancy coffee, or just nothing at all.
Right?
But the soda option was the least popular one.
And I remember there was a period in my life where i i never would touch coffee at
all right and i was totally like dr pepper was my thing that that was my go-to right there i mean i
would get i would it was fighting words if you try to tell me that mountain dew was better than dr
pepper because i'm like uh-uh but hold up though that with sodas though there's always that crash
period afterwards.
Like coffee, you don't typically get that, but with soda,
like I would remember you'd be ready, and then an hour later,
you'd literally be drooling on yourself.
Well, that's everything with sugar in it, man.
Yeah, but coffee kind of keeps you sustained for a bit longer.
Well, I mean, it depends on how much sugar you put in it.
You could have the same crash.
I mean, if you have a sugar crash, you have a sugar crash.
It doesn't matter what the injection is for that sugar crash.
Because even with like an energy drink, a lot of those have high, high levels of sugar.
Major levels of sugar.
So, I mean, that's why you have wings.
Oh, very cool.
That's why you're flying.
All right.
I got one right.
So, yeah, you got that one
so chalk up a win so then for the new survey for this episode then um going back to uh
ben ben jam uh benjaneer uh it made me question then like well because he said he'd only just recently attended
a meetup and i guess because of the distance i don't blame him right um but uh the question is
do you regularly attend meetups or conferences in your area so here are your options yes because i
need to get out of my command center every now and then and and let's face it it's really a command
center have you seen like if you don't think it's a command center then what is it uh reddit uh
battle stations subreddit oh my god it's totally a command center um i mean like even with our
array of monitors around us you know in the glow glow of UV light that we bask in.
It's totally a command center.
And then no, because who has time for that?
Nobody has time for that.
Like, why would I go to a meetup or a conference?
Or no, and you got to say this one in the right way.
No, because I live in the jungle, baby.
You're going to die.
That just happened?
Well, otherwise, if I just read the words, you'd be like, wait, what?
Oh, that's awesome. No, so you got to put on your best Axl Rose and read that one.
Oh, that's excellent.
I am curious what people are going to say here because, I mean,
I know we try and get out to them on occasion, not as much as we'd like to.
Well, that's because we live in the jungle, baby.
Yeah, we do kind of live in the jungle.
And you know what?
I mean, looking at the time that we've done on this one,
I think we are going to just split this one and do the functions and the comments on the
next episode oh okay because this one will go long so we do have one other thing that we want to talk
about there so outlaw made a comment to me recently that i have no idea where he was going with it
the best android distribution is ios okay what now i know these are fighting words because between alan okay so here's what you might
not understand dear listener is that um alan much to his credit more so than a lot of other people
that i that i know um he flips around from devices or at least he was actually you haven't recently
but like he was for example uh he was one of the few people that I knew that used Windows phone like and that was his only device.
Not just like, hey, I'm playing it because I have friends.
It was like, OK, yeah, I have like one of each platform and I'll just switch this, you know, swap the SIM out every now and then.
Like that was his go to device, his only device for quite a long time.
Right. And then he ended up switching to Android.
But when he left iOS, it was kind of like he left iOS, well, A, early,
because that was years ago.
I was on the 4th. So in fairness.
Yeah, I was on the 4th.
So it was early compared to now, right?
But maybe it sounds like from the way you've described
it was a little bitter because there were some things that you didn't like right about it so i
realized that my saying this statement is definitely fighting words like like he he definitely like his
eye just one of his eyes just started fluttering, like blinking really quick. And the other one was just kind of like staring at me like,
what did you just say?
Right?
So, but here's my thinking on this, though.
Like, especially, and maybe this is because we are into gadgets
or into technology.
I'm not sure.
But sometimes you just get bored, right?
And you're like, okay, you know, half the fun of, you know, switching operating systems
is just because, you know, you want that challenge.
You want that fun.
You're like, okay, how do I make this work again?
How do I do that again, right?
You know, oh, that's the command line and everything, right?
So that's kind of fun.
And so changing platforms, like mobile platforms can be the
same thing right yep so sometimes you might yeah you know i'm tired of ios i want to switch to
android or windows phone or whatever right but the thing is is that they've gotten so just
like all of them i don't care what it. They're all so close to the same thing
that there's really not a whole lot of difference.
So unless you're just really entrenched
into one of the ecosystems,
that's the only reason why I could see
why you'd really stay in one or the other
because it's not, you will never convince me
it's about one has some feature or some function that is so much more awesome than the other because it's not you you will never convince me it's about one has some
feature or some function that is so much more awesome than the other one right i mean i i i
know that people argue that all the time and i see you trying to say that argument right now
no actually but no so i i will agree with you to a certain standpoint so but here's my point though
because like my one favorite thing when i was on android uh it's been it's been what two years now since
since i was last on android as my my main uh and only device but um you know i know like one of
the things that a lot of people rave about is their favorite thing is the uh the widgets yeah
the customizable things that i things that I hate.
The name that I hate.
Yeah.
You know, a lot of people like the widgets.
I never was a fan.
Like, it wasn't that I was anti them.
It was just more like, eh, I mean, it's okay.
I mean, the thing that, you know, more often than not,
like I didn't use them because, A,
I never really found anything that I felt were meaningful.
Yeah, see, that does nothing for me.
I have a Roku controller widget on one of my pages.
Yeah, it's like, why not just open the app then?
You have that.
It's right there.
And here's the thing that I hate about that.
That widget takes up the entire screen.
So now you have to have multiple pages.
You have to increase your pages because widgets are taking up the bulk of the space.
And so that's why I was always like, well, if I'm going to have a widget, it needs to
be something extremely informative that launching the app just can't wait. I can't wait for
that. Right. And so that's why there never was anything that really was in that thing.
Like maybe weather was about the closest thing that I really wanted to be able to just see at a glance, right?
What about like a Reddit thing or a Flipboard or any of those?
You didn't care about the articles?
No.
I would rather just go into the app.
And so I get it.
Everybody has their own preference.
And that was mine is that I didn't want to waste the space for a widget for something like that.
I'd rather just go into the app. And so there were very few things and whether it might've been like the only
one where I would really be okay with let's conserve and let's use the space
and,
you know,
force me to have to increase my page count for icons.
But the one number one thing that I absolutely loved about Android is the,
um,
uh,
Google now.
Oh, it's beautiful. google now is amazing i love it
it is the number one thing that i always loved about android right but for years now i mean
that has been available for ios as an app oh really yeah and so i get all the exact same benefit of it
the same beauty of it the very only difference is that on my Android device,
which I still have and play around with,
I could just scroll all the way to the left and then boom, there it was.
It wasn't an app you had to launch.
Right, whereas this is an app.
And that's really the only difference and the takeaway.
And that's kind of what I was getting at is that if you were entrenched
into one ecosystem, then for me, which I do have a lot of, you know, iTunes related content, you know, music, because I've been on that platform forever.
Right.
But, you know, having, you know, the, you know, that one Google feature, I mean, because I can have maps.
Right.
I can have a gmail
app like like name a name a google app that i could have on my android phone that i'm not going
to have on ios yeah right now there's not i mean there and i doubt there will be for quite a while
because i mean it would be stupid for google to yank those because they're going to get money off
that stuff somehow right and that's my point is that like there's nothing because because here's well here's and here's why i bring this up because i was getting i've been
getting kind of bored with um ios and you know while it was nine in fairness ios nine uh i was
getting kind of bored with it and and you know with each release of android you know like i said
i still have my my android device and i'll play around with it and every once in a while i'll be
like maybe i'll swap out my sim and and just use this
one for a while and then i'll look at it and i'm like oh yeah this is really boring there's really
nothing here that's exciting that's any that's you know this doesn't it's a stupid phone yeah
it's a stupid phone that makes stupid phone calls to make stupid text messages they do all the same stupid stuff they do so ios i can do all the same stuff on ios that i can do on android but because of apple i
can also do things that i can't do on the other which is why apple is the best version of android
so i get i get what you're saying yeah i, they've all kind of come to parity between the different platforms.
For a long time, one of the big things for me is the hooks from different applications.
Because on iOS, a lot of things were sandboxed.
I know they changed that recently with one of the iOS versions.
Well, that was changed a while back.
Yeah, I think it was 6 or 7.
I don't remember when they changed it.
But like on Android, if you found an article on the web that you liked,
you could go to share, and you could choose any number of apps
that you wanted to share it to.
And that was always huge to me.
I liked that.
But really, honestly, what it's boiled down to over time is iOS bores me to tears.
I love it on an iPad because I'm consuming stuff, right?
Like if you're on an iPad, you're consuming.
On a phone, it just bores me to tears because i'm so tired of those square um app launcher things and all
that kind of stuff but you mean icons yeah the the icons square app launcher things i can't i
literally like they they kill me but you're right they are all so much at parity right now that
really the the thing about a phone to me nowadays with smartphones anyways is what what is the
feature that you want like like what you said right like it makes total sense for a person who
has kids and wants to capture every moment of their lives to have either an iPhone or a galaxy,
right?
Those have fantastic cameras.
They're going to work.
Uh,
my next,
unless you want that galaxy seven to blow up in your face.
No,
no,
no.
That's the note.
I'm sorry.
The galaxy note seven.
Um,
uh,
the,
uh,
like my six P it takes great pictures.
So I'm happy with that.
But like,
they're starting to do things with phones that are kind of interesting.
Even the picture thing though, man, like that's getting to where it's like, okay, who really cares?
It can be.
I mean, I know that you still hear reports about people saying that even though iOS or Apple might not use the most megapixel camera that some other Android one has, they still do a better quality job.
Yeah, the software makes up for it makes it
so much better okay fine whatever who cares you know the point is is that they're all close enough
they're like for the for the average person taking a photo of your kids or something at any one given
moment like me i mean yeah so that's one but the other thing is it's starting to get interesting
so like some of the phones that have been built recently they've been built with like high-end
dax for people that love audio.
So if you have a nice set of headphones and you want to hear music.
Oh, I feel like this is a dog at iPhone 7 coming.
Not at all.
I mean, they've gone an opposite route.
Like they're going wireless.
Right.
And some people really appreciate that.
Others won't.
So I don't know, man.
Like the one thing I will say is Windows is kind of that's left me.
I feel like Windows has given up. I think i mean it doesn't feel like i mean and maybe i'm just behind the times for not falling
up because man that you don't hear anything about that no nokia kind of has kind of not
done anything in a while and they've been talking about a surface phone but that sounds like that's
going to be more proof of concept type stuff that they
just want to see the uh what is it called the uwp universal i feel like at this point microsoft
should just embrace android and go all in use it yeah i mean so it's kind of interesting but i do
agree like they're all at pretty much parity now and the reason why i buy the phones i do is because
they're cheaper than and i i can't pay a thousand000 for an iPhone. I have a hard time doing it.
6P wasn't cheap.
The 6P was $450, $500 maybe.
I mean, it was half.
And that's a big deal.
And especially considering, like you said, I kind of go through phones on occasion.
Now, here's the – more than anyone I know.
Now, here's the – yeah, yeah i mean you're hard on phones man
i think i think in the time we've known each other i've had like a couple and that's just
because like there was a new one that came out but you'll go through a couple in a year because
you break them i've had a couple more for sure yeah rough man you need to buy an insurance plan
but here's the interesting though that I just noticed with iOS 10,
and I haven't heard anyone talk about this,
but before, one of the things going back to the comparison of Google and iOS
is that with Google, if you didn't like the mail app, you could replace it.
You could use something else.
And now in iOS 10, you could totally delete a bunch of the default apps.
You said that earlier.
I sent you a screenshot.
Have you tried it?
I haven't yet tried it because...
You're scared?
Maybe.
Probably.
Because they didn't realize that they accidentally turned that on.
Well, no.
If you're going to delete it, the whole thing's going to break.
And it's interesting, though, because they're selective about what apps you can do that with.
But there are definitely...
Like the Calendar app.
If you don't like the iOS Calendar app, you can now delete the Calendar app there are definitely like the calendar app you can if
you don't like the ios calendar app you can now delete the calendar app you could delete
the mail app that's right so i haven't tried this yet but it's totally interesting there's
i'm gonna have to play around with that and be like deleting some apps and then when i can no
longer make a phone call and i brick my phone i'm like um hey alan you got an extra android device i could borrow
i probably do probably i will say there is one feature that is on phones now that i pretty much
wouldn't be able to live without and that is the fingerprint sensor right i mean apple made it made
it the thing and it really it changes the frustration level with phones especially when
you use things like LastPass.
Now, here's one thing that I still like about,
I still feel like from a security point of view,
when you talk about the hardware being integrated with the software,
I feel like they got it better than the Android platform.
That's why I actually buy Nexus devices, though, because I actually want to be as close as possible to what google has plans for
so yes i totally agree with you on that but so yep uh so i guess we all agree that ios is the
best android distribution so in i'm gonna get a lot of hate mail you might um uh so the resources
we like you know uh obviously clean code so we'll, you know, uh, obviously clean code.
So we'll have a link to that in the show notes.
And, uh, let's go on to Alan's favorite, favorite, most favorite portion of the show.
It's the tip of the week.
The millennia.
No, wait, what?
I need new words for this.
All right.
So I, I don't think I've done this one before.
Um, at one point I was,
you know, working on a side project, one of the 50 that I've tried and haven't finished.
And there was something I came across that I thought was awesome. So when you're setting up
an application and you want people to be able to log into it or whatever, you can go many different
routes, right? Well, one of the ones I like that I think would bring people into your platform easier is using OAuth.
And so you can authenticate with Facebook, authenticate with Google+, Microsoft, whatever, right?
Like there's tons of services out there.
And Meteor makes it so easy to use.
Oh, my God.
Meteor was amazing.
I don't know why I stopped looking at that.
But at any rate, I digress.
So back to this, there is one, if you're a.NET developer specifically, sorry, everybody else, this tip is for.NET people.
There's a website called oauth4asp.net.com, and it's got code samples.
Did you say asp.net.com?
No, no, oauth4asp.net.com. Did I say that? I think I did you say asp.net.com no no oauth for asp net okay i think i thought you
i thought you said asp.net.com and i'm like wow that's not confusing at all all right let me
rewind here oauth for asp.net.com all right there we go so what's really cool is if you go up to this site, they have samples for basically connecting to just tons and tons of different things.
And it looks like I put the wrong link in here because it took me to one of my other tips.
I was going to say, like, I don't think this is what you want,
but we can talk about Selenium if you want.
Yeah, that's another one.
But no, so, like, here's a few of them.
They have it for Buffer, Foursquare, Facebook, Google, GitHub, Dropbox, Instagram, Microsoft, LinkedIn, OpenID, Shopify, Salesforce, Reddit, blah, blah, blah, blah, blah.
So you can literally go up here, get code snippets for how to do it.
They have walkthroughs.
They have videos on some of them.
And they have the code.
So you can literally sit there and figure out how to do it they have walkthroughs they have videos on some of them and they have the code so you can
literally sit there and figure out how to do it plug it into your own app that you want to make
available that people can authenticate with and you're there that's awesome that's pretty cool
right i mean and and to be honest i actually did step through one or two of these it's so easy i
mean it really if you set it up to where you can work with the oauth
it's amazing right and and now you've opened up your platform like i'm looking at the one for
github and there's three steps there's four total right but the fourth one is just advanced
configuration yeah the first three are really all you need and they fit on the same screen like i
don't even have to scroll to see it i can read those three steps it's absolutely killer man absolutely killer so definitely if you are
writing an app and you need to and you want people to come into your app and participate
make it easy for them if they already have a facebook account let them authenticate with
facebook right don't force them to sign up for an account to get into your app. Well done, sirs that created this.
You know, and here's another cool thing, too, is like you click on some of these and you can fork the directions that they give on GitHub.
Isn't that awesome?
So they give you the directions on like how to do this.
And it's just a read me file.
Right. But you could you could fork that on GitHub fork that on GitHub to do whatever you wanted to do.
Yeah, you could improve it.
You could do whatever, right?
I guess, I suppose.
Well, if you're going to fork it, you're not necessarily contributing back.
But whatever.
It's cool nonetheless.
Okay, and so, Bingenere, again, for you, buddy, here's the tip of the week.
Get out there.
Right?
So, yeah, he kind of inspired this one, was that at least in the Atlanta area,
there are a couple great conferences coming up here in October
that there's still an opportunity for Alan to sign up for.
God, I need to.
I keep forgetting.
The first, the big one for the Atlanta area is Connect Tech,
previously known as Connect JS.
So that's October 20th through the 22nd.
Look forward to seeing you there.
Come find us.
And then the one before that, which will be just a one-day event, which is Atlanta Code Camp,
October 15th is coming up. So if you're in the area and you have the time or ability to make
either one of those, I would definitely recommend it. And if you happen to see us there, feel free
to say hi, introduce yourself. We love to meet new people.
But if you're not in the Atlanta area, there are events around you.
Take the time to find them.
Meetup.com is a great way to find events that are going on around you that aren't as formal as a conference necessarily, but you know, it's an opportunity to network. It's an opportunity to learn about new technologies or ways to do things with technologies you're already familiar with.
So I highly recommend it. Go out there, take a step outside of your command center every now and then and, uh, get out there. Yep. Excellent tip. And with that wrapping up, we've covered chapters two through two.
Yeah.
Alan got a little wordy.
Yeah, maybe a little bit.
So we'll be picking back up on this in the next episode.
So stay tuned for that.
So how do we want to give these bad boys away?
Matt, I don't have any clue.
What do you want to do?
All right.
Let's say comments on the. Oh, I don't have any clue. What do you want to do? Alright, let's say comments on
the... Oh, totally
love that one. So, let's
do this. So,
this will be consistent with
how we've done other giveaways then.
So, go to
www.codingblocks.net
slash episode
47 and there
you will find a comments section and feel free to leave some
comments there and we will put all of those names in a hat and we will draw from those in the first
or the three names that we draw from that collection we'll get a copy of clean code
shipped to them and check it out guys just so you know i mean this
isn't this isn't a garbage one like the book is currently 30 on amazon and the kindle version
is 26.99 and i would imagine we could we could probably do either you know we could we could
ask for a preference i i would personally want the kindle if if it were coming to me but um oh so we weren't going to ship these direct i was going to ship this copy or if you don't want
to well i was just going to do well i mean as soon as i'm giving away our source i can't i can't i
gotta have it well i mean buy another one i'll just buy another kindle one so yeah i mean you
tell us do you want the kindle or you want a paperback and you And, you know, obviously you're going to have to leave a comment.
And, you know, they can be funny.
They can be informative.
They can be whatever.
Oh, yeah, we've had some great ones in the past in these contests
where they have gone into lyrical form.
Yes, yes.
So, you know, break out your best M&M.
Or vanilla ice.
Okay, maybe you might want to stay away.
He didn't have the staying power that Eminem has had.
Man, that guy still has lyrics.
Those lyrics are still in his head.
That's impressive.
From the one song.
Yeah, the one song was, you know.
I mean, I get it.
You're rolling in your 5-0.
That's right.
As we do. As we do as we do yes so um yeah definitely leave a comment on there and we will get that contest together and with that that's that's uh episode 47 yeah so be sure to subscribe to us on
itunes stitcher and more using your favorite podcast app. And be sure to leave us reviews by visiting www.codingblocks.net slash review.
And visit us at codingblocks.net, as if we didn't just say that a second ago,
where you can find our show notes, examples, discussions, and more.
Why you got to hate, man?
It's just one of those things that I've noticed every time,
and I'm like, why don't I ever change that?
Anyways, send your feedback, questions, and rants to comments at codingblocks.net.
And be sure to follow us on Twitter and head over to codingblocks.net where you can find all our social links there at the top of the page.
And if you click them, they should take you to those places.
And absolutely, absolutely, absolutely, absolutely join us on Slack.
Yeah, totally.
www.codingblocks.net slash slack you can send yourself your own your very own invitation and jump in there and enjoy
the conversation yeah there's all kinds of great channels in the slack so once you do join be sure
to uh explore and find the different channels that are available because initially you
might um not notice all the great channels that are there that might be you know some fun relevant
ones for you rants and dev talk are must dev talk is definitely up there yes so that's it guys we
will be back soon and with joe. So, again, we missed him.
And, you know, we'll have him back next episode.
Peace.
Later.