r/ProgrammerAnimemes • • Jan 27 '20

Fantasizing (Koisuru Asteroid)

Post image
1.3k Upvotes

61 comments sorted by

View all comments

Show parent comment

15

u/kodicraft4 Jan 27 '20

feels wrong

You get used to it even though it's hard to sometimes do basic stuff like sending a fuckton of code in a try statement without tabbing for hours

29

u/Nowbob Jan 27 '20

Does your editor not let you highlight multiple rows and hit tab to tab them all at once? Even notepad++ does this

7

u/kodicraft4 Jan 27 '20

Wait that's a thing?

All that time of tabbing manually how did I not know this?!

19

u/nwL_ Jan 27 '20

Better question, are you not using an auto-format-capable IDE?

5

u/kodicraft4 Jan 27 '20

I use pycharm but guess I never read the startup tips close enough lol

1

u/ThePyroEagle λ Feb 18 '20

Ctrl+Alt+L to auto-format in JetBrains' IDEs (including PyCharm).

2

u/John137 Jan 28 '20

alt + shift + arrow keys

4

u/John137 Jan 28 '20 edited Jan 28 '20

i find way too many people writing functions like this

def function(param1, param2, ... param23): 
    ...

when they don't realize they can do this

def function(
    param1,
    param2,
    ...,
    param23):
    ...

edit: reddit messes up format

11

u/bucket3432 Jan 28 '20

If you're writing functions that take in 23 parameters, you're probably doing something wrong.

10

u/SirKalokal Jan 28 '20

add23Integers(a1, a2, a3, ...)

2

u/Dark_Lord9 Feb 10 '20

Wouldn't it be better to store them in an array and just send 1 argument then ?

3

u/SirKalokal Feb 11 '20

I think you have just been woosh'd

2

u/Dark_Lord9 Feb 11 '20

FeelsBadMan

2

u/Corm Jan 31 '20

Yeah but sometimes the names are long, and you have type hints, and default arguments, and now your 4 argument function is 100 characters

1

u/DoubleGremlin181 May 08 '20

You can just select the lines that you need to indent and Tab (or Shift+Tab to remove an indent) to move them all together