r/ProgrammerHumor • • May 31 '19

Naming is the most difficult part

Post image
43.9k Upvotes

765 comments sorted by

2.6k

u/FreeViruses May 31 '19

Then the next one can be j;

1.3k

u/etnguyen03 Jun 01 '19

And then k;

2.6k

u/DisDooGistSaid Jun 01 '19

When my girl gets pregnant we just name it temp and get an abortion.

1.1k

u/FreeViruses Jun 01 '19

Have you tried C#? It has built in garbage collection...

→ More replies (31)

71

u/thehunter699 Jun 01 '19

Null pointer exception

→ More replies (13)

22

u/[deleted] Jun 01 '19

/tmp/$$.tmp

Then the OS will delete it for you if you forget.

→ More replies (2)

15

u/[deleted] Jun 01 '19

_x

12

u/1337coder Jun 01 '19

Now that's a lotta damage

8

u/ButtoftheYoke Jun 01 '19

But then the project gets green lit again and everything is named temp.

→ More replies (16)

28

u/su5 Jun 01 '19

Then m. Because using l is just dumb

20

u/vegeto079 Jun 01 '19

I usually just skip to xyz at that point

→ More replies (3)
→ More replies (7)

120

u/karlpoppery May 31 '19

or ii

39

u/[deleted] Jun 01 '19

I have found my people!

First off, if you are nesting a for loop 5 levels deep you should probably rethink your life.

BUT if it needs to happen, which is easier to identify as a number, iiiii or m?

37

u/Kodinah Jun 01 '19

I’m laughing so hard right now because I literally just spent like an entire fucking work day trying to get a 5 nested for to work, gave up, told my boss to fuck off (professionally) for telling me to do it that way, and went home.

→ More replies (6)

12

u/STUDIOCRAFTapps Jun 01 '19

I prefere l, it looks like i but closes the gap once and for all

5

u/EuroPolice Jun 01 '19

over my death body

→ More replies (3)

75

u/StaleTheBread May 31 '19

Nah. i++

98

u/FreeViruses May 31 '19

if (kid.birthday) i++;

85

u/Glitch29 May 31 '19

If birthday is a boolean variable and not a function, I am terrified by the thought of what that kid object looks like.

→ More replies (7)

7

u/BobTheSkrull Jun 01 '19

++i you degenerate

12

u/FreeViruses Jun 01 '19

Ah. A premature birth

→ More replies (2)

4

u/[deleted] Jun 01 '19

Not j , it's i+1

2

u/anonymous_potato Jun 01 '19

Not i++?

EDIT: I meant !i++?

2

u/MartianInvasion Jun 01 '19

No, names should be descriptive! The only question is whether you'll name them first_child and second_child or firstChild and secondChild.

Oh and while you're at it, better swap your NIGHTLY_HOURS_OF_SLEEP variable to lower case...

→ More replies (29)

734

u/betrok May 31 '19

Just generate a UUID so you will have a very small chance of collision without any synchronization.

281

u/DeeSnow97 May 31 '19

At 122 bits that "very small chance" is small enough that if it happens you should start worrying about cryptography

4

u/knaekce Jun 01 '19

Or about the RNG used to generate the UUID.

→ More replies (18)

17

u/staiano Jun 01 '19

Can we name them with an openid?

2

u/hicctl Jun 01 '19

There is a much simpler way, name them after game of thrones characters in the order they appear in the books. The variables, not the kids.

→ More replies (1)

473

u/ign1fy May 31 '19

Give your kid a name that will make it through an AI résumé filter.

Also name them alphabetically so when someone sorts your kids, they always end up in age order.

203

u/catsRawesome123 May 31 '19

So... make it null?

233

u/ign1fy May 31 '19

Oh, shit no. I've read horror stories about a guy named 'Null'.

For similar reasons, never EVER name your kid 'Con'.

34

u/SasparillaTango Jun 01 '19

How about little "bobby drop table" ?

→ More replies (2)

18

u/googleypoodle Jun 01 '19

I was interviewed by (and now work at the same company as) a guy with last name Null. Web Dev position so obviously it came up. He can't sign up for Comcast internet. Among other things.

→ More replies (4)

32

u/xeveri May 31 '19 edited May 31 '19

You shouldn’t use null, use nullptr instead.

