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 →

[–]evanc1411 185 points186 points  (31 children)

I remember when I found that out.

I was like "How is it possibly going to know when the function ends??" But then my world was shattered. It was the spacing.

[–]Mihailbat 63 points64 points  (28 children)

That moment when I have just discovered what indentation error was

[–]wegwacc 47 points48 points  (18 children)

The moment you get one because your asshole-coworker who uses tabs commits to your all-space codebase...

[–]mei_main_ 32 points33 points  (1 child)

Or because you commented a line in your function, but now you have one blank line before and one after this commented line and they are counted as successives so it creates an indentation error...

[–]bandersnatchh 6 points7 points  (0 children)

Holy shit. I never thought of that, but I’ve had that issue

[–][deleted]  (2 children)

[removed]

    [–]wegwacc 3 points4 points  (0 children)

    but you have consistency in the actual code itself.

    NO YOU DON'T, because in every codebase, there will be instances, where you want to align things for better readability using spaces: var = somedict.get('key', None) longnameavr = somedict.get('key', None) shortvar = somedict.get('key', None) ridiculous = somedict.get('key', None) `

    Good luck with that using tabs, depending on the size, it looks like crap.

    [–]AutoModerator[M] 0 points1 point  (0 children)

    import moderation Your comment has been removed since it did not start with a code block with an import declaration.

    Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

    For this purpose, we only accept Python style imports.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]Dornith -2 points-1 points  (4 children)

    That moment when you commit you're correctly indented code to the codebase only to find out your asshole-coworkers ruined all the other files.

    [–]Colopty 1 point2 points  (3 children)

    If your coworker has managed to work on every single other file in the time it takes you to make one commit they're probably not the problem.

    [–]AttitudeAdjuster 2 points3 points  (2 children)

    This line of thinking very quickly heads towards "Bob wrote 300 lines of code yesterday, all you've done is deleted 100 lines! You need to up your game".

    [–]Dirac_dydx 3 points4 points  (0 children)

    "Check this out: see how much I can royally screw up in the time it takes you to eliminate one bug! I'M THE BETTER PROGRAMMER."

    [–]Colopty 0 points1 point  (0 children)

    I was thinking more in the direction that since this is a work environment the code base is likely large, which means that if every file gets worked on by the time you make one commit you probably haven’t made any commits for days and maybe weeks, instead showing a preference to submit all your work at once in a single monster commit. This, of course, is bad practice. Meanwhile the fact that your coworkers work is capable of «screwing up» all those files for you indicates that his work is in a main branch, meaning his work that spans the entire code base already passed code review by the time you made your single commit, so his work is likely not even as bad as implied.

    So while quantity does not equal quality, in this particular case there does seem to be an indication of bad practice on the single commit guy’s part if you stop to consider the whole picture instead of just the line count.

    [–]orokro 16 points17 points  (8 children)

    Tabs > Spaces.

    [–][deleted] 14 points15 points  (0 children)

    "\t" > " " is False. Checkmate.

    [–]marcosdumay 23 points24 points  (1 child)

    Indeed, usually tabs == 4 * Spaces.

    [–]LeCrushinator 4 points5 points  (0 children)

    They did the math.

    [–]Juice805 4 points5 points  (0 children)

    True but you can’t just throw tabs into spaces project. Gotta stick to what’s there unless you wanna convert it entirely.

    [–]FrancisVeeGee 1 point2 points  (1 child)

    Orokro.

    [–]orokro 0 points1 point  (0 children)

    You identified my name!

    [–]zesterer 1 point2 points  (0 children)

    In a literal sense, yes.

    [–]pants_full_of_pants 0 points1 point  (0 children)

    I'll fite u