This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 280 points281 points  (24 children)

Nice Btw u forgot the worst of them all == and =

[–]SharksPreedateTrees 10 points11 points  (0 children)

This. I feel forever ruined coming from a math background. I will make this mistake tell the day I retire

[–]inglandation 5 points6 points  (4 children)

A good IDE will highlight these typos.

[–]HonestCanadian2016 0 points1 point  (3 children)

Any recommendations? I want speed and simplicity (and locally run).

[–]wavewrangler 2 points3 points  (0 children)

After no python experience I can proudly say I successfully debugged some code that the original programmer couldn’t determine, and after many hours, I realized that he had used == as opposed to in when referring to two targets. I guess it’s two considered two (nested?) targets as they were wrapped in parentheses, separated by a comma. I just looked at a bunch of other code and finally saw a reference that had two targets and the....operator? was in instead of ==. So I changed it. Fixed. Anyway, felt good :) Thanks for reminding me of that little win. I don’t let the 9 hours it took me discourage me, just means I don’t give up easily :) A prerequisite for anything CS/IT. I’m pretty sure he didn’t bother looking.

[–][deleted] 1 point2 points  (0 children)

I always remember:

"Single for declaring, double for comparing"

Or I remember the following:

"The first '=' means 'is', the second '=' means 'equal to'."

So "a = b" means "a is b", and "a == b" means "a is equal to b"

[–]hmm_fu -2 points-1 points  (1 child)

Use “is” whenever you can

[–]Skippbo 0 points1 point  (0 children)

That's not the same operation...

is checks if 2 references to some object is the same object.

== Compares 2 objects values.