Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
LP0 ON FIRE
Jan 25, 2006

beep boop
i've been getting into the habit of getting rid of curly braces in if/else statements if they are one line

for example:

code:
if(object != nil){

     return YES;

}
becomes:

code:
if(object != nil) return YES;
pretty nifty if you ask me! :keke:

Adbot
ADBOT LOVES YOU

pram
Jun 10, 2001
its not nifty it looks like poo poo

LP0 ON FIRE
Jan 25, 2006

beep boop
it just takes some getting used to

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

it caused the apple ssl bug so never do it

Valeyard
Mar 30, 2012


Grimey Drawer
i wish you would compact your posts

LP0 ON FIRE
Jan 25, 2006

beep boop

carry on then posted:

it caused the apple ssl bug so never do it

huh?

LP0 ON FIRE
Jan 25, 2006

beep boop

Valeyard posted:

i wish you would compact your posts

they are pretty compact IMO

pram
Jun 10, 2001
:coolspot:

Skarp
Sep 27, 2013

never cause it makes code unreadable hngngngngfebgfvvwwerff

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
lol if you dont put your conditionals at the end of one liners. ffs. tier up its lonely here at the top

LP0 ON FIRE
Jan 25, 2006

beep boop

Jonny 290 posted:

lol if you dont put your conditionals at the end of one liners. ffs. tier up its lonely here at the top

show me. i know i'll never be as great as you, but i want to be like you

power botton
Nov 2, 2011

theres entire tiers where you get to hire losers to write code for you instead of having to do it yourself

LP0 ON FIRE
Jan 25, 2006

beep boop

power botton posted:

theres entire tiers where you get to hire losers to write code for you instead of having to do it yourself

whether the coders are losers or not is totally subjective

power botton
Nov 2, 2011

LP0 ON FIRE posted:

whether the coders are losers or not is totally subjective

...

bless your heart

LP0 ON FIRE
Jan 25, 2006

beep boop

power botton posted:

...

bless your heart

seriously though in their world a lot of them are winners with a ton of patience and smarts

Smythe
Oct 12, 2003

LP0 ON FIRE posted:

i've been getting into the habit of getting rid of curly braces in if/else statements if they are one line

for example:

code:
if(object != nil){

     return YES;

}
becomes:

code:
if(object != nil) return YES;
pretty nifty if you ask me! :keke:

no

Smythe
Oct 12, 2003
my 3 favorite things:

white space

white women

white privilege

DimpledChad
May 14, 2002
Rigging elections since '87.
lol if your language doesn't have conditional expressions

code:
(define (not-null object)
        (if (null? object) 'NO 'YES))

DimpledChad fucked around with this message at 20:03 on Apr 16, 2015

Valeyard
Mar 30, 2012


Grimey Drawer

Smythe posted:

my 3 favorite things:

white space

white women

white privilege

LP0 ON FIRE
Jan 25, 2006

beep boop

Smythe posted:

my 3 favorite things:

white space

white women

white privilege

lol

i do use plenty of white space otherwise and my method names are quite descriptive

LP0 ON FIRE
Jan 25, 2006

beep boop
actually for me it's black space because that's how i rock

.lnk to the past
May 3, 2005

psoting while drunk

pram posted:

its not nifty it looks like poo poo

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
!ErrorHasOccured() ??!??! HandleError();

Last Chance
Dec 31, 2004

i think ternary operators are awful and ugly imho

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

pram posted:

its not nifty it looks like poo poo

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
dear op,

if it's a simple guard like
code:
if (butt) return 0;
then sure I always do that. but I never do

code:
if (butt)
    return 0;
or

code:
if (butt)
    return 0;
else
    return 1;
or

code:
if (butt) return 0;
else return 1;
those are bad imo. mostly because I'm used to python's semantic whitespace and ergo more prone to gotofail-style bugs

thanks for reading my programming style opinions

pram
Jun 10, 2001
yeah python is a poo poo language

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

pram posted:

yeah python is a poo poo language

nah, the braces should've been enforced in those langs

like in golang

JewKiller 3000
Nov 28, 2006

by Lowtax

pram posted:

yeah python is a poo poo language

triple sulk
Sep 17, 2014




this is pram when he runs gofmt -w [file] from the command line

LP0 ON FIRE
Jan 25, 2006

beep boop

Symbolic Butt posted:

dear op,

if it's a simple guard like
code:
if (butt) return 0;
then sure I always do that. but I never do

code:
if (butt)
    return 0;
or

code:
if (butt)
    return 0;
else
    return 1;
or

code:
if (butt) return 0;
else return 1;
those are bad imo. mostly because I'm used to python's semantic whitespace and ergo more prone to gotofail-style bugs

thanks for reading my programming style opinions

yeah i do the first one and last one, but i'm not really sure what you have against the last one

Fiskiggy
Feb 15, 2005

You have impressed FFCiv with your turn time!
They turn a blind eye to the turn times of other civilizations, and your Influence over them has increased by 40.

LP0 ON FIRE posted:

yeah i do the first one and last one, but i'm not really sure what you have against the last one

every programmer is an idiot including me and you and will forget to put the braces in when we add another statement.

echinopsis
Apr 13, 2004

by Fluffdaddy

pram posted:

yeah python is a poo poo language

anything that allows people with low levels of comprehension to code is great . thinking privilege

pram
Jun 10, 2001
go is very terse and easy language to learn, understand, and master

obstipator
Nov 8, 2009

by FactsAreUseless
yeah let me just put the condition and effect on the same line because being able to quickly scan through code and logically figure out whats happening is a really bad thing. i want to put all my code on one line so people have to actually parse the code in their head in order to figure out if theres a mistake.

obstipator
Nov 8, 2009

by FactsAreUseless
this is why i sometimes hate coffeescript. L@@K @ this loving garbage:

code:
# Array comprehensions:
cubes = (math.cube num for num in list)
look at how "clean" this loving poo poo is. so loving clean, so loving slick. gently caress you, this is garbage trash code that belongs in a dumpster

pram
Jun 10, 2001
never got the point of coffeescript

obstipator
Nov 8, 2009

by FactsAreUseless
its good because it makes coding things faster, like instead of typing "function", you type "()->", but it sucks balls because loving ruby programmers like to ruby it up with their loving one liners they think are so amazing

Broken Machine
Oct 22, 2010

I don't ever omit the curlies because I'll go back later like an idiot and add something then it doesn't work why doesn't it work what is going on

Adbot
ADBOT LOVES YOU

Breakfast All Day
Oct 21, 2004

I use multiline ternaries op

  • Locked thread