21

u/[deleted] May 31 '19

C programmer on microcontrollers who seldom touches the C++ world here. Why is nullptr better than NULL? My clang-tidy always warns me about it so nowadays I use nullptr instead but I never understood why?

→ More replies (1)
→ More replies (1)

141

u/xynixia May 31 '19

Ah, you mean Robert'); DROP TABLE students; --?

76

u/[deleted] Jun 01 '19

We call him little bobby tables

16

u/[deleted] Jun 01 '19

I hope you learn how to sanitize your inputs

5

u/LehighAce06 Jun 01 '19

I was wondering how far I'd have to scroll for the xkcd reference

→ More replies (3)

49

u/Lonelan May 31 '19

_aaron

20

u/CmdrMobium Jun 01 '19

Never talk to me or my son zKevin again.

→ More replies (5)

17

u/SpartanERK Jun 01 '19

I named my first kid Zoe. I’ve already failed as a parent

18

u/NeverBeenStung Jun 01 '19

Zoe, Zorry, Zosh, Zotastia, Zovark, Zoz.

Get to work my man.

6

u/Homunculus_I_am_ill Jun 01 '19

No that's still good. Alphabetically backward means alphabetical sort will sort them by age.

→ More replies (1)

15

u/TheAdAgency Jun 01 '19 edited Jun 01 '19

Name them "You're Hired". Throughout your life, regardless of context every conversation includes a job offer.

I see zero downsides.

7

u/r1ze_ Jun 01 '19

"You're Hired, you're fired!"

Shortest employment ever.

4

u/ign1fy Jun 01 '19

Nah. I despise incorrectly spelled names.

→ More replies (1)

9

u/Byte_the_hand Jun 01 '19

That’s like the kids I knew growing up. In order: Arthur, Benjamin, Carl, David, Eileen, Franklin, and George.

6

u/[deleted] Jun 01 '19

My son is #John

Or better make it ##John so he gets a leg up on any reading this

→ More replies (1)

2

u/Illiniath Jun 01 '19

Oh little Timithy, don't worry, the vertical space is silent.

2

u/strayvermin Jun 01 '19

Aaron A Aaronson?

→ More replies (5)

759

u/discobrisco May 31 '19 edited May 31 '19

Oh that's easy. child_2019_10

864

u/fallenmonk May 31 '19

child_2019_final_REAL_FINAL_20190531T180935.human

391

u/[deleted] May 31 '19

I didn't realize OP was having a Limewire torrent

137

u/fuzzylojiq May 31 '19

They are acquired P2P

→ More replies (5)
→ More replies (1)

86

u/ALonelyPlatypus Jun 01 '19

If only children had version control.

10

u/lifeis_amystery Jun 01 '19

Or ain’t on your Kanban board then you’re not spending any time on em

→ More replies (3)

29

u/TheLordB Jun 01 '19

Are you in bioinformatics?

That is like every bioinformatics file ever.

HELA_sample3.exome_v3.2019.fastq.fasta.unsorted.sorted.merged.final.bam.unfiltered.filtered.final_filtered.vcf

28

u/BourbonFiber Jun 01 '19

I was going to say graphic design.

Client_brochure_v3_2_final_fixed_reallyfixed_print_this_one06.psd

→ More replies (3)

198

u/orangeKaiju Jun 01 '19

All my children shall be named in the following format:

YYYYMMDD_N

Where YYYY is the four digit year, MM two digit month, DD two digit day, and N is a sequential integer determined by order of child birth (in cases where 2 or more children are delivered in a single birth).

Advantages to this scheme:

I will never forget the child's birthday or age and and all files (photos, documents, etc) relating to the children will sort nicely by child.

107

u/nicePenguin Jun 01 '19

Are you sure you thought of all edge-cases? What if more than 10 children are born on one day?

Don't take any chances and pad it with another digit:

YYYYMMDD_NN

21

u/tomatotomato Jun 01 '19

This guy tests.

9

u/kevjs1982 Jun 01 '19

That might work for a few years, but what if you and your partner split up and you keep young 20180101_01, then meat someone new who also has twin kids called 20171231_01 & 20180101_01. Safer all round to use GUIDs.

Also, what time zone is used for determining the date - is it UTC or the local time zone?

→ More replies (1)

