|
ExcessBLarg! posted:I'm guilty of using parentheses with "function-like" keywords like sizeof. It's a little weird, although not entirely uncommon to smash control flow keywords (if, for, while) against the condition parenthesis. Common C style guides (KNF/style(9) and Linux kernel) do include space there, I think in part to distinguish them from function calls, but also because those keywords also introduce expression blocks anyways. If you merely put an if/for/while against a parenthesis, I will frown at your code and move on. If you do this, however, I will curse you and your descendants to the seventh generation: code:
|
# ? Sep 10, 2015 20:34 |
|
|
# ? May 27, 2024 02:03 |
|
Zopotantor posted:If you merely put an if/for/while against a parenthesis, I will frown at your code and move on. If you do this, however, I will curse you and your descendants to the seventh generation: I worked at a place that put whitespace around and inside parens and braces, and also put all braces on newlines. I'm all for whitespace, but come on.
|
# ? Sep 10, 2015 21:25 |
|
Ended up auditing our mysql stored procs and found this delightful one, business_day_diff()code:
e: ffs, it came from StackOverflow... look at those tables. LOOK AT THEM. McGlockenshire fucked around with this message at 21:34 on Sep 10, 2015 |
# ? Sep 10, 2015 21:31 |
|
McGlockenshire posted:e: ffs, it came from StackOverflow... look at those tables. LOOK AT THEM. A hero for our times: that dude who resistd the temptation of showing off his clever coding skills in favour of a sober reminder that no, you need an actual calendar because holidays exist.
|
# ? Sep 10, 2015 22:05 |
McGlockenshire posted:What's worse, that this exists, that this works, or that this is probably the best way to do it? That actually seems pretty clever, and not horrible to me. NihilCredo posted:A hero for our times: that dude who resistd the temptation of showing off his clever coding skills in favour of a sober reminder that no, you need an actual calendar because holidays exist. The questioner specifically stated that holidays need not be taken into account. I am sure everyone who answered that question understands that holidays are a thing.
|
|
# ? Sep 10, 2015 22:39 |
|
The Version Control Rules for the project I'm on are that two other developers need to review a pull request before it can be merged - that's pretty much the same as every other project I've worked on for every semi-competent employer. The problem is that this project only has four developers on it and three of them are front end developers with me as the odd man out on the back end, and so none of the front end developers want to review my code. Every few weeks my boss's boss (my direct boss being one of the front end developers) will ask why I have so many unmerged pull requests, I'll say that nobody wants to review them, and he'll tell me to just go ahead and merge them and let QA basically act as a replacement for code review. So the system is broken but more or less works anyway.
|
# ? Sep 11, 2015 20:35 |
|
code:
Why, yes, C programmers are still making interfaces that put error information and success information in the same return value.
|
# ? Sep 11, 2015 23:51 |
sarehu posted:
drat. Linus took a claw hammer and went prospecting for new assholes in that guy's colon. I understand he's frustrated, but holy poo poo.
|
|
# ? Sep 12, 2015 03:04 |
Centripetal Horse posted:drat. Linus took a claw hammer and went prospecting for new assholes in that guy's colon. I understand he's frustrated, but holy poo poo. That's really not that bad by Linus standards
|
|
# ? Sep 12, 2015 03:55 |
|
VikingofRock posted:That's really not that bad by Linus standards "Mauro, SHUT THE gently caress UP!" will always be the gold standard of Torvalds pushing someone's poo poo in.
|
# ? Sep 12, 2015 04:08 |
|
I was always partial to "Of course, I'd also suggest that whoever was the genius who thought it was a good idea to read things ONE F*CKING BYTE AT A TIME with system calls for each byte should be retroactively aborted. Who the f*ck does idiotic things like that? How did they noty die as babies, considering that they were likely too stupid to find a tit to suck on?"
|
# ? Sep 12, 2015 04:12 |
|
Suspicious Dish posted:I was always partial to "Of course, I'd also suggest that whoever was the genius who thought it was a good idea to read things ONE F*CKING BYTE AT A TIME with system calls for each byte should be retroactively aborted. Who the f*ck does idiotic things like that? How did they noty die as babies, considering that they were likely too stupid to find a tit to suck on?" 5 He's right though, who could possibly think that's a good idea.
|
# ? Sep 12, 2015 04:15 |
|
I *really* really *don't* understand the use of asterisks as if they're *quotes*. Is that use of markdown, but not parsing in the context?
|
# ? Sep 12, 2015 04:22 |
|
Joke answer: Because they will probably break whatever 70's software he's probably using to compose and send mail.
|
# ? Sep 12, 2015 04:24 |
|
substitute posted:I *really* really *don't* understand the use of asterisks as if they're *quotes*. Is that use of markdown, but not parsing in the context? Many programs (including some mail programs) will bold stuff surrounded by asterisks, underline stuff surrounded by underscores, etc. Markdown didn't come up with that poo poo from thin air. Hell, even terminal irc clients do it.
|
# ? Sep 12, 2015 04:30 |
|
Blotto Skorzany posted:Many programs (including some mail programs) will bold stuff surrounded by asterisks, underline stuff surrounded by underscores, etc. Markdown didn't come up with that poo poo from thin air. Hell, even terminal irc clients do it. Got it. Just seemed so weird, like some super sperg thing at first.
|
# ? Sep 12, 2015 04:39 |
|
Asterisks are a reasonable way to emphasize words. Though one common problem is people doing the opposite, using "scare quotes" for emphasis, and undermining themselves in hilarious ways. For example:
|
# ? Sep 12, 2015 04:51 |
|
*rings bell*
|
# ? Sep 12, 2015 05:03 |
|
VikingofRock posted:That's really not that bad by Linus standards Some of our crucible reviews at work are nasty, one guy did some code and then had 12 people rip him a new one with more and more elegant and better solutiions for this piece of work - I was one of the reviewers and i had to rip one of the other reviewers a new one, as he said that they should have done a switch(string) block, Which is impossible as we do not use java 1.7 but java 1.5 where switching was only on enums and ints. (he should have known better though he was the Tech lead for that part of the system (hmmm thats why my yearly review for him was meh)
|
# ? Sep 12, 2015 06:26 |
|
TheresaJayne posted:Some of our crucible reviews at work are nasty, one guy did some code and then had 12 people rip him a new one with more and more elegant and better solutiions for this piece of work - I was one of the reviewers and i had to rip one of the other reviewers a new one, as he said that they should have done a switch(string) block, What combination of buzzwords describes your business's methodology because I dont ever want to work anywhere that shares any adjectives with the hellhole you just described.
|
# ? Sep 12, 2015 06:58 |
|
Suspicious Dish posted:*rings bell* No it's Suspicious Dish posted:"rings bell"
|
# ? Sep 12, 2015 07:17 |
|
TheresaJayne posted:Some of our crucible reviews at work are nasty, one guy did some code and then had 12 people rip him a new one with more and more elegant and better solutiions for this piece of work - I was one of the reviewers and i had to rip one of the other reviewers a new one, as he said that they should have done a switch(string) block, couldnt figure out an elegant way to get onto a supported version of java, though.
|
# ? Sep 12, 2015 07:44 |
|
TheresaJayne posted:Some of our crucible reviews at work are nasty, one guy did some code and then had 12 people rip him a new one with more and more elegant and better solutiions for this piece of work - I was one of the reviewers and i had to rip one of the other reviewers a new one, as he said that they should have done a switch(string) block, This is some Spergelord of the Flies poo poo right here.
|
# ? Sep 12, 2015 07:59 |
|
Corla Plankun posted:What combination of buzzwords describes your business's methodology because I dont ever want to work anywhere that shares any adjectives with the hellhole you just described. What buzzwords? We use a software package called Crucible for our reviews. https://www.atlassian.com/software/crucible/overview Our project is split into components and each component has a component tech lead Every year we have Staff Reviews usually done by our Tech lead and personnel manager Any large company would have them - although we have to be super careful on releases as one erorr and we lose Billions.... - Our last success http://www.bbc.co.uk/news/science-environment-34217255
|
# ? Sep 12, 2015 08:34 |
|
Blotto Skorzany posted:Many programs (including some mail programs) will bold stuff surrounded by asterisks, underline stuff surrounded by underscores, etc. Markdown didn't come up with that poo poo from thin air. Hell, even terminal irc clients do it. Markdown and others have that syntax because it's been in use in ASCII communication as emphasis for probably 30 years, long before anything that was displaying it used bold or italic in rendering it.
|
# ? Sep 12, 2015 09:00 |
|
TheresaJayne posted:one erorr and we lose Billions.... Nothing can possiblie go wrong.
|
# ? Sep 12, 2015 13:50 |
|
Suspicious Dish posted:*rings bell* *rings "bell"*
|
# ? Sep 12, 2015 16:06 |
|
I personally use ~*~ this convention ~*~ for emphasis.
|
# ? Sep 12, 2015 16:24 |
|
Pretty sure asteriks for emphasis is an habit from the early days of internet chat, like 80's or earlier. I really only see old school coders doing it.
|
# ? Sep 12, 2015 16:27 |
|
xzzy posted:Pretty sure asteriks for emphasis is an habit from the early days of internet chat, like 80's or earlier. I really only see old school coders doing it. It was pretty common in late '90s AIM chat too. As mentioned, it's still a feature in a large number of websites. It's not just markdown or other coder-y nonsense, Google Talk and Facebook chat both use it as well last I checked. I've mostly switched to using bold tags where applicable, but I still find myself reflexively putting stars around things and I'm very sure it has nothing to do with me being a programmer. E: Hell, I just went onto Facebook and my 25 year old friend who is a college dropout that majored in Early Childhood Eduction and has never touched a programming language did it.
|
# ? Sep 12, 2015 16:30 |
|
Suspicious Dish posted:I personally use ~*~ this convention ~*~ for emphasis. Isn't that a sarcasm delimiter?
|
# ? Sep 12, 2015 17:57 |
Planescape: Torment *loves* asterisks.
|
|
# ? Sep 12, 2015 19:10 |
|
This part is interesting:Linus posted:we had similar issues with the completely moronic and misdesigned crap called "strlcpy()", which was introduced for similar reasons, and also caused nasty bugs where the old code was actually correct, and the "converted to better and safer interfaces" code was actually buggy.
|
# ? Sep 12, 2015 19:21 |
|
Rattus posted:*rings "bell"* *"rings" "bell"*
|
# ? Sep 12, 2015 23:15 |
|
ExcessBLarg! posted:So Drepper was right? yes. strlcpy is a bad idea.
|
# ? Sep 12, 2015 23:21 |
|
even if strlcpy wasn't a bad idea, trying to fix c strings by adding a better copy function is like trying to fix my posting by adding better jokes
|
# ? Sep 13, 2015 00:32 |
|
Soricidus posted:even if strlcpy wasn't a bad idea, trying to fix c strings by adding a better copy function is like trying to fix my posting by adding better jokes worth a try?
|
# ? Sep 13, 2015 01:29 |
|
Suspicious Dish posted:yes. strlcpy is a bad idea. Why? Or at least, what makes it worse than strncpy?
|
# ? Sep 13, 2015 09:21 |
|
Two major issues. First, silent truncation is dangerous unless taken with care. Second, strlcpy requires a C string as input (so you can detect truncation), and strncpy doesn't. This means that:C++ code:
C++ code:
|
# ? Sep 13, 2015 09:27 |
|
|
# ? May 27, 2024 02:03 |
|
Well yes, strncpy is designed for fixed-length buffers and strlcpy is designed for c strings. The fact that they operate on different data types isn't a problem with either one.
|
# ? Sep 13, 2015 13:24 |