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
Kirk
Sep 22, 2003
when I was seventeen
i wrote some bad PHP
i wrote some bad PHP blogging software
on a slackware box
for my own flash toon
comedy website
when I was seventeen

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
When I was only three
My momma said to me
"Don't go hanging with the web devs
Or you're gonna learn PHP"

echinopsis
Apr 13, 2004

by Fluffdaddy
killed by cock block

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

THC posted:

last summer I worked at a C# shop which swears by K&R style. but nobody could figure out how to stop ReSharper autocorrecting to Allman style. So every time I checked in code I had to K&R-ize it first

:confused: i see it in the resharper options, languages > c# > formatting style > braces layout

Bloody
Mar 3, 2013

prefect posted:

:confused: i see it in the resharper options, languages > c# > formatting style > braces layout

keep in mind this is a shop dumb enough to not use allman so they cant exactly be expected to be able to navigate menus

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Bloody posted:

keep in mind this is a shop dumb enough to not use allman so they cant exactly be expected to be able to navigate menus

don't make me cut you :ese:

Shaggar
Apr 26, 2006

Doc Block posted:

And what, pray tell, is the Shaggar-approved brace style?

all man style, hard tabs only (duh)

Shaggar
Apr 26, 2006

Doc Block posted:



real men use the K&R One True Brace Style
code:
int main(int argc, char *argv[])
{
    if(yourmom == laffo) {
        gb2gbs();
    } else {
        yospos_bitch();
    }

    return 0;
}

cool ugly unreadable crap

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Shaggar posted:

cool ugly unreadable crap

when all the braces are on lines by themselves, things get stretched out vertically and my eyes have trouble understanding them

Doc Block
Apr 15, 2003
Fun Shoe
Also, tabs are 4 spaces, saved as hard tabs. 8 spaces is acceptable, depending on the language.

CamH
Apr 11, 2008

everyone just get a bigger monitor if u're complainnig about how much space poo poo is taking up on ur screen



god drat

Squinty Applebottom
Jan 1, 2013

hi cam how is your imac doing?

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

Doc Block posted:

real men use the K&R One True Brace Style
code:
int main(int argc, char *argv[])
{
    if(yourmom == laffo) {
        gb2gbs();
    } else {
        yospos_bitch();
    }

    return 0;
}

this is almost correct, but opening braces never go on their own line

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Tiny Bug Child posted:

this is almost correct, but opening braces never go on their own line

:thumbsup:

Doc Block
Apr 15, 2003
Fun Shoe

Tiny Bug Child posted:

this is almost correct, but opening braces never go on their own line

Maybe if you're writing in a babby p language, but in Real Programming Languages, when writing functions & methods the opening brace goes on its own line.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

GNU Order
Feb 28, 2011

That's a paddlin'

I never had to use braces, perfectteeth crew represent

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

GNU Order posted:

I never had to use braces, perfectteeth crew represent

BRACES EVERYWHERE

nrook
Jun 25, 2009

Just let yourself become a worthless person!

code:
using System.Diagnostics; {
}
This isn't what that means, but it'd be way cooler

tef
May 30, 2004

-> some l-system crap ->
indent plan

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

nrook posted:

code:
using System.Diagnostics; {
}
This isn't what that means, but it'd be way cooler

why, in order to run some external program, do i have to get involved with something in "system.diagnostics"? that seems like the wrong place for "i want to execute something" :argh:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
lol is that a windows thing?

can't be worse than NSTask

nrook
Jun 25, 2009

Just let yourself become a worthless person!

prefect posted:

why, in order to run some external program, do i have to get involved with something in "system.diagnostics"? that seems like the wrong place for "i want to execute something" :argh:

you're diagnosing a hole in the .net framework, obviously

Hellsworn Barn
Apr 11, 2008

hi

Shaggar posted:

well yes if you're a terrible developer that happens, sure. but if you cant properly deal w/ checked exceptions ur a huge idiot.