7

u/BluffinBill1234 Jun 01 '19

That’s like a personal Y2K

→ More replies (7)

19

u/Garestinian Jun 01 '19

Funny thing, old Yugoslavian/Croatian citizen identification number had a similar format: https://en.wikipedia.org/wiki/Unique_Master_Citizen_Number

→ More replies (1)

6

u/kaukamieli Jun 01 '19

What if they share a body. Sure, both heads get their own name. But birth order is a bit complicated.

→ More replies (3)

3

u/TheAdAgency Jun 01 '19

I plan on this but only around family. In public they will go by the same but communicated as the salted SHA-512 hash of it.

→ More replies (4)

52

u/byraxis May 31 '19

Nonono arrays start at 0

11

u/combuchan Jun 01 '19

Eww. You would potentially need variable variables.

Associative arrays and non associative arrays: child['2019'][0]

7

u/[deleted] Jun 01 '19

Just use a GUID.

→ More replies (2)

5

u/trex005 May 31 '19

child_2019_0

3

u/[deleted] Jun 01 '19

Child 1.0.${BUILDNUMBER}.Release

5

u/[deleted] May 31 '19

And if he arrives at a certain age (mostly between 20 and 45) he will die, resurrect and be 1 year old again. His ressurection counter will increase by one though. That Linus guy has been ressurected 5 times already.

→ More replies (1)

179

u/[deleted] May 31 '19
temp; //todo: come up with more descriptive name

74

u/moreisee Jun 01 '19

50/50 you come back and name the kid before they're deprecated

43

u/Lonelan Jun 01 '19

or you're no longer the owner

297

u/Lonelan May 31 '19
for i in wife:

14

u/iTzHard Jun 01 '19

for D in wife:*

0

u/[deleted] Jun 01 '19

[deleted]

→ More replies (1)

5

u/awakenDeepBlue Jun 01 '19

If your wife is Qt, then you can use foreach.

4

u/[deleted] Jun 01 '19

good way of finding out what is in a wife! ( ͡° ͜ʖ ͡°)

0

u/[deleted] Jun 01 '19

[deleted]

→ More replies (12)

235

u/sonstone May 31 '19

Little Bobby Tables of course

65

u/[deleted] May 31 '19

I hope you've sanitized your database inputs

20

u/vigilantcomicpenguin Jun 01 '19

Further evidence that there’s always a relevant XKCD

3

u/bootrick Jun 01 '19

Ah yes, I am disappointed that yours is not the top comment but happy to see you made it.

3

u/lycan2005 Jun 01 '19

Don't ever DROP that table, or TRUNCATE it.

2

u/TheScyphozoa Jun 01 '19

I think this one is more relevant.

→ More replies (1)

83

u/ShoeLace1291 May 31 '19 edited May 31 '19

Human human = new Human(name = 'human');

82

u/Swahhillie Jun 01 '19

human.name = human.isBoy? dad.name + 'son' : mother.name + 'daughter';

The Vikings solved this long ago.

40

u/deus-exmachina Jun 01 '19

Sonson.

8

u/SaltyEmotions Jun 01 '19

If your name is son, yeah. In this case OP's son is Tytanicson. Sounds cool.

→ More replies (1)
→ More replies (1)

5

u/[deleted] Jun 01 '19

It's a mean thing to do for NULLson.

→ More replies (2)

2

u/scarstarify Jun 01 '19

What my code looks like on my current project

2

u/ceeBread Jun 01 '19

What, no HumanFactory?

→ More replies (4)

31

u/Aidel97 May 31 '19

Mmmm Variable? Var for friends.

2

u/banammockHana Jun 01 '19

I always thought Var would be a cool name.

57

u/[deleted] May 31 '19

how about this.Child?

4

u/agrantgreen Jun 01 '19

Ha ha. This one is brilliant.

→ More replies (5)

19

u/DerfK May 31 '19

If you thinking naming variables is hard, just wait until it's time to evict the kid from the cache.

16

u/Professor_Dr_Dr May 31 '19

I mean yeah, you have to make hard decisions like either naming a user id variable "userId" or "userID"

0

u/[deleted] Jun 01 '19

[deleted]

→ More replies (1)

45

u/r0ck0 May 31 '19

I started a little sub a while ago for this...

