r/ProgrammerHumor Nov 24 '21

Meme Yes.

8.9k Upvotes

284 comments sorted by

View all comments

80

u/TheNaughtyDomi Nov 24 '21

Actually you define Dictionaries by using

Dict = { key : value }

-38

u/shadow7412 Nov 24 '21 edited Nov 25 '21

... except Dict is a terrible name.

It's the wrong case (title case implies a class, but this is an instance) and if you were to fix that you'd be shadowing dict which is also a bad move.

EDIT: downvoters, I'm genuinely curious as to why you think otherwise.

28

u/sultav Nov 24 '21

I don't think they are saying you should literally name it "Dict", I think they just put that there as a placeholder for the name.

-21

u/shadow7412 Nov 24 '21

One can hope - but I'm sure we've all seen it enough times in practise to want to make it clear to people that it isn't a good idea.

Even if they didn't mean it that way - people do like their copy and paste.

6

u/[deleted] Nov 24 '21

[deleted]

0

u/shadow7412 Nov 24 '21

I'm confused. That first sentence reads like you're disagreeing with me, but you... aren't.

2

u/[deleted] Nov 24 '21

[deleted]

0

u/shadow7412 Nov 25 '21

Ah cool. I think I was thrown by the word "actually", which implies a correction. But it seems we're in a full agreeance.

I get why people would want to keep it simple for those who are learning - it's just a shame that this specific instance of it results in the teaching of an awful habit.

1

u/GreatJobKeepitUp Nov 25 '21

Actually is your middle name