there is literally no way to "properly deal with checked exceptions." the key to safe exception handling is centralization. every process/app domain/whatever should have a centralized handler responsible for managing control flow based on exception type/data/context. the good part about checked exceptions is that they provide information regarding what exceptions may be thrown, which helps get the logic in your centralized handler right the first time. the bad part about checked exceptions is that it encourages bad exception handling practices by forcing you to deal with exceptions throughout your code. the good is greatly outweighed by the bad since proper design all but eliminates the need for conditional logic based on exception type.

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

Tiny Bug Child posted:

this is almost correct, but opening braces never go on their own line

agreeing with tbc

Hellsworn Barn posted:

there is literally no way to "properly deal with checked exceptions." the key to safe exception handling is centralization. every process/app domain/whatever should have a centralized handler responsible for managing control flow based on exception type/data/context. the good part about checked exceptions is that they provide information regarding what exceptions may be thrown, which helps get the logic in your centralized handler right the first time. the bad part about checked exceptions is that it encourages bad exception handling practices by forcing you to deal with exceptions throughout your code. the good is greatly outweighed by the bad since proper design all but eliminates the need for conditional logic based on exception type.

disagreeing with someone who's disagreeing with shaggar (which is practically the same as agreeing with shaggar)

this day is off to a terrible start!

Shaggar
Apr 26, 2006
forcing you to handle exceptions is always the right choice. if someone eats the exception or handles it lazily then you can point right at their code and tell them their fired.

if you don't force people to handle exceptions then they will just ignore them completely and let them bubble up the stack beyond where they could have been handled. at that point you have to dig through the code and documentation to find where it was thrown and where it should have been handled.

tef
May 30, 2004

-> some l-system crap ->
you're not forced to handle exceptions though, the whole point is that any line can throw one so you don't have to be explicit which one.

checked exceptions are a poor implementation of option types.

tef
May 30, 2004

-> some l-system crap ->
now shaggar has to argue against making error handling explicit and enforced by the compiler, to a level where you can clearly see where errors are returned and how they are handled.

and then make an argument that doing that in a way so broken even microsoft wouldn't touch is better

tef
May 30, 2004

-> some l-system crap ->

tef
May 30, 2004

-> some l-system crap ->
oh I forgot shaggar wants checked exceptions and not option types because he's anti union

FamDav
Mar 29, 2008
Wouldn't you rather either instead of option.

Shaggar
Apr 26, 2006

tef posted:

you're not forced to handle exceptions though, the whole point is that any line can throw one so you don't have to be explicit which one.

checked exceptions are a poor implementation of option types.

nah option types would be an awful, overcomplicated way to do error handling. exceptions are easy to deal w/ and checked exceptions ensure that developers deal with them instead of ignoring them.

tef
May 30, 2004

-> some l-system crap ->
MY NON LOCAL CONTROL FLOW

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

checked exceptions ensure that developers deal with them instead of ignoring them.

i want to believe

tef
May 30, 2004

-> some l-system crap ->
even the java library doesn't make effective use of them

Juul-Whip
Mar 10, 2008

prefect posted:

:confused: i see it in the resharper options, languages > c# > formatting style > braces layout

Yeah, tried that, they had some other plugin that was loving it probably. It was a bad job

Brain Candy
May 18, 2006

tef posted:

even the java library doesn't make effective use of them

You are probably thinking of Java 1.0-ish stuff that is all uniformly awful in every single way. Most of the newer stuff uses unchecked exceptions, but the usage of checked exceptions for environment faults and unchecked for programmer fuckups is p. consistent.

JewKiller 3000
Nov 28, 2006

by Lowtax

tef posted:

oh I forgot shaggar wants checked exceptions and not option types because he's anti union

close thread, a better post than this cannot be made

Hellsworn Barn
Apr 11, 2008

hi

Shaggar posted:

handles it lazily

you know what's really lazy? bad fuckin design

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

JewKiller 3000 posted:

close thread, a better post than this cannot be made

i can't remember who i stole it from either

  • Locked thread