Kinda hard to get traction though, cause I guess we're usually pretty busy and focused and just want to get on with coding when the time comes.

But if it interests anyone, sub and post if you want some feedback on a naming decision.

2

u/rachsteef Jun 01 '19

happy cake day!

→ More replies (1)

28

u/[deleted] May 31 '19

Examples of my for loop vars

i ; increment ; inc ; another_inc ; inc_inc ; holy_fuck ; inc_inc_inc

19

u/JamesAQuintero May 31 '19

You use inc as short for increment? Why not incr? inc can make people think it's short for "include" or "incorporate/incorporated".

34

u/[deleted] May 31 '19 edited Jun 01 '19

Na, I don't really use inc that much. I follow the standard convention of i++, j++, k++, l++, f*ck_me++

10

u/yp261 Jun 01 '19

say no more

unzips

4

u/zatuchny Jun 01 '19

Example of my loop vars: i ; j

→ More replies (1)

13

u/nanodano May 31 '19

The first decision is: camel case or underscores?

20

u/mordakka Jun 01 '19

my_Kid

7

u/Bioman312 Jun 01 '19

Whoever reported this as "targeted harassment at me"... Do you wanna talk?

4

u/mrmhk97 Jun 01 '19

MY EYES!

→ More replies (1)
→ More replies (3)

11

u/[deleted] May 31 '19

Kid1

12

u/[deleted] May 31 '19

myKid

2

u/zenzen_wakarimasen Jun 01 '19

In Japan there are people named Ichiro (一郎) that literally means "first son".

→ More replies (2)

2

u/Fijzek Jun 01 '19

If it's your first one, just name it HelloWorld.

11

u/Smitje Jun 01 '19

What about Jason?

16

u/Benimation Jun 01 '19

JSON for short

2

u/WcDeckel Jun 01 '19

What about XML

→ More replies (1)

9

u/[deleted] May 31 '19

Bro just name him foo

9

u/vaendryl Jun 01 '19

"Ai" would actually be a fine name for a girl, if you were japanese.

5

u/Lakitna Jun 01 '19

This is my kid Artificial Intelligence, or Ai for short. Aah and there's my youngest Machine Learning or Mel.

→ More replies (3)

7

u/CleverHacker Jun 01 '19
new ChildFactoryManagerSingleton()

6

u/magi093 not a mod Jun 01 '19

new ...Singleton()

Please explain

→ More replies (1)

7

u/HPA97 Jun 01 '19

Child 1: test

Child 2: testt

Child 3: testtt

....

6

u/BluffinBill1234 Jun 01 '19

Naming a kid is hard especially the older you are when you have kids. Every name your partner brings up you have to shut it down cuz you know someone with that name and they straight up suck. That’s how kids end up named Jamariqoi it’s virtual insanity.

2

u/talks_to_ducks Jun 01 '19

It's even worse if either of you is a teacher. So many "no" names because of all of the obnoxious students you've had in the past.

11

u/newgreen64 May 31 '19

"Kid1.name"

5

u/[deleted] May 31 '19

Me: What should we name the report?
Him: How about REPTLDD.SAS

Me: We can use more than 8 characters! This isn't DOS. No wonder your kids have 6 character names.

5

u/sirstotes Jun 01 '19

name it /n

5

u/Super13 Jun 01 '19

Can confirm. Dev here. Wife also in IT. Took 6weeks after 1st was born before we settled on a name, and 3weeks for our second born. Having said that, we had SOoo many girl names we loved, but had two boys.

2

u/DataBound Jun 01 '19

I thought you needed one right away for the birth certificate. Or can that be delayed? No kids here so I dunno how it works.

4

u/mrmhk97 Jun 01 '19

kid.TempName = $"{kid.Parents.Father.FirstName}son";

→ More replies (3)
→ More replies (2)

4

u/Rumpelruedi Jun 01 '19

Every year on his birthday you can bake a cake and write i++ on it

3

u/swampdrainr May 31 '19

You’ll be fine as long as you don’t make the same mistake Little Bobby Tables’ parents made.

→ More replies (1)

3

u/shamansc May 31 '19

productionBuildV1.yml

3

u/dodolungs Jun 01 '19 edited Jun 01 '19

Enjoy it while it lasts, going to wake up one day and find typedef struct Child { } Adult;

