We use a standard because if someone has autoformatting enabled and replaces a } somewhere in your code it can screw up the whole diff in subversion and makes blaming code very difficult.
|
|
# ? Jul 28, 2011 21:55 |
|
|
# ? Jun 10, 2024 13:23 |
|
Dooey posted:Am I the only one who finds reading code in mixed styles not a big deal? I always use the same style for my own code, but at work we all have different styles and when I read other peoples code I have no problems at all. I actually kind of like it in a way because I can generally tell who on my team has written a particular piece of code.
|
# ? Jul 28, 2011 22:03 |
|
Scaramouche posted:I actually kind of like it in a way because I can generally tell who on my team has written a particular piece of code. this is what blame is for.
|
# ? Jul 28, 2011 23:28 |
|
Profane Obituary! posted:this is what blame is for. Assuming you use version control at all.
|
# ? Jul 29, 2011 00:07 |
|
Yeah, little quirks like that are actually useful. I can usually guess who wrote what because of subtle distinctions in syntax and spacing. Well, those things and the fact that one of the former programmers (who quit years ago) still has heartbeat emails to his long-deleted account in the every-20-minutes cron script, among a lot of other "features" like that. For example, the head guy likes using "$verified = 'good';" (and other strange declarations that are never, ever referenced again), other people like using actual true/false booleans, etc.
|
# ? Jul 29, 2011 00:18 |
|
BigRedDot posted:At my last job the mish-mash of styles and conventions was so terrible that I eventually transcended past the point of ego. I would have adopted any scheme whatsoever, even if I personally hated it, so long as every loving one else did too. This is something Microsoft did a really good job on with C#. They came out of the gate with a style-guide so any bullshit bracing arguments can just be trumped with "follow the MS standard". It (usually) works.
|
# ? Jul 29, 2011 00:30 |
|
Monkeyseesaw posted:This is something Microsoft did a really good job on with C#. They came out of the gate with a style-guide so any bullshit bracing arguments can just be trumped with "follow the MS standard". It (usually) works. Python +pep8 makes this so nice too
|
# ? Jul 29, 2011 02:33 |
|
Golang has a gofmt command that automatically reformats code so you can just run it in a pre-commit hook and never even think about it ever again.
|
# ? Jul 29, 2011 12:44 |
|
Monkeyseesaw posted:This is something Microsoft did a really good job on with C#. They came out of the gate with a style-guide so any bullshit bracing arguments can just be trumped with "follow the MS standard". It (usually) works. Plus you can run FxCop on it
|
# ? Jul 29, 2011 14:55 |
|
leterip posted:Golang has a gofmt command that automatically reformats code so you can just run it in a pre-commit hook and never even think about it ever again. Of course, for you to be "thinking about it" you'd have to find someone else that uses Go in the first place.
|
# ? Jul 29, 2011 19:39 |
|
Zamujasa posted:Yeah, little quirks like that are actually useful. I can usually guess who wrote what because of subtle distinctions in syntax and spacing. Style doesn't matter as long as it's used consistently. Personally, my style preference is to prefer the style of whoever is writing my paycheques. Nobody is going to live or die if an opening brace is on the same line or the next line as an if statement. The function of style is to enable a group of people to easily read the same set of code in minimal time. It doesn't even really matter what the style is. Depending on style idiosyncracies when you can just fire off a p4-blame with the press of a button is like saying cars are stupid because they don't have hooves.
|
# ? Jul 29, 2011 19:51 |
|
Ogive posted:Nobody is going to live or die if an opening brace is on the same line or the next line as an if statement. I don't think you've met many of the programmers I know.
|
# ? Jul 29, 2011 20:02 |
|
If you wrap your lines at 80 characters I literally hate you irl
|
# ? Jul 29, 2011 20:07 |
|
Arguing about coding style is for petty people. More cultured, intelligent people argue about the singleton pattern. (I have had an almost blazing row about this in the past)
|
# ? Jul 29, 2011 20:07 |
|
Ogive posted:Depending on style idiosyncracies when you can just fire off a p4-blame with the press of a button is like saying cars are stupid because they don't have hooves. Again, the only "blame" in this system is the owner of the file, because we don't use version control. And the owner of the file is always the same account, because while we all have different logins ("mainacct_ouracct"), it effectively logs us in as mainacct. It's not that I want to rely on it, it's that I have to. This code has been muffed up by at least 8 different people over its lifespan and the style they use is the only real hint to how things work and what their variables are named like. Hell, even in the most recent stuff it's still similar to "pro_mod_someThingHereThere" and "pro_mod_someThingHere_now", inconsistent all over the place. quote:If you wrap your lines at 80 characters I literally hate you irl
|
# ? Jul 29, 2011 20:14 |
|
Aleksei Vasiliev posted:If you wrap your lines at 80 characters I literally hate you irl I lost marks in first year for not doing this. I guess the professor still marked our code on an 80x25 terminal.
|
# ? Jul 29, 2011 21:10 |
|
Zamujasa posted:Again, the only "blame" in this system is the owner of the file, because we don't use version control. And the owner of the file is always the same account, because while we all have different logins ("mainacct_ouracct"), it effectively logs us in as mainacct. I just have to say, for those that don't use any sort of version control - as long as it doesn't get you fired - please, for the love of god and the sane companies you'll work for in the future, learn and use Mercurial, Git, Subversion, whatever, at least just on your own computer. The only people who don't love version control are those still ignorant of how much of a sanity saver it is, and those that shouldn't be anywhere near source code.
|
# ? Jul 29, 2011 21:11 |
|
Aleksei Vasiliev posted:If you wrap your lines at 80 characters I literally hate you irl pep8 supremacy 79 characters I'm not sure if you're saying that's too few or too many characters to wrap at
|
# ? Jul 29, 2011 21:35 |
|
Good luck punching 80 characters on a card- where the hell do you plan on putting the identification sequence? Most compilers don't even accept more than 72 characters. I suppose next you guys are going to tell me you waste space on multi-character variable names.
|
# ? Jul 29, 2011 22:08 |
|
Lurchington posted:pep8 supremacy 79 characters I'm a more advanced Python programmer than I am a Java programmer, but it seems like it's a lot easier to keep your lines short and readable in Python than it is in Java. Also, PEP8 supremacy!
|
# ? Jul 29, 2011 23:25 |
|
Thermopyle posted:I'm a more advanced Python programmer than I am a Java programmer, but it seems like it's a lot easier to keep your lines short and readable in Python than it is in Java. Yeah, Java is so verbose that there's no point in trying to keep your lines below any arbitrary maximum width. Just use word wrap. Oh, wait!
|
# ? Jul 29, 2011 23:49 |
|
Ran into this earlier. No additional context is needed, the readability speaks for itself :|code:
|
# ? Jul 30, 2011 00:26 |
|
Internet Janitor posted:Good luck punching 80 characters on a card- where the hell do you plan on putting the identification sequence? Most compilers don't even accept more than 72 characters. I suppose next you guys are going to tell me you waste space on multi-character variable names. i, ́, í, î, ï are all perfectly valid variable names and I see them used far too often.
|
# ? Jul 30, 2011 04:50 |
|
Lurchington posted:pep8 supremacy 79 characters Also I mainly program on a 16:10 screen so gently caress using only the far left of it.
|
# ? Jul 30, 2011 07:01 |
|
Do you really only have one file open at a time?
|
# ? Jul 30, 2011 07:39 |
|
Otto Skorzeny posted:Do you really only have one file open at a time? I almost never deal with diffs/merging since I'm only working on my own projects.
|
# ? Jul 30, 2011 08:04 |
|
Aleksei Vasiliev posted:I have multiple files open at any one time in my tabbed IDE. Split that panel! Feel the productivity blasting you to your core
|
# ? Jul 30, 2011 16:25 |
|
79 characters is silly and it seems transparently inspired by emac's stupid behavior of adding the \ and empty line when a newline is in the last column. Which reminds me, controversial opinion alert: TTY simulators suck, fixed-width fonts suck.
|
# ? Jul 30, 2011 16:30 |
|
Mustach posted:fixed-width fonts suck. you're the horror.
|
# ? Jul 30, 2011 16:34 |
|
Mustach posted:fixed-width fonts suck. fixed width fonts are amazing
|
# ? Jul 30, 2011 16:38 |
|
How do you get things to line up nicely with variable-width fonts?
|
# ? Jul 30, 2011 16:45 |
|
Internet Janitor posted:How do you get things to line up nicely with variable-width fonts? Variable-width spaces, obviously
|
# ? Jul 30, 2011 17:10 |
|
Aleksei Vasiliev posted:I have multiple files open at any one time in my tabbed IDE. God I wish I had a real IDE to work with The closest I get is Understand.
|
# ? Jul 30, 2011 17:12 |
|
qntm posted:Variable-width spaces, obviously May we all shed a collective tear for Python and COBOL programmers.
|
# ? Jul 30, 2011 17:15 |
|
I think that monospace fonts are an eyesore. I sometimes think that people stick to them just so they can pretend their code is some kind of WYSIWYG and waste time with valueless formatting like this:code:
code:
Internet Janitor posted:How do you get things to line up nicely with variable-width fonts? code:
|
# ? Jul 30, 2011 17:15 |
|
code:
code:
|
# ? Jul 30, 2011 17:17 |
|
code:
code:
Hammerite fucked around with this message at 17:24 on Jul 30, 2011 |
# ? Jul 30, 2011 17:21 |
|
Thermopyle posted:is much more readable to my eye then this: I mean, this isn't something that I'm really mad about, and I know that plenty of people disagree with me, but today I am feeling convinced that monospace rules the coding world more due to the influence of history than any true benefits. Hammerite posted:unpleasant, unless the grouping of (a and b) and (g and s) is compelling for some reason.
|
# ? Jul 30, 2011 17:21 |
|
Mustach posted:
in a monospaced font because I'm not insane
|
# ? Jul 30, 2011 17:23 |
|
|
# ? Jun 10, 2024 13:23 |
|
code:
Mustach posted:How do you quantify the difference? How do you quantify that red is your favorite color instead of green? It just looks better and easier to read to me.
|
# ? Jul 30, 2011 17:29 |