function {}

45 points · 13 comments · view on lemmy.world

13 Comments

Grishaix@feddit.de · 14 pts · 3y (3 replies)
function {
}

Is for cheaters who want to squeeze as much code as possible onto one screen.

zygo_histo_morpheus@programming.dev · 1 pts · 3y (2 replies)

only good thing about javascript is that it forces people to put the squiggly brackets on the right

bcrussin_dev@programming.dev · 2 pts · 3y (1 reply)

I thought you could put curly brackets on a new line in js? Although I know when returning an object it has to be on the same line… fuck JavaScript man

zygo_histo_morpheus@programming.dev · 1 pts · 3y

Exactly, your options are either mixing curly brackets or putting them all on the right and most people aren't crazy enough to mix then

Bjoern_Tantau@feddit.de · 7 pts · 3y (4 replies)
function {
}

but

method
{
}

Don't ask me why.

sguerrini97@feddit.it · 7 pts · 3y (3 replies)

Why

msage@programming.dev · 2 pts · 3y (2 replies)

You don't ask!

silas@programming.dev · 1 pts · 3y (1 reply)

Why

msage@programming.dev · 1 pts · 3y

Damn it Carl!

Trebach@kbin.social · 3 pts · 3y
function()
{
    // code
}

forever because you never know how long the parameter list is going to be.

snake_case@feddit.uk · 2 pts · 3y

This image is cursed!!

CoderKat@kbin.social · 2 pts · 3y

I'm sorry, are you saying you indent the braces? Cause if that's not unintentional, those are both horrifying!