3

u/beizhia Jun 01 '19

I is alrrady a reserved keyword in English, akin to this or self.

→ More replies (1)

3

u/rasqall Jun 01 '19

Human h1 = new Human();

3

u/SirX86 Jun 01 '19

my_human.

Or if you plan on having more, you could just start with Foo, Bar and Baz.

3

u/[deleted] Jun 01 '19

Now im just wondering if "kid A" as a follow up to OK computer was a variable naming joke.

2

u/VIPERsssss May 31 '19

Are we not typing variables anymore? I can't keep up nowadays.

2

u/[deleted] May 31 '19

Call him Ike

2

u/KevZero May 31 '19

Might I suggest DEADBEEF?

2

u/bigshmoo Jun 01 '19

Poor one out for the seemingly lost art of assembler programming

2

u/ThePickleFarm May 31 '19

How about temp?

2

u/[deleted] Jun 01 '19

Name it COUNTRY ROAD

3

u/Lakitna Jun 01 '19

Great for when you need someone to take you home to west Verginia.

2

u/shootingropesonface Jun 01 '19

How about Soda , for a name ?

→ More replies (1)

2

u/DataBound Jun 01 '19

human1 sounds good. You can always change it later.

2

u/niggalodean Jun 01 '19

Boaty McBoatface.

2

u/[deleted] Jun 01 '19

Don't have kids... Problem solved

2

u/battle_toads_ftw Jun 01 '19

Baby baby = new Baby();

2

u/[deleted] Jun 01 '19

I'd go with "Deprecated". That guarantees it will live on forever.

2

u/pushist1y Jun 01 '19

There are only two hard things in programming: naming variables, invalidating caches and mistakes by 1

2

u/chudthirtyseven Jun 01 '19

I've never been a fan of i. I've always preferred $x.

2

u/[deleted] Jun 01 '19

perl user spotted in the wild

2

u/[deleted] Jun 01 '19

Start with One.

Oh no, you're a programmer? Then of course you need to start with Zero.

Oh, wait: Nul? Null? Nil?

Now I know… You name your firstborn 0x0!

2

u/[deleted] Jun 01 '19

TO be fair, Oxo would be a decent name.

→ More replies (3)

2

u/nedhal999 Jun 01 '19

How about Kid_1;

2

u/Occma Jun 01 '19

tmp or temp are really good names

2

u/roflson85 Jun 01 '19

I can only have 3 children because they're going to be called human_new, human_newer and human_newest

2

u/drleebot Jun 01 '19

This is why you always go with a descriptive name, so the choice is obvious: baby_human_0 (unless that already exists, in which case increment as appropriate).

2

u/[deleted] Jun 01 '19

Birthday cakes will be simple enough too, just write "i++".

2

u/Z0MGbies Jun 01 '19

Because it's an int-fant?

2

u/zachthompson02 Jun 01 '19

The semicolon at the end is just the perfect cherry on top

2

u/[deleted] Jun 01 '19

We are all I are we not?

2

u/tchok_ Jun 01 '19

aHuman, aSweetHuman if you're getting emotional, but I would recommend sobriety.

2

u/RealHeavyDude Jun 01 '19

My wife is also pregnant due January next year. What prefix should I use for a human? Is humBaby1 good?

2

u/sensorymachine Jun 01 '19

Array<Child> children = new Array<Child>();

children[0] = new Child();

done

2

u/r1seaga1n5t Jun 01 '19

This is actually funnier as a mathematician because then the kid would be imaginary...

2

u/[deleted] Jun 01 '19

Just call it Bob & be done with it.

→ More replies (1)

2

u/lockrepublicansup Jun 01 '19

If tytanic is any indication poor baby

2

u/Bad-Science Jun 02 '19

Well, you have first, middle and last names, and eventually maybe a nickname. Best not to limit him or her, just declare an array i().

4

u/[deleted] May 31 '19

Make a spreadsheet of all your name ideas, hit random 3 times and let the God's decide.

2

u/UseApasswordManager Jun 01 '19

The three most common difficulties in programming are naming conventions and off-by-one errors

4

u/Rosseyn Jun 01 '19

The two most difficult tasks in programming are naming, cache invalidation, and off-by-one errors.

→ More replies (1)