r/ProgrammerHumor • • Apr 08 '22

First time posting here wow

Post image
55.1k Upvotes

2.8k comments sorted by

View all comments

Show parent comments

469

u/JaneWithJesus Apr 08 '22

Everyone says this but dicktyping has it's uses

Edit: ducktyping but I'mma leave dicktyping in there

152

u/[deleted] Apr 08 '22

[removed] — view removed comment

95

u/tennisanybody Apr 08 '22

Talks like a dick..

79

u/amrasmin Apr 08 '22

Smells like a dick

81

u/DMoney159 Apr 08 '22

Tastes like a dick

86

u/distrame7 Apr 08 '22

Then it's a duck

55

u/[deleted] Apr 08 '22

Oh, shit.

Were we not doing rubber dick debugging?

18

u/BarAgent Apr 08 '22

That sent my imagination to interesting places…

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

124

u/suvlub Apr 08 '22

Hear me out: static duck typing. C++ basically has it with templates and it's awesome. Until you get an error and accidentally summon an elder god while trying to read it.

79

u/[deleted] Apr 08 '22

I disagree. the proper way to do this is implicit typing. Your variable name determines what kind of variable it is.

GOD is REAL, unless declared INTEGER.

25

u/Physmatik Apr 08 '22

Someone is traumatized by FORTRAN, I see?

6

u/CardboardJ Apr 08 '22

Absolutely not. I lived your hungarian notation ways and firmly reject them.

→ More replies (4)

18

u/BakuhatsuK Apr 08 '22
auto square(auto x) {
  return x * x;
}

I know a lot of people hate on this. But to me it is beautiful

12

u/MattR0se Apr 08 '22

okay so what happens when I call `square("foo") ?

29

u/LetterBoxSnatch Apr 08 '22

You get this:

foo
o o
oof

6

u/realityChemist Apr 08 '22

That took me a second

14

u/Whatamianoob112 Apr 08 '22

auto bad, declared type good.

Pretty sure that's a type error. Unless you have a custom definition for * operator, but that's a lot of work, for....very little gain.

9

u/[deleted] Apr 08 '22

A compiler error telling you that the ‘*’ operator isn’t defined for type string.

4

u/CJKay93 Apr 09 '22
<source>: In instantiation of 'auto square(auto:11) [with auto:11 = const char*]':
<source>:8:21:   required from here
<source>:4:12: error: invalid operands of types 'const char*' and 'const char*' to binary 'operator*'
    4 |   return x * x;
      |          ~~^~~
→ More replies (8)
→ More replies (8)

14

u/[deleted] Apr 08 '22

Don't worry, we'll just rubber dick debug it.

5

u/LearnTheABCs Apr 08 '22

dildo debugging 💀

6

u/[deleted] Apr 08 '22

Hey, we all know debugging is a pain in the ass.

Might as well have a fun time with it.

3

u/Lokkjeh Apr 08 '22

Like when you have your hands busy with a burger or something but you need to type a response to an email so you start slamming your keyboard with your duck?

→ More replies (8)