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
TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Munkeymon posted:

I had one of those online test technical screening things one time where the inevitable "where's the bug in this code" questions came up and the code 1) wasn't highlighted 2) wasn't fixed-width and 3) was a nested loop featuring i and j as indexes. When I went to highlight it to paste into an editor, I found it was in an image as well. "Fuuuuuck yooooouuuuuu" is what's wrong with this code but that wasn't an option for some reason?!

Someday soon OCR will be as ubiquitous and powerful as, uh, the current state of our language translation software, and poo poo like this won't fly any more.

And all the blind/illiterate people will be so much happier.

Adbot
ADBOT LOVES YOU

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I used to debug code in a production system whose terminal had a 78 character limit. Let me tell you, it's not always more readable to split lines cleanly at 78 characters and add proper indenting on every split line. When you do that, you take up a *lot* more vertical screen space. When have a hard 78 character limit you'll also have a 40 character height, and that vertical screen estate matters a lot. I found it easier, sometimes, to read wrapped lines, even if they mess up the indentation.

That's the problem with dogmatic 80-chars-or-die programmers. I've found that they've never actually worked in an environment where that limit matters, so they don't know what tradeoffs they're asking for.

feedmegin
Jul 30, 2008

Arachnamus posted:

I wish this was restricted to Go. Fuckin' vim xterm assholes. Buy a mouse.

It gets better. Proper old-school System V vi will flat out refuse to run and just say 'Too wide' if your terminal has more than 80 columns.

idiotmeat
Apr 3, 2010

lifg posted:

I used to debug code in a production system whose terminal had a 78 character limit. Let me tell you, it's not always more readable to split lines cleanly at 78 characters and add proper indenting on every split line. When you do that, you take up a *lot* more vertical screen space. When have a hard 78 character limit you'll also have a 40 character height, and that vertical screen estate matters a lot. I found it easier, sometimes, to read wrapped lines, even if they mess up the indentation.

That's the problem with dogmatic 80-chars-or-die programmers. I've found that they've never actually worked in an environment where that limit matters, so they don't know what tradeoffs they're asking for.

I work with parts that have a 72 char constraint. In general, I see nice clean indentation and a good use of space, but due to "more experienced" developers wanting to change minimal code I sometimes see 50 spaces before half a line of code and the beginning part of a block comment. :suicide:

QuarkJets
Sep 8, 2008

Jabor posted:

I use a proportional font for coding so talking about line length as a given number of characters always feels a bit silly.

I still stick to 100 because that's what the company style guide says, having consistency is useful even if some of the rules are individually suboptimal.

I too do all of my coding in Microsoft Word

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
What's wrong with using a proportional font? That it doesn't fit with archaic traditions handed down from a time of punch cards and fixed-width terminals?

I used a fixed-width for the the longest time. I put in a lot of effort finding the "most readable" fixed-width font to use (ended up settling on Consolas). Then I switched to a proportional font literally as a joke one April 1st, and then thought "holy hell, why aren't I doing this all the time?". Proportional fonts are ridiculously easier to read, hence why they're used for literally everything that doesn't have antiquated traditions stopping people from using them.

The only thing I miss is ascii-art diagrams in comments.

Eela6
May 25, 2007
Shredded Hen

Jabor posted:

What's wrong with using a proportional font? That it doesn't fit with archaic traditions handed down from a time of punch cards and fixed-width terminals?
Nothing but if you use a fixed-width font in green on black you feel like a sweet hacker.

B-Nasty
May 25, 2005

Jabor posted:

Then I switched to a proportional font literally as a joke one April 1st, and then thought "holy hell, why aren't I doing this all the time?". Proportional fonts are ridiculously easier to read, hence why they're used for literally everything that doesn't have antiquated traditions stopping people from using them.

What font are you using?

Maybe I'll try a switch so that I feel like I'm reading a fine, airport page-turner instead of some lovely, over-engineered, 800 line class written by a consultant.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I started with Verdana, but nowadays I'm using the Go font. (Stay away from the fixed-width version though, it's imo pretty bad)

