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.
 
  • Post
  • Reply
shrughes
Oct 11, 2008

(call/cc call/cc)
I use

code:
if (x and y)
  <%
    return x;
  %>
It's nice because the indentation lines up with the tips of the braces.

Adbot
ADBOT LOVES YOU

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

Otto Skorzeny posted:

I never got annoyed until I had to finish a product's firmware that had been done in Whitesmith's style. Couldn't tell what lined up with what for the life of me. Had the same problem last time I hosed around with Common Lisp - the parens were fine (my editor did some rainbow thing with em, which was surprising), the indentation just threw me for a loop.

Say what you want about indentation style, I think we can all agree Whitesmith is wrong :colbert:

evensevenone
May 12, 2001
Glass is a solid.
But not as wrong as GNU.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Eastern Polish Christmas Tree Notation: http://www.kuro5hin.org/story/2004/6/1/43942/41236

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
The Something Awful Forums > Discussion > Serious Hardware / Software Crap > The Cavern of COBOL > Coding horrors: post the indentation style that makes you laugh (or cry)

Dicky B
Mar 23, 2004

I knew full well what would happen if I so much as mentioned coding styles in this thread, but I did it anyway :munch:

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Bunny Cuddlin posted:

Are you people loving serious

This has to happen every few months. Extremist pedantry comes with the job.

1337JiveTurkey
Feb 17, 2005

Munkeymon posted:

This has to happen every few months. Extremist pedantry comes with the job.

Extremist pedantry is the job considering how literal computers are and how many bugs boil down to sloppy thinking about the problem.

MononcQc
May 29, 2007

none of this would happen if y'all wouldn't be using languages with C-derived syntaxes.

coaxmetal
Oct 21, 2010

I flamed me own dad

MononcQc posted:

none of this would happen if y'all wouldn't be using languages with C-derived syntaxes.

right, with python that argument is gone, which leaves room for the more important tabs vs spaces and 4 space vs 8 space indent (spaces, 4, btw)

QuarkJets
Sep 8, 2008

Pilsner posted:

Can we at least agree that people who indent with spaces instead of tabs are objectively wrong? It fucks up diff'ing.

We can agree that all tabs should be expanded to N spaces in your editor of choice so that people who use tabs and spaces get the same code

Kilson
Jan 16, 2003

I EAT LITTLE CHILDREN FOR BREAKFAST !!11!!1!!!!111!
No agreement can be made about abominable practices. :mad:

Zombywuf
Mar 29, 2008

Ronald Raiden posted:

right, with python that argument is gone, which leaves room for the more important tabs vs spaces and 4 space vs 8 space indent (spaces, 4, btw)

And every single thing listed in PEP-8. Wherein Python discovered that indentation is not the only whitespace issue.

coaxmetal
Oct 21, 2010

I flamed me own dad
there are always more code formatting practices to argue about.

Dren
Jan 5, 2001

Pillbug

Ronald Raiden posted:

there are always more code formatting practices to argue about.

just as there are always more assholes to gaze into

Che Delilas
Nov 23, 2009
FREE TIBET WEED
Is this where I ask about "EmployeeID" vs. "EmployeeId" vs. "Employee_ID" vs. Employee_Id" vs. "Employee_id" ?
:buddy:

RoadCrewWorker
Nov 19, 2007

camels aren't so great
Obviously uint32_ei

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Che Delilas posted:

Is this where I ask about "EmployeeID" vs. "EmployeeId" vs. "Employee_ID" vs. Employee_Id" vs. "Employee_id" ?
:buddy:

employeeID and I dare anyone to tell me otherwise :colbert:

JawnV6
Jul 4, 2004

So hot ...
i'm tracking milliliters in my camelCase code, should it be targetML, targetmL, targetMl, or targetml???

1337JiveTurkey
Feb 17, 2005

Embedded NBSP characters. Why have them as valid characters in the source code if they're not useful. :colbert:

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Volmarias posted:

employeeID and I dare anyone to tell me otherwise :colbert:

code:
el = getElementByID('ohNoes');
Why isn't my JavaScript working?

ToxicFrog
Apr 26, 2008


Terrible coding/indentation styles don't bother me nearly as much as inconsistent ones.

Last week I took I project I maintain that had over the years accumulated a mix of files with 2, 3, 4, and 8 column indents using spaces, tabs, or both, and automatically reformatted it all to a consistent style.

Sent the reviewers a 150K diff consisting entirely of whitespace changes. :getin:

RoadCrewWorker
Nov 19, 2007

camels aren't so great
Obviously the solution is to only exchange tokenized grammar tree files that can be rendered into readable text instantly with whatever display style you choose.

That idea is probably dumb enough that it has already been tried and failed spectacularly.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

JawnV6 posted:

