r/shittyprogramming • • Apr 23 '19

Space efficient & lines up nicely

Post image
521 Upvotes

58 comments sorted by

View all comments

37

u/evan795 Apr 23 '19

I'm quite partial to

function f()
{   //start writing on this line
    //continue on this line
}

0

u/[deleted] Apr 23 '19

[deleted] — view deleted comment

24

u/normaldude8825 Apr 23 '19

Why not:

function f()          {    //start writing on this line
                           //continue on this line
//finish on this line }

20

u/the1krutz Apr 23 '19

function f() { /* stuff inside the function */ }

How's that for vertical space saving, chumps?

0

u/[deleted] Apr 23 '19

[deleted] — view deleted comment

6

u/Lairo1 Apr 23 '19

Dear God why

4

u/Dmium Apr 23 '19

I can't test it right now but I seem to recall you can do this with the use of semicolons

75

u/proto-geo Apr 23 '19

this is unholy

19

u/[deleted] Apr 23 '19

The deadliest sin.

3

u/[deleted] Apr 23 '19 edited Apr 23 '19

That's not verbose enough, I still can't read it. Try this: ^^^/s

function
f
(
    argument1
    ,
    argument2
)
{
    // start your code here
    
    // blank line between each line
}

1

u/[deleted] Apr 23 '19

That makes functions with a large quantity of arguments or verbose arguments more readable imo

Edit: except for having the function keyword and name on different lines you monster

3

u/[deleted] Apr 23 '19

It gets even better in Java (and other languages with stuff like this):

public
static
void
main
(
    string[]
    args
)
{
    
    // do whatever

}

2

u/mlk Apr 24 '19

Are you my highschool pressor?

2

u/[deleted] Jul 26 '19

That's actually horrible

1

u/evan795 Jul 27 '19

It's actually great because you have vertical alignment of braces, and you save a line.