r/shittyprogramming • • Mar 10 '18

Our uni teaches indentation properly

Post image
245 Upvotes

20 comments sorted by

40

u/playr_4 Mar 10 '18

I think the thing that's killing me the most is actually that the comments aren't at the same indent.

23

u/jarfil Mar 10 '18 edited Dec 02 '23

CENSORED

2

u/RTracer Mar 11 '18

I just.. wow.

15

u/w3woody Mar 10 '18 edited Mar 11 '18

Here, let me give the formatting a go.

  b = 0
; e = 0
; max = 0                  // pierwsze przyblizenie
; for ( i = 0 
;       i < n
;       i++ )              // poczatek podtablicy
{   sum = 0
;   for ( j = i
;         j < n
;         j++ )            // koniec podtablicy
{     sum = sum + a[j]
;     if (sum > max) 
{       max = sum
;       b = i
;       e = j
;}}}

10

u/blahbah Mar 10 '18

This makes me so mad i'll probably die a few months sooner because of it.

18

u/[deleted] Mar 10 '18

just put everything in one line

6

u/[deleted] Mar 10 '18

Typowo

9

u/msartore8 Mar 10 '18

So important

4

u/GonziHere Mar 10 '18

my eyes hurt

1

u/supergnawer Mar 10 '18

There's a whole bunch of space inconsistencies in there.

1

u/[deleted] May 05 '18

And here is Why you indent with tabs

-12

u/Negatratoron Mar 10 '18

never use indentation, especially in tight loops

10

u/w3woody Mar 10 '18

Absolutely. The indentation makes the loops unbalanced, and can in severe cases cause the server to wobble.

4

u/hexane360 Mar 11 '18

Did this sub collectively forget what it's supposed to be about?

0

u/[deleted] Mar 11 '18

[deleted]

2

u/hexane360 Mar 11 '18

The difference is your comment was either serious or just horribly horribly unfunny. People took pity on you and assumed the former, and proceeded to have a serious discussion. Also you have no idea what a brigade is.

0

u/[deleted] Mar 10 '18

[deleted]

17

u/walterbanana Mar 10 '18

You can configure tab width in your editor, though. With spaces you are stuck the whatever amount of spaces were used.

0

u/[deleted] Mar 10 '18

[deleted]

0

u/[deleted] Mar 10 '18

[deleted]

0

u/[deleted] Mar 10 '18

[deleted]

2

u/papa420 Mar 10 '18 edited Jan 23 '24

absurd quarrelsome degree outgoing violet chase silky north husky wipe

This post was mass deleted and anonymized with Redact

0

u/[deleted] Mar 10 '18

[deleted]

3

u/[deleted] Mar 10 '18

Autoformatter Wars!