Bongo Bill
Jan 17, 2012

Some languages have indentation idioms that might break under a proportional font, but in general it's fine.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Even if your language doesn't have semantic whitespace, it can be helpful to be able to horizontally-align related elements e.g. in function parameters, maps, documentation, etc.

B-Nasty
May 25, 2005

TooMuchAbstraction posted:

Even if your language doesn't have semantic whitespace, it can be helpful to be able to horizontally-align related elements e.g. in function parameters, maps, documentation, etc.

I'm the guy that does a Ctrl-A, Ctrl-K Ctrl-F in Visual Studio to auto-format your artisanal, hand-crafted whitespace to the language defaults.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

B-Nasty posted:

I'm the guy that does a Ctrl-A, Ctrl-K Ctrl-F in Visual Studio to auto-format your artisanal, hand-crafted whitespace to the language defaults.

I bet those are some great commits.

Pollyanna
Mar 5, 2005

Milk's on them.


Thermopyle posted:

I bet those are some great commits.

Pretty sure you can ignore whitespace on any service like Github or Bitbucket.

vOv
Feb 8, 2014

TooMuchAbstraction posted:

Even if your language doesn't have semantic whitespace, it can be helpful to be able to horizontally-align related elements e.g. in function parameters, maps, documentation, etc.

Yeah, with a proportional-width font it's way harder to do something like

code:
someLongFunctionName(someLongArgument,
                     someOtherLongArgument,
                     yetAnotherLongArgument);
Even if you take the time to do it manually, it's not going to work for other people and there's no way to do it programmatically without making your code formatter know the fonts you use which is terrible.

I also sort of feel like saying 'natural language doesn't use fixed-widths fonts so code shouldn't use it' is like saying 'natural language isn't syntax-highlighted so code shouldn't be either'. Natural-language documents can be typeset using things like Word or HTML or LaTeX that give you lots of control over how things are laid out. Code's just text.

vOv fucked around with this message at 04:19 on Jun 2, 2017

Bongo Bill
Jan 17, 2012

'Course, in cases like that, I prefer to do something like

code:
someLongFunctionName(
    someLongArgument,
    someOtherLongArgument,
    yetAnotherLongArgument);
but that's not the done thing in some style guides.

Jaded Burnout
Jul 10, 2004


Jabor posted:

What's wrong with using a proportional font? That it doesn't fit with archaic traditions handed down from a time of punch cards and fixed-width terminals?

As evidenced just now I'm all for throwing away archaic traditions if they don't still make sense, but there's still good reasons to go with fixed width.

Alignment is one of them; though it's not going to make that much difference in most alignment circumstances, a font like that will typically have a narrower space character so your indent is going to be smaller than that of your colleagues even if you stick to the same standards, likely making it less scannable. A proportional font will also de-emphasise any narrow character by squeezing them between other characters, and narrow characters tend to be punctuation which while a literal afterthought in prose is pretty important in code.

Up to you though, of course.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Pollyanna posted:

Pretty sure you can ignore whitespace on any service like Github or Bitbucket.

Yes, you can.

itskage
Aug 26, 2003


Thermopyle posted:

Yes, you can.

