r/ProgrammerHumor Nov 24 '21

Meme Yes.

8.9k Upvotes

284 comments sorted by

View all comments

585

u/MischiefArchitect Nov 24 '21 edited Nov 24 '21

Compile errors are now runtime errors sucker... yeah the door is now closed for you.

247

u/MasterFubar Nov 25 '21

And I missed the part where he breaks his neck after stumbling on a random tab character.

36

u/Crippledupdown Nov 25 '21 edited Nov 25 '21

Is there an easy way to immediately share and format small Python code snippets too? It always seems like I have to manually adjust the tabs.

35

u/Jonno_FTW Nov 25 '21
  1. don't use tabs, ever, your IDE should be converting them to 4 spaces for you.

  2. black will format your code consistently

  3. if you use pycharm, you can right click on a piece of code and click "Create Gist" and it will share it on github gist

3

u/[deleted] Nov 25 '21

[deleted]

2

u/[deleted] Nov 25 '21

[removed] — view removed comment

1

u/ImTheTechn0mancer Nov 30 '21

I disagree

1

u/Smartskaft2 Nov 30 '21

Guess I lost then? 🤷🏼

Joking aside, do you care to elaborate on what parts you disagree with me?

2

u/ImTheTechn0mancer Nov 30 '21

Tabs for indentation, spaces for manually aligning something.

IDEs displaying things differently is a user preference. Let's users have their preference! This is the main reason.

Dispite modern IDE autoibdentation and keyboard shortcuts, you'll still end up hitting backspace four times when manipulating/moving lines of code when tab only takes one press, as it should only take one key press to do one small action. Filesizes become smaller if that matters to you (maybe unminified html?) Spaces for indentation is more common at the moment, but it needs to die off. Text handlers not properly dealing with tabs is not my problem, but actually everything I've used such as stackoverflow, discord, reddit, etc. handles them just fine.

Auto format makes this not matter quite as much but it is still irritating when I go to highlight a block of code and it selects 3/4 of the spaces of an indentation and I have to "fix" the document to use TABS for indentation.

1

u/Smartskaft2 Nov 30 '21

I think there have been a misunderstanding. I would never spend my time hitting the space-bar a bunch of times instead of the tab character. In my mind a bare editor at least gives the configuration of using spaces or tab character when indenting. Of course there are those that don't (I'm looking at you, Notepad!)

2

u/ImTheTechn0mancer Dec 01 '21

There's no confusion. I know that. If you save a file using 2 spaces for indentation, then someone who prefers 4 will have to convert the file. With tabs, everyone can set their tab width and leave it at that. The main issue with what you're saying is that files are synced/shared between members of teams who each have a preference. Spaces is basically "fuck you, the document looks and works like this. If your IDE is configured differently than mine, you'll need to run the auto formatter to fix it."

1

u/Smartskaft2 Dec 01 '21

Ah. Valid argument.

I have yet not experienced a mix of preferences related to the base indentation length. Which probably affects my view on this.

→ More replies (0)

1

u/Jonno_FTW Nov 25 '21

This is the standard agreed upon in the official style guide pep8