|
Another controversial opinion: the only people who use spaces for indentation are communists and satanists. If you are using an IDE that doesn't allow you to set the number of spaces defined by a tab, then you a scrub.
|
# ? Jul 30, 2011 17:37 |
|
|
# ? May 15, 2024 03:46 |
|
angrytech posted:Another controversial opinion: the only people who use spaces for indentation are communists and satanists. I use tabs for indentation. but i set tabs to be 1 space each.
|
# ? Jul 30, 2011 17:40 |
|
angrytech posted:Another controversial opinion: the only people who use spaces for indentation are communists and satanists. That's controversial? Using tabs and setting your own size is the easiest way to eliminate half of any team's formatting debates
|
# ? Jul 30, 2011 17:50 |
|
angrytech posted:If you are using an IDE that doesn't allow you to set the number of spaces defined by a tab, then you a scrub.
|
# ? Jul 30, 2011 17:53 |
|
Fixed width fonts own because you can do stupid poo poo like thispre:struct transition_table : mpl::vector< // Start Event Target Action Guard // +---------+------------+-----------+---------------------------+----------------------------+ a_row< Stopped , play , Playing , &player_::start_playback >, a_row< Stopped , open_close , Open , &player_::open_drawer >, _row< Stopped , stop , Stopped >, // +---------+------------+-----------+---------------------------+----------------------------+ a_row< Open , open_close , Empty , &player_::close_drawer >, // +---------+------------+-----------+---------------------------+----------------------------+ a_row< Empty , open_close , Open , &player_::open_drawer >, row< Empty , cd_detected, Stopped , &player_::store_cd_info , &player_::good_disk_format >, row< Empty , cd_detected, Playing , &player_::store_cd_info , &player_::auto_start >, // +---------+------------+-----------+---------------------------+----------------------------+ a_row< Playing , stop , Stopped , &player_::stop_playback >, a_row< Playing , pause , Paused , &player_::pause_playback >, a_row< Playing , open_close , Open , &player_::stop_and_open >, // +---------+------------+-----------+---------------------------+----------------------------+ a_row< Paused , end_pause , Playing , &player_::resume_playback >, a_row< Paused , stop , Stopped , &player_::stop_playback >, a_row< Paused , open_close , Open , &player_::stop_and_open > // +---------+------------+-----------+---------------------------+----------------------------+ > {};
|
# ? Jul 30, 2011 17:58 |
|
Dicky B posted:Fixed width fonts own because you can do stupid poo poo like this if i saw that in any of the code you wrote for me i would probably murder you, just fyi
|
# ? Jul 30, 2011 21:53 |
|
angrytech posted:Another controversial opinion: the only people who use spaces for indentation are communists and satanists. Using tabs for indentation is an abomination. The tab character is meant for creating tables in character based displays. It exists so you can print "\tX\tY\na\t1\t2\nb\t3\t4\n" as a simple way to format output. The semantics are "advance to the next tab stop point" and not "insert N spaces". The tab stop points don't necessarily even share a common factor; You could configure the display to have the first point at the 3rd character column, the next at 7, the third at 16, and the rest increments of 4 characters after that. I'm mad about tabs.
|
# ? Jul 30, 2011 23:28 |
|
Zorn posted:Using tabs for indentation is an abomination. The tab character is meant for creating tables in character based displays. It exists so you can print "\tX\tY\na\t1\t2\nb\t3\t4\n" as a simple way to format output. The semantics are "advance to the next tab stop point" and not "insert N spaces". The tab stop points don't necessarily even share a common factor; You could configure the display to have the first point at the 3rd character column, the next at 7, the third at 16, and the rest increments of 4 characters after that. Your point being? As long as stuff vertically lines up, who cares about the precise x-coordinates of other people's vertical lines. Honestly. Also, this forever: code:
|
# ? Jul 30, 2011 23:49 |
|
Dicky B posted:Fixed width fonts own because you can do stupid poo poo like this
|
# ? Jul 31, 2011 00:04 |
|
Comic Sans 4 lyfe
|
# ? Jul 31, 2011 00:46 |
|
Fun fact that code is part of the boost MSM library documentation.
|
# ? Jul 31, 2011 01:13 |
|
Zorn posted:Using tabs for indentation is an abomination. The tab character is meant for creating tables in character based displays. It exists so you can print "\tX\tY\na\t1\t2\nb\t3\t4\n" as a simple way to format output. The semantics are "advance to the next tab stop point" and not "insert N spaces". The tab stop points don't necessarily even share a common factor; You could configure the display to have the first point at the 3rd character column, the next at 7, the third at 16, and the rest increments of 4 characters after that. Also, tabs should never be used for tables. Never ever. Spaces are the only correct way to do alignment, exactly because it's the only way to get exactly consistent output.
|
# ? Jul 31, 2011 01:35 |
|
qntm posted:The reason this is great: it works everywhere regardless of what you use for indentation. That's fine for declaration I suppose but I hope you aren't suggesting this for definition: code:
code:
Eggnogium fucked around with this message at 01:53 on Jul 31, 2011 |
# ? Jul 31, 2011 01:47 |
|
Jabor posted:
That's far too readable
|
# ? Jul 31, 2011 01:52 |
|
I actually wrote a working Haskell 'guess the number' program once in a completely unrecognizable font once on a dare. Worked the first time
|
# ? Jul 31, 2011 01:54 |
|
Jabor posted:
Oh god. Next time a developer leaves their screen unlocked I'm changing their font in dev studio to Comic Sans!
|
# ? Jul 31, 2011 02:12 |
|
Oh god, this reminds me that Notepad++ not only used a non-monospace font for comments (but leaving all other text monospaced), but the font the developer decided to use was Comic Sans. Apparently he's regained sanity, though, since comments now use the same font as all other text.
|
# ? Jul 31, 2011 02:14 |
|
Eggnogium posted:
Acceptable. Better: code:
code:
Hammerite fucked around with this message at 02:23 on Jul 31, 2011 |
# ? Jul 31, 2011 02:21 |
|
Eggnogium posted:That's fine for declaration I suppose but I hope you aren't suggesting this for definition: I like to do it like this: code:
|
# ? Jul 31, 2011 02:26 |
|
code:
|
# ? Jul 31, 2011 02:33 |
|
code:
|
# ? Jul 31, 2011 02:35 |
|
Dicky B posted:<- me adding tabs to my code when you're aligning things, use spaces. thusly: code:
|
# ? Jul 31, 2011 02:37 |
|
Tabs for indentation, spaces for alignment. What's wrong with you people?
|
# ? Jul 31, 2011 03:43 |
|
Hammerite posted:
I know it's just personal preference but I used to think the only people who did this were textbook authors to save space and CS undergrads who just mimicked the textbook authors.
|
# ? Jul 31, 2011 04:20 |
|
Janin posted:that way, the reader doesn't have to make their editor's settings conform to yours. That's still terrible, the code is hard to read with the type name so far from the variable. code:
|
# ? Jul 31, 2011 04:52 |
|
shrughes posted:That's still terrible, the code is hard to read with the type name so far from the variable.
|
# ? Jul 31, 2011 05:01 |
|
Janin posted:
Not K&R style. You are literally and honestly a horrible human being. May the universe have mercy on you. K&R bracing 4 lyfe.
|
# ? Jul 31, 2011 05:07 |
|
Dinty Moore posted:Not K&R style. You are literally and honestly a horrible human being. May the universe have mercy on you. K&R bracing 4 lyfe. code:
|
# ? Jul 31, 2011 05:14 |
|
Janin posted:K&R style? haha, nice one grandpa. do you separate the types and names too? I said K&R bracing, not K&R style function prototypes. code:
|
# ? Jul 31, 2011 05:30 |
|
this whole page is the horror
|
# ? Jul 31, 2011 05:35 |
|
Discussions like this make me love the fact that tabs are straight up illegal in F# source files (in the lightweight syntax, anyway). Whether you agree with how they did it or not, Microsoft definitely loving settled that issue.
|
# ? Jul 31, 2011 09:33 |
|
GrumpyDoctor posted:Whether you agree with how they did it or not, Microsoft definitely loving settled that issue.
|
# ? Jul 31, 2011 09:44 |
|
shrughes posted:That's still terrible, the code is hard to read with the type name so far from the variable. lol, it's when you have to add restrict it gets even more entertaining. code:
|
# ? Jul 31, 2011 11:57 |
|
Aleksei Vasiliev posted:settled the issue of whether any good programmers will ever use F#, yes
|
# ? Jul 31, 2011 14:17 |
|
MrMoo posted:lol, it's when you have to add restrict it gets even more entertaining. code:
|
# ? Jul 31, 2011 14:54 |
|
Dicky B posted:Clearly we need to switch to a table based solution. It's....beautiful.
|
# ? Jul 31, 2011 14:59 |
|
Dicky B posted:Clearly we need to switch to a table based solution. Thank you, and good night.
|
# ? Jul 31, 2011 15:39 |
|
I like my braces like I like my music: Allman
|
# ? Jul 31, 2011 17:18 |
|
Do you put commas at the end of the line or the beginning?code:
- Because the commas all line up, you can easily see missing commas - It's common to add extra elements at the end, so it's easier to use vim's "yyp" to duplicate the last line and tweak it to what you want, instead of also having to go to the 2nd to last line and add a comma. --- Corollary: when looking at a diff where someone's added a new line, the old last line is not affected so doesn't get added to the diff, so the diff is simpler to read (better fore code reviews). e.g diffs for adding a new column "wiz" Commas at beginning: code:
Commas at end: code:
|
# ? Jul 31, 2011 17:53 |
|
|
# ? May 15, 2024 03:46 |
You might be interested in the SQL Formatter
|
|
# ? Jul 31, 2011 18:11 |