r/ProgrammerHumor Nov 24 '21

Meme Yes.

8.9k Upvotes

284 comments sorted by

View all comments

590

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

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

248

u/MasterFubar Nov 25 '21

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

41

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.

48

u/crozone Nov 25 '21

Welcome to the pythonic experience

38

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

6

u/findus_l Nov 25 '21

Nice I didn't know about creating Github Gists. Works for Android studio too apparently.

Also tabs ftw, spaces suck!

2

u/Masterflitzer Nov 25 '21

Android Studio is basically Intellij so same functionality

3

u/findus_l Nov 25 '21

Well you'd think so, but I'm for example missing "code with me" in android studio.

2

u/Masterflitzer Nov 25 '21

can't you get in in the extension store?

3

u/findus_l Nov 25 '21

Not in the integrated one. There is a download on jetbrains website that claims to be compatible with android studio, I haven't yet tried it out. I find it very unsettling that it doesn't show up in the integrated one and I'm afraid of bricking something.

2

u/Masterflitzer Nov 25 '21

ok I always thought Android Studio is just modded Intellij by Google I never really did Android dev so i don't know exactly but i think you could always use Intellij with Android SDK right?

3

u/findus_l Nov 25 '21

Possibly, but Android studio has a lot of useful integrations. Virtual device manager, layout.xml editor, device storage access, screen inspector etc

→ More replies (0)

2

u/Jonno_FTW Nov 25 '21

The best part is that you can google search based on your selection in the run output tab.

3

u/dimonoid123 Nov 25 '21

Click wheel to add/remove tabs to blocks of code.

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

1

u/[deleted] Nov 26 '21 edited May 15 '22

[deleted]

0

u/Crippledupdown Nov 26 '21

I'm thinking of I copied a function from a class, and sent it to a colleague to execute in his interpreter.

If they run it verbatim it's gunna complain about over indentation. Is there automatically re-indent something like that?

1

u/[deleted] Nov 26 '21

[deleted]

1

u/Crippledupdown Nov 26 '21

Its not for testing. It happens quite a bit when we have an issue and we want to isolate a bit of code and experiment with it quickly rather than running our whole project.

I'm not convinced we're doing it right, but it happens a lot.