You add a query string to the url in a github pull request to do it. ?w=1 (Actually don't think it has to be 1, just truthy). But is this even possible through the UI? I don't know if it is, and I don't think it's an advertised feature? if not, why not?

evensevenone
May 12, 2001
Glass is a solid.
found this today in some tooling
code:
script -c "git push foobar" /dev/null
script? what's script?

pre:
DESCRIPTION
     The script utility makes a typescript of everything printed on your terminal.  It is useful for students who need
     a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out
     later with lpr(1).
so uh .. record the output of git push, and then throw it away? why?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

vOv posted:

Yeah, with a proportional-width font it's way harder to do something like

code:
someLongFunctionName(someLongArgument,
                     someOtherLongArgument,
                     yetAnotherLongArgument);

This is an awful awful programming style that should never be used even in fixed-width-font-land, so there's no real loss there.

Arachnamus posted:

Alignment is one of them; though it's not going to make that much difference in most alignment circumstances, a font like that will typically have a narrower space character so your indent is going to be smaller than that of your colleagues even if you stick to the same standards, likely making it less scannable. A proportional font will also de-emphasise any narrow character by squeezing them between other characters, and narrow characters tend to be punctuation which while a literal afterthought in prose is pretty important in code.

You need to pick the right font for sure. Like, obviously not Jokerman or Papyrus (Comic Sans turns out to be surprisingly readable, actually), but stuff like "how does punctuation look" is also something you need to consider. I'd disagree that punctuation is an afterthought in prose though - in my experience, prose with missing or rearranged letters is much more readable than prose without punctuation! I personally haven't had any issues with symbol legibility.

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider

vOv posted:

Yeah, with a proportional-width font it's way harder to do something like

code:
someLongFunctionName(someLongArgument,
                     someOtherLongArgument,
                     yetAnotherLongArgument);
Even if you take the time to do it manually, it's not going to work for other people and there's no way to do it programmatically without making your code formatter know the fonts you use which is terrible.

I also sort of feel like saying 'natural language doesn't use fixed-widths fonts so code shouldn't use it' is like saying 'natural language isn't syntax-highlighted so code shouldn't be either'. Natural-language documents can be typeset using things like Word or HTML or LaTeX that give you lots of control over how things are laid out. Code's just text.

The main problem here is that proportional width fonts expose the hypocrisy and web of lies that team spaces has been peddling for all these years. Don't let them destroy you with their lies!! First it's, "spaces look the same everywhere" and then it's "well yeah, of course fonts cause problems!" and then "why wouldn't you have to eat babies?". WAKE UP SHEEPLE!

e: #TeamEBCDIC! Yeah, I know, gently caress it.

RandomBlue fucked around with this message at 06:18 on Jun 2, 2017

sarehu
Apr 20, 2007

(call/cc call/cc)
Editors could treat multiple spaces appropriately to line up function arguments if they wanted to.

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider

sarehu posted:

Editors could treat multiple spaces appropriately to line up function arguments if they wanted to.

Same with tabs but without infanticide, or worse, font fuckery, or worse, my posts.

nielsm
Jun 1, 2009



sarehu posted:

Editors could treat multiple spaces appropriately to line up function arguments if they wanted to.

LaTeX package Listings has some really neat whitespace handling even with proportional fonts. It makes for some very pretty printed code. I want an editor doing the same things.

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider

vOv posted:

Yeah, with a proportional-width font it's way harder to do something like

code:

someLongFunctionName(someLongArgument,
                     someOtherLongArgument,
                     yetAnotherLongArgument);

Even if you take the time to do it manually, it's not going to work for other people and there's no way to do it programmatically without making your code formatter know the fonts you use which is terrible.

I also sort of feel like saying 'natural language doesn't use fixed-widths fonts so code shouldn't use it' is like saying 'natural language isn't syntax-highlighted so code shouldn't be either'. Natural-language documents can be typeset using things like Word or HTML or LaTeX that give you lots of control over how things are laid out. Code's just text.

When the last survivors finally pulled themselves out of the rubble and watched the smoke clear, revealing the wasteland of destruction that was once their homes, not one of them recognized that fateful moment.

Even vOv never dared to hope for even a fraction of his success. ... next time ... kerning ...

Jaded Burnout
Jul 10, 2004


While I'm sure it can be done right I'm going to discourage the proliferation of variable-width fonts if only because I have enough trouble switching between eight different editors and terminal prompts when pairing with a colleague without also having to squint at the latest part-serif display font Jerry from Data Platform downloaded from fonts.google.com this week.

Jaded Burnout fucked around with this message at 08:15 on Jun 2, 2017

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider

Arachnamus posted:

While I'm sure it can be done right I'm going to discourage the proliferation of variable-width fonts if only because I have enough trouble switching between eight different editors and terminal prompts when pairing with a colleague without also having to squint at the latest part-serif display font Jerry from Data Platform downloaded from fonts.google.com this week.

If there aren't thousands of other coding, design, implementation, platform or tooling concerns that would have an impact orders of magnitude beyond fonts then you must be working in the Olympus of dev teams and I envy you.

You guys have openings?

Jaded Burnout
Jul 10, 2004


When I see a 6 foot pile of poo poo my first instinct isn't to take a dump on the top.

Doom Mathematic
Sep 2, 2008

Bongo Bill posted:

'Course, in cases like that, I prefer to do something like

code:
someLongFunctionName(
    someLongArgument,
    someOtherLongArgument,
    yetAnotherLongArgument
);

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

evensevenone posted:

found this today in some tooling
code:
script -c "git push foobar" /dev/null
script? what's script?

pre:
DESCRIPTION
     The script utility makes a typescript of everything printed on your terminal.  It is useful for students who need
     a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out
     later with lpr(1).
so uh .. record the output of git push, and then throw it away? why?

I think it runs the command in a new pseudo-terminal, and I think git may produce different output based on if it has a terminal. Could be this tooling is run without a terminal and at some point git complained, or it previously just redirected /dev/null and git complained about that.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Doom Mathematic posted:

Bongo Bill posted:

'Course, in cases like that, I prefer to do something like

code:
someLongFunctionName (someLongArgument
                     ,someOtherLongArgument
                     ,yetAnotherLongArgument
                     );
but that's not the done thing in some style guides.

Jaded Burnout
Jul 10, 2004


You're all wrong (depending on language features), as the correct answer is

code:
someLongFunctionName(
  someLongArgument,
  someOtherLongArgument,
  yetAnotherLongArgument,
);
With named parameters for arguments with literal values at least, please.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Munkeymon posted:

.Net sprang fully formed int being at version 3.5 (for no particular reas, uh, I mean, because that's a cool and good number is why) and I'll hear no more of this silliness about pre-generic data structures!
I wish I lived in your world. :smith:

Pollyanna
Mar 5, 2005

Milk's on them.


Currently dealing with a front-end developer who is literally writing Javascript as if it were Java, inline @docs and all. I can tolerate that stuff, but the solution is also overly complicated and over-engineered, and the other developers (who aren't really Javascript or Java wizards) are flabbergasted. The engineer in question seems extremely picky and defensive about the way they wrote code, and it seems like they're actually a Java engineer who is just now getting into Javascript - which explains their style.

Weird.

5TonsOfFlax
Aug 31, 2001

Pollyanna posted:

... a Java engineer who is just now getting into Javascript - which explains their style.

Weird.

Maybe weird, but I'd rather work with that guy than the usual shiny-framework-of-the-week chasing JS dev. Probably because I was that guy 10 years ago.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

5TonsOfFlax posted:

Maybe weird, but I'd rather work with that guy than the usual shiny-framework-of-the-week chasing JS dev. Probably because I was that guy 10 years ago.

Ehh, they're equally bad.

Write code according to the idioms of your language and your team.

Thermopyle fucked around with this message at 17:33 on Jun 2, 2017

Vanadium
Jan 8, 2005

I usually code in vim and like 80 column limits with the rationalization that then I can fit more terminals with vim in them on the screen at the same time.

I have a GUI editor set up somewhere with EVE Sans Neue as my proportional font, but I basically never use it. :(

Pixelboy
Sep 13, 2005

Now, I know what you're thinking...
I have a 34" 21:9 monitor. There are no such things as line lengths in my reality.

Adbot
ADBOT LOVES YOU

itskage
Aug 26, 2003


Pixelboy posted:

I have a 34" 21:9 monitor. There are no such things as line lengths in my reality.

I have this at home and keeping to reasonable line lengths means I can go 3 up easy.

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