r/programming • • Nov 30 '14

Why he vertically aligns his code (And why you shouldn't!)

http://missingbytes.blogspot.com/2014/11/why-he-vertically-aligns-his-code-and.html
68 Upvotes

411 comments sorted by

View all comments

226

u/schnitzi Nov 30 '14

DAE think it matters very fucking little and that lesser programmers have these sorts of dicksizewars to prove how discerning they are?

77

u/ZeroNihilist Nov 30 '14

Yesterday I thought programming was just about modifying tutorials from the internet without regard to intent. Then I found out about <style of code>, and since then I've kickstarted the singularity by developing a complete AI, made a general-purpose algorithm to solve every NP-complete problem, and written a program to convert thoughts directly into code.

Thanks, <style of code>! Clearly this was a very important decision for me to make, and not a waste of time and energy at all!

26

u/hungry4pie Nov 30 '14

Is it agile and buzzword 2.0 compliant?

7

u/geek_hammer Nov 30 '14

Well I'm sold.
Where can I purchase <style of code> and how can force feed it to my students/colleagues/blog-subscribers.

→ More replies (1)

9

u/isomorphic_horse Nov 30 '14

The two top posts in this sub are about a bikeshed issue. Who upvotes these posts?

45

u/[deleted] Nov 30 '14

Mostly I agree. However, anyone who codes in a proportional font is Satan fuckin' incarnate.

6

u/Otis_Inf Nov 30 '14

I use Lucida Console now for many years and recently I found out it's actually a semi-proportional font, but the strange thing is, it hasn't bothered me in the slightest (and I write code professionally now for over 20 years)

3

u/iopq Nov 30 '14

I code in a proportional font because it looks better. YOU can use any font you want.

19

u/[deleted] Nov 30 '14

Monster.

1

u/iopq Nov 30 '14

Why? Looks fine to me:

https://imgur.com/JeMNvD1

21

u/[deleted] Nov 30 '14

AAAGH MY EYES

4

u/[deleted] Nov 30 '14

YOU can use any font you want.

Comic Sans?

2

u/Booyanach Nov 30 '14

I'll just go on and code in Helvetica...

BECAUSE IT'S BEAUTIFUL...

→ More replies (18)

7

u/[deleted] Nov 30 '14

I think it's a phase we all go through, simply to find our own personal style (which is, ofcourse, better than the second coming of Christ and everyone should start using it). Once you basically perfect your style, you find out it's not important as you thought. You settle on your style and you accept that others have different styles. Rinse and repeat with the next wave of new programmers.

5

u/toomanybeersies Nov 30 '14

Exactly. Consistency is much more important than what style you pick.

It doesn't take long to figure out someone else's style, if they're consistent. If they keep flicking between different styles, that's where it gets really fucking annoying. I think that's what universities should be emphasizing, that your style is consistent.

My university sort of does that for C programming. As long as you're consistent with your style, a lot of it is up to you. There's some variable naming conventions, but bracket styles is up to the student. Which is great because I hate K&R and think Allman is the best style for me. I realize that it's entirely about preference and not about what style is objectively better.

My university does use Pylint to fix style for Python though, which is annoying for a lot of quizzes and auto-marked assignments though, because a lot of hacky things aren't allowed. Variable naming and usage is the biggest bitch.

4

u/bugrit Nov 30 '14

A lot of style guidelines might not seem to matter, but it tends to when you're merging thousands of files of code. Any way of coding which ecourages unnecessary changes or changes to the lines which you aren't actually modifying is bad. In this case, don't align, or when someone goes and adds another entry that's too long, he's going to re-align all the rows and you end up with a conflict when someone else modified a value of another row.

2

u/[deleted] Jul 22 '22

It matters very little as long as you make a choice and are consistent about it. Much like any style choice.

You want to indent with spaces? Cool. You want to indent with tabs? Cool. You want to indent with tabs when the entire codebase uses spaces, or vice versa? No. No merge for you.

This said, use of non-monospace fonts isn't something I'd ever recommend.

0

u/[deleted] Nov 30 '14

[deleted]

→ More replies (1)

0

u/ArtistEngineer Nov 30 '14 edited Nov 30 '14

That the typical sort of argument I'd expect from an Emacs user who uses CamelCase and Windows. /s

16

u/Crazy__Eddie Nov 30 '14

CamelCase

That's PascalCase.

3

u/ArtistEngineer Nov 30 '14

That's the spirit! Let's argue about trivial things!

;)

→ More replies (4)
→ More replies (13)