i'm tracking milliliters in my camelCase code, should it be targetML, targetmL, targetMl, or targetml???

targetMillis

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

RoadCrewWorker posted:

Obviously the solution is to only exchange tokenized grammar tree files that can be rendered into readable text instantly with whatever display style you choose.

That idea is probably dumb enough that it has already been tried and failed spectacularly.

QuakeScript

TheRagamuffin
Aug 31, 2008

In Paradox Space, when you cross the line, your nuts are mine.

Volmarias posted:

employeeID and I dare anyone to tell me otherwise :colbert:

But would this be the same if it were a class? A member? A function?

Strong Sauce
Jul 2, 2003

You know I am not really your father.





ToxicFrog posted:

Terrible coding/indentation styles don't bother me nearly as much as inconsistent ones.

Last week I took I project I maintain that had over the years accumulated a mix of files with 2, 3, 4, and 8 column indents using spaces, tabs, or both, and automatically reformatted it all to a consistent style.

Sent the reviewers a 150K diff consisting entirely of whitespace changes. :getin:

git diff -w :colbert:

QuarkJets
Sep 8, 2008

Kilson posted:

No agreement can be made about abominable practices. :mad:

The abominable practice being the use of tabs in code, since it really can gently caress up any language that uses white space; expanding tabs into whitespace is good, of course

ToxicFrog
Apr 26, 2008



Well, yeah, but then the diff is empty and there's nothing for them to review :v:

kitten smoothie
Dec 29, 2001

Che Delilas posted:

Is this where I ask about "EmployeeID" vs. "EmployeeId" vs. "Employee_ID" vs. Employee_Id" vs. "Employee_id" ?
:buddy:

pfft, everyone who's had to touch PeopleSoft knows it's EMPLID

raminasi
Jan 25, 2005

a last drink with no ice
My favorite response to the whitespace wars is F#, which forbids any tab characters in its source files.

darthbob88
Oct 13, 2011

YOSPOS

RoadCrewWorker posted:

Obviously the solution is to only exchange tokenized grammar tree files that can be rendered into readable text instantly with whatever display style you choose.

That idea is probably dumb enough that it has already been tried and failed spectacularly.
Not quite that bad, but I did find somebody asking for CSS for source code. I think it's a nice idea, but doomed to failure. What brace style would you write the code in?

O Tempora! O Mores!
Dec 24, 2008

Lumpy posted:

code:
el = getElementByID('ohNoes');
Why isn't my JavaScript working?

I don't know but maybe you can help me with mine????

code:
var xhr = new XmlHttpRequest();

Opinion Haver
Apr 9, 2007

That reminds me:

code:
svg {
    vector-effect: non-scaling-stroke;
    shape-rendering: optimizeSpeed;
}
And then for attributes it's camelCaseNames, because extra gently caress you.

coaxmetal
Oct 21, 2010

I flamed me own dad

kitten smoothie posted:

pfft, everyone who's had to touch PeopleSoft knows it's EMPLID

oh man I did that. Peoplesoft sucks.

Tad Naff
Jul 8, 2004

I told you you'd be sorry buying an emoticon, but no, you were hung over. Well look at you now. It's not catching on at all!
:backtowork:

Ronald Raiden posted:

oh man I did that. Peoplesoft sucks.

You came back from Peoplesoft? I'd heard rumors before, but no one that I have met has actually claimed to have done so. I thought it was a black hole from which no IT personnel could escape.

Rottbott
Jul 27, 2006
DMC

RoadCrewWorker posted:

Obviously the solution is to only exchange tokenized grammar tree files that can be rendered into readable text instantly with whatever display style you choose.

That idea is probably dumb enough that it has already been tried and failed spectacularly.
I've always wished for this. I don't understand why it isn't a thing, it seems obvious to let everyone view the files however they prefer, and avoid whitespace changes polluting the version control logs.

The simplest way would be to store everything in normal files with a fixed whitespace style, and use version control hooks to adjust it depending on the user's preference whenever it's checked in or out.

raminasi
Jan 25, 2005

a last drink with no ice

Rottbott posted:

I've always wished for this. I don't understand why it isn't a thing, it seems obvious to let everyone view the files however they prefer, and avoid whitespace changes polluting the version control logs.

It seems "obvious" to store your source code in a binary format that needs its own, special editor (or at the very least editor plugin) and source control toolchain?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
The obvious way is to have a mandatory, tool-enforced coding style, and anyone who wants to use something different can write their own tool to convert back and forth on checkout and checkin.

In fact you could do this now if you want, and it wouldn't require any of your coworkers to do anything different if there already is a consistent coding style being enforced in your source control.

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->
the obvious way is to basically kill anyone who has an opinion on "brace/formatting", because it's basically programmers arguing over their favourite colour.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply