|
Yeah, honestly this discussion looks an awful lot like "Don't shitpost" "YOU CAN'T TELL ME WHAT TO DO"
|
# ? May 31, 2016 16:34 |
|
|
# ? Jun 8, 2024 06:51 |
|
Volte posted:All of his pronouncements were about as high and mighty as "don't play on the freeway" Idk, about half of them boiled down to "don't write idiomatic code" which is kinda high and mighty iyam
|
# ? May 31, 2016 16:36 |
|
TooMuchAbstraction posted:Yeah, honestly this discussion looks an awful lot like Your posts will always look like poo poo to someone else. Do whatever you want and gently caress the shitpost haters.
|
# ? May 31, 2016 16:36 |
you can take my postfix increment from my cold, dead hands
|
|
# ? May 31, 2016 16:39 |
|
Can we at least agree on "be consistent"? Whether it's your own coding style, your team's, or a larger standard, pick something and stick with it.
|
# ? May 31, 2016 16:55 |
|
Depressing Box posted:Can we at least agree on "be consistent"? Whether it's your own coding style, your team's, or a larger standard, pick something and stick with it. Pretty much. There is nothing worse than doing a pull and looking at some new files only to see the indentation all the gently caress over the place. It triggers a bunch of "do I fix this? do I update my tab preferences? is this a new standard?" type questions and it just pisses me off. Especially when a standard was agreed upon in a meeting last month and the passive aggressive dissenter keeps on doing things their way and wins by wearing everyone else down.
|
# ? May 31, 2016 17:00 |
|
JawnV6 posted:Neither does "wait for the TX interrupt bit to be unset" but that generally trips the "no empty loops" condition. But I'm pretty sure breaking that out into That would fail code review at my workplace because it's missing a timeout check for when the hardware breaks and the bit remains stuck.
|
# ? May 31, 2016 17:06 |
|
... and is that common code structured with the verbose non-empty loop code:
code:
|
# ? May 31, 2016 17:35 |
|
Completely unrelated, but why do some people...JawnV6 posted:
...put spaces between parens like that? That's one stylistic thing I've never really understood; it doesn't improve legibility for me anyway.
|
# ? May 31, 2016 17:57 |
|
TooMuchAbstraction posted:Completely unrelated, but why do some people... It makes it easier to keep track of nesting at a glance. Granted, mismatched parens aren't exactly the most insidious kind of typo, but it still makes it clearer at a glance.
|
# ? May 31, 2016 18:00 |
|
I don't actually like that style but I do like it whenever I read id software's C++ code. I like their style but I would hesitate to ever adopt it for my own projects.
|
# ? May 31, 2016 18:02 |
|
The extra spaces feel more legible to me, it seems easier to pick out the tests. If you're putting spaces around the operator it feels lopsided too. ((maths) && (maths)) looks weird to me, and ((maths)&&(maths)) is even worse. That said, nested parenthesis are a legibility disaster no matter how you dress it up so I don't sweat the specifics too much.
|
# ? May 31, 2016 18:05 |
|
xzzy posted:Your code will look like poo poo to yourself six months from now. My opinion on my code from six months ago is largely the same was when I wrote it, and my thoughts on code from a few years ago tends to be more along the lines of "oh, I could improve this by doing X" rather than "wow this is garbage". I've never understood why some programmers apparently flop instantly from loving the code they wrote to hating it as soon as it exits their short-term memory.
|
# ? May 31, 2016 18:25 |
|
It's kind of a problem that programmers knee-jerk rage about code that they don't understand/recognize at first glance.
|
# ? May 31, 2016 18:36 |
|
fleshweasel posted:yes, we can tell now that the "and" heuristic is not that useful if you contrive your description of the code. code:
|
# ? May 31, 2016 18:38 |
|
xzzy posted:Your code will look like poo poo to yourself six months from now. I have never had this problem.
|
# ? May 31, 2016 18:42 |
|
Plorkyeran posted:My opinion on my code from six months ago is largely the same was when I wrote it, and my thoughts on code from a few years ago tends to be more along the lines of "oh, I could improve this by doing X" rather than "wow this is garbage". I don't hate the code I just wrote, but I do fall out of love with it quickly; if I'm still chuffed about the code I wrote then I overlook its flaws or resist removing it even when other evidence suggests a different direction. Saying you hate code you wrote six months ago is a way to avoid the sunk cost fallacy.
|
# ? May 31, 2016 18:56 |
I have the opposite problem. I've had a burnout on programming, getting better still not entirely over it, and sometimes when I read my old code I end up amazed that I ever managed to write something that good. It's probably nothing amazing compared to what else is out there, but far better than what I can imagine myself coming up with today.
|
|
# ? May 31, 2016 19:03 |
|
sometimes, on the internet, people make extreme statements that are not wholly true, for rhetorical or comedic purposes. for example, they may claim that a piece of code they wrote 6 months ago makes them scream out loud or feel physically sick, when in reality it merely causes them to frown slightly and think about how they'd write it today.
|
# ? May 31, 2016 19:55 |
|
xzzy posted:That said, nested parenthesis are a legibility disaster no matter how you dress it up so I don't sweat the specifics too much. Every language should have an equivalent to the haskell $ operator.
|
# ? May 31, 2016 20:10 |
|
Soricidus posted:sometimes, on the internet, people make extreme statements that are not wholly true, for rhetorical or comedic purposes. for example, they may claim that a piece of code they wrote 6 months ago makes them scream out loud or feel physically sick, when in reality it merely causes them to frown slightly and think about how they'd write it today. This is the best analysis I've ever read.
|
# ? May 31, 2016 20:36 |
|
TooMuchAbstraction posted:Completely unrelated, but why do some people... I don't think it looks good to put spaces between bracket delimiters. But I have started to appreciate adding spaces inside brackets in one context, which is the "not operator in an if condition": if ( ! condition) { ... I feel like ! is quite easy to overlook without this, so it improves the readability of the code, even though the first time I saw it I thought it was ugly.
|
# ? May 31, 2016 20:47 |
|
Pavlov posted:Every language should have an equivalent to the haskell $ operator. On that note, it remains slightly annoying to me how English and US-centric a lot of the character conventions in programming are. ${}[]| and co aren't particularly easy to type on a good half of the world's keyboards, yet languages keep using them all over the drat place. Backticks are by far the worst in the swedish/nordic/german layouts, since ` is a chord resulting in a dead key meaning half the time you end up writing á instead of `a. You might reply that I should use a US layout. I do, which has the cost that if I want to write something in my native language then that's a bunch of additional effort instead. The entire situation could be avoided by sticking to basic text-oriented symbols available everywhere but some jackass just had to give distinct meanings to all their special keys. I nurture a small, vindictive hope to some day introduce the ¨ and € operators in a major language to ensure that person will be as mildly annoyed as I have been.
|
# ? May 31, 2016 20:50 |
|
Hammerite posted:I don't think it looks good to put spaces between bracket delimiters. But I have started to appreciate adding spaces inside brackets in one context, which is the "not operator in an if condition": Hm. Yeah, I can see that. It's always bugged me how many languages don't have a "not" keyword that is isomorphic to the ! operator. Having a syntax-highlighted word is just so much more visible than sticking a ! in front of something.
|
# ? May 31, 2016 20:51 |
|
Xerophyte posted:On that note, it remains slightly annoying to me how English and US-centric a lot of the character conventions in programming are. ${}[]| and co aren't particularly easy to type on a good half of the world's keyboards, yet languages keep using them all over the drat place. You could try trigraphs. Or persuading someone to make a programmer keyboard for your language. Xerophyte posted:You might reply that I should use a US layout. I do, which has the cost that if I want to write something in my native language then that's a bunch of additional effort instead. Pressing a single keyboard shortcut to toggle layouts: "a bunch of additional effort" seriously I have like three languages that I type in regularly, and flipping between them (or making sure I'm in English mode for code) really isn't a problem.
|
# ? May 31, 2016 20:58 |
|
Soricidus posted:sometimes, on the internet, people make extreme statements that are not wholly true, for rhetorical or comedic purposes. for example, they may claim that a piece of code they wrote 6 months ago makes them scream out loud or feel physically sick, when in reality it merely causes them to frown slightly and think about how they'd write it today. Okay, so I understand that saying that you hate all of your old code is obviously exaggeration, but even a mild dislike is still entirely unlike my typical reaction to my old code. As a general rule, I don't have negative feelings about my old code when I come back to it later months or years later. If I was prouad of it when I wrote it, I'm usually still happy with it months or years later, even if I would no longer write it that way, thinking about how I could write it better now makes me happy that I've learned how to better address the problems that I ran in to at the time. If anything I'm considerably more positive about my old code than when I'm actively writing it.
|
# ? May 31, 2016 21:02 |
|
Soricidus posted:Pressing a single keyboard shortcut to toggle layouts: "a bunch of additional effort" Good for you. I do find swapping layouts annoying, especially since the US physical key placement doesn't match, and I'd rather not have a reason to swap.
|
# ? May 31, 2016 21:07 |
|
Xerophyte posted:On that note, it remains slightly annoying to me how English and US-centric a lot of the character conventions in programming are. ${}[]| and co aren't particularly easy to type on a good half of the world's keyboards, yet languages keep using them all over the drat place. Backticks are by far the worst in the swedish/nordic/german layouts, since ` is a chord resulting in a dead key meaning half the time you end up writing á instead of `a. you could use haskell or scala and add your own € operator right now!
|
# ? May 31, 2016 21:22 |
|
or uh... perl6? is that the one you can arbitrarily change the parsing behavior?
|
# ? May 31, 2016 21:24 |
|
qntm posted:I have never had this problem. I wonder if there's a correlation between the so-called "imposter syndrome" and thinking you have writen bad code (regardless of the truth of that thought). I haven't experienced imposter syndrome yet either and I think it's due to reading a lot of code. Code that tends to be pretty bad. My speculation is that people with imposter syndrome are somewhat isolated and therefore overcritical of self. Totally biased and anecdotal, but still, a thought.
|
# ? May 31, 2016 21:27 |
|
qntm posted:That line of code also sets src to point at the end of the string. And moves dst forward by the number of bytes which were read from src... I wasn't aware that industry best practices frowned on the modification of local variables.
|
# ? May 31, 2016 21:27 |
|
Xerophyte posted:On that note, it remains slightly annoying to me how English and US-centric a lot of the character conventions in programming are. ${}[]| and co aren't particularly easy to type on a good half of the world's keyboards, yet languages keep using them all over the drat place. Backticks are by far the worst in the swedish/nordic/german layouts, since ` is a chord resulting in a dead key meaning half the time you end up writing á instead of `a. Just use Java! code:
code:
M31 fucked around with this message at 21:42 on May 31, 2016 |
# ? May 31, 2016 21:37 |
|
necrotic posted:or uh... perl6? is that the one you can arbitrarily change the parsing behavior? There's also TECO, the programming language in which every string is a valid program. It stands to reason that € must do something in TECO...well, except that I'm pretty sure the language predates the Eurozone.
|
# ? May 31, 2016 21:37 |
|
And TeX.
|
# ? May 31, 2016 21:40 |
|
TooMuchAbstraction posted:There's also TECO, the programming language in which every string is a valid program. It stands to reason that € must do something in TECO...well, except that I'm pretty sure the language predates the Eurozone. Predecesor to EMACS, huh? quote:one could use the following TECO session (noting that the prompt is "*" and "$" is how ESC is echoed) to change "Hello" into "Goodbye": code:
|
# ? May 31, 2016 21:42 |
|
Xerophyte posted:On that note, it remains slightly annoying to me how English and US-centric a lot of the character conventions in programming are. ${}[]| and co aren't particularly easy to type on a good half of the world's keyboards, yet languages keep using them all over the drat place. Backticks are by far the worst in the swedish/nordic/german layouts, since ` is a chord resulting in a dead key meaning half the time you end up writing á instead of `a. Let's face it, the problem is that a lot of "national" keyboard layouts out there were bad from the very start, and "makes it annoying to type programming languages" is just one facet of the issue. With many of them, it would be very hard to create a punctuation standard for replacing the use of [{ etc in current languages.
|
# ? May 31, 2016 21:46 |
|
Xerophyte posted:You might reply that I should use a US layout. I do, which has the cost that if I want to write something in my native language then that's a bunch of additional effort instead. The entire situation could be avoided by sticking to basic text-oriented symbols available everywhere but some jackass just had to give distinct meanings to all their special keys. I nurture a small, vindictive hope to some day introduce the ¨ and € operators in a major language to ensure that person will be as mildly annoyed as I have been. I am Danish and I use the US International (us-intl) layout everywhere. It is Good. Better for programming, not really more effort to write the æ's, ø's and å's than with a Danish layout, and I get all kinds of other international squigglies as well!
|
# ? May 31, 2016 22:03 |
|
pseudorandom name posted:I wasn't aware that industry best practices frowned on the modification of local variables. Hello friend, do you have a few minutes to talk about immutability?
|
# ? May 31, 2016 22:03 |
|
Even with a US keyboard, I would use a language that uses 「Japanese quotation marks」, just because I think they look spiffy. e: Holy poo poo they got 『』, 《》, and【】 too. Think of all the special nesting types we could have.
|
# ? May 31, 2016 22:06 |
|
|
# ? Jun 8, 2024 06:51 |
|
fishmech posted:Let's face it, the problem is that a lot of "national" keyboard layouts out there were bad from the very start, and "makes it annoying to type programming languages" is just one facet of the issue. With many of them, it would be very hard to create a punctuation standard for replacing the use of [{ etc in current languages. Oh yes, the layouts themselves are horrors in a lot of ways. I maintain that the person who looked at the $ character and thought "that'd make a good special character in my spiffy programming language" was a bit blinkered, though.
|
# ? May 31, 2016 22:13 |