|
No Safe Word posted:
This is the standard American spelling of "Decametres" as stated here and as taught to me in the 2nd grade.
|
# ? Aug 8, 2011 22:43 |
|
|
# ? Apr 19, 2024 20:46 |
|
TasteMyHouse posted:This is the standard American spelling of "Decametres" as stated here and as taught to me in the 2nd grade. I always learned it as "decameter", and all units were prefaced with "deca-" and not "deka-". Weird.
|
# ? Aug 8, 2011 22:48 |
|
poemdexter posted:What the hell software needs to go from nanometers to parsecs?
|
# ? Aug 8, 2011 22:52 |
|
No Safe Word posted:I always learned it as "decameter", and all units were prefaced with "deca-" and not "deka-". Weird. It's not super important, I think it might even just be a Greek/Roman thing. I know it's worthless but deka loses the GoogleFight: http://www.googlefight.com/index.php?lang=en_GB&word1=decameter&word2=dekameter
|
# ? Aug 8, 2011 23:31 |
|
I'm using a library for exact computation that supposed to be pretty close to drop-in (just include the headers and set up some typedefs and you're done). This is kind of neat*, but what if your library has some warnings to emit during use? You wouldn't want to throw an exception if it's just a warning - that's far too drastic. Instead, maybe you do something like this:code:
*It's also a horror on its own - the default behavior is to just redefine double.
|
# ? Aug 9, 2011 00:46 |
|
No Safe Word posted:Out of place units I'm fairly sure that the mil is a unit of angle and doesn't exactly belong there.
|
# ? Aug 9, 2011 00:55 |
|
Broken Knees Club posted:I'm fairly sure that the mil is a unit of angle and doesn't exactly belong there. mil can also be 1/1000th of an inch.
|
# ? Aug 9, 2011 01:02 |
|
Scaramouche posted:It's not super important, I think it might even just be a Greek/Roman thing. It also might be done to avoid confusion that could arise between decimeters and decameters.
|
# ? Aug 9, 2011 01:52 |
|
poemdexter posted:What the hell software needs to go from nanometers to parsecs? Han Solo.
|
# ? Aug 9, 2011 04:55 |
|
McGlockenshire posted:Han Solo.
|
# ? Aug 9, 2011 05:51 |
|
poemdexter posted:I had to double check if Parsecs was a thing. http://futureboy.us/frinkdocs/
|
# ? Aug 9, 2011 12:52 |
|
Zhentar posted:It also might be done to avoid confusion that could arise between decimeters and decameters. This is the reason my teacher gave when I asked this question in 2nd grade! For whatever that's worth...
|
# ? Aug 9, 2011 17:53 |
|
Dooey posted:Am I the only one who finds reading code in mixed styles not a big deal? I always use the same style for my own code, but at work we all have different styles and when I read other peoples code I have no problems at all. I went through a period where I tried each style to see which one I truly preferred, and after the initial novelty of each one wore off, I didn't find any one more readable than the other, so I just chose one to be consistent. Mustach posted:I think that monospace fonts are an eyesore. I sometimes think that people stick to them just so they can pretend their code is some kind of WYSIWYG and waste time with valueless formatting like this: Fixed-width fonts in Objective-C code let Xcode automatically line up colons in long messages, which is really nice: code:
Toady fucked around with this message at 21:35 on Aug 9, 2011 |
# ? Aug 9, 2011 21:21 |
|
Toady posted:I went through a period where I tried each style to see which one I truly preferred, and after the initial novelty of each one wore off, I didn't find any one more readable than the other, so I just chose one to be consistent. I think of written code as written prose: unless someone punches one of my pet peeves' buttons, I get used to different styles in a hurry. Then the problem is reduced to limiting the number of pet peeves you have, which is much easier.
|
# ? Aug 9, 2011 21:24 |
|
tef posted:http://futureboy.us/frinkdocs/ I met the creator of that on Saturday during "Crash & Compile" at defcon; they won because one of the teams was a PDP-11 gimmick team that picked their language from a d12, and another team used the other gimmick team's d20 from last year.
|
# ? Aug 10, 2011 00:52 |
|
BonzoESC posted:I met the creator of that on Saturday during "Crash & Compile" at defcon; they won because one of the teams was a PDP-11 gimmick team that picked their language from a d12, and another team used the other gimmick team's d20 from last year.
|
# ? Aug 10, 2011 01:46 |
|
In C++. Just found out that the base class for a ton of our objects is a "Utilities" class where all the methods are static methods. The same codebase has namespace pollution all over the place, granted it's mostly using namespace std but it results in function prototypes like this: code:
*sigh* Dren fucked around with this message at 16:49 on Aug 10, 2011 |
# ? Aug 10, 2011 16:45 |
|
Dren posted:I'd like to be able to tell for sure without running the preprocessor. The true horror spotted.
|
# ? Aug 10, 2011 17:10 |
|
It's cool when people declare virtual methods in abstract base classes that need to be implemented in subclasses as:code:
code:
|
# ? Aug 10, 2011 17:13 |
|
Serializing a double (sanitized a bit for clarity):code:
|
# ? Aug 10, 2011 19:55 |
|
Huh, I didn't actually realize you could give a union a constructor. I wonder if there's ever a good reason to. The volatile there is extra-weird.
|
# ? Aug 10, 2011 20:11 |
|
Plorkyeran posted:The volatile there is extra-weird. Just a wild guess, but the user might have ripped it off from somewhere else where it makes sense and didn't bother to remove it. The status registers for a UART in an embedded system would be some horrible combination of a volatile union and structs.
|
# ? Aug 10, 2011 22:08 |
|
TasteMyHouse posted:It's cool when people declare virtual methods in abstract base classes that need to be implemented in subclasses as: Anyway, abstract methods should be virtual void cool_method() = 0; obv.
|
# ? Aug 10, 2011 22:10 |
Brecht posted:'abstract' is not a C++ keyword? What is this? Probably C#.
|
|
# ? Aug 10, 2011 22:16 |
|
1337JiveTurkey posted:Just a wild guess, but the user might have ripped it off from somewhere else where it makes sense and didn't bother to remove it. The status registers for a UART in an embedded system would be some horrible combination of a volatile union and structs. Not so much that he didn't bother to remove it, he wrote it that way. You're half-right on the embedded systems guess; he's an embedded C guy who's lead on our C++ desktop applications by virtue of being in the company the longest.
|
# ? Aug 10, 2011 22:18 |
|
I guess it's "safe" because it went in a vector? Considering that he's an embedded guy at least he didn't use any macros.
|
# ? Aug 10, 2011 22:51 |
|
nielsm posted:Probably C#. Yeah, it's C#. I'm in the middle of writing a bunch of C++/CLI and C# classes to wrap a C library to write a plugin for a (completely undocumented) internal tool at work. It's fun kind of but also terrible.
|
# ? Aug 11, 2011 00:06 |
|
Plorkyeran posted:The volatile there is extra-weird. He's probably been bitten by bad compilers for embedded systems before, making him learn a more defensive style of programming. Scaevolus fucked around with this message at 00:55 on Aug 11, 2011 |
# ? Aug 11, 2011 00:21 |
|
i guess disabling all optimizations is a way to avoid correctness problems due to aliasing violations not a very good way
|
# ? Aug 11, 2011 01:58 |
|
Plorkyeran posted:i guess disabling all optimizations is a way to avoid correctness problems due to aliasing violations Union members are allowed to alias even with strict aliasing optimization switched on. That's kind of what they're for.
|
# ? Aug 11, 2011 02:14 |
|
Plorkyeran posted:i guess disabling all optimizations is a way to avoid correctness problems due to aliasing violations Seriously what the gently caress is an aliasing violation? I tried looking it up, but the examples I saw didn't make any sense. Is that something that you C guys have to deal with constantly?
|
# ? Aug 11, 2011 02:25 |
|
TasteMyHouse posted:It's cool when people declare virtual methods in abstract base classes that need to be implemented in subclasses as: Maybe they didn't know that abstract methods exist. I like it when people make every method in a class virtual, because "I might need to override it some day!" It doesn't hurt anything other than readability, of course.
|
# ? Aug 11, 2011 02:40 |
|
This is pretty miniscule compared to some of the things I've seen in this thread but I thought it was pretty retarded.code:
|
# ? Aug 11, 2011 02:41 |
|
mjau posted:Union members are allowed to alias even with strict aliasing optimization switched on. That's kind of what they're for. This is in fact a very exciting and lively debate on the C committee. Neither C nor C++ actually permits aliasing through a union. Unions have an "active member", determined by which member was last stored through, and it is impermissible to read from any member other than the active member, with one exception: if the member accessed and the active member are both structs, and they share a common prefix, it is okay to access a member of that common prefix. However, some people have argued that unions ought to influence aliasing somehow, except that nobody seems quite certain what the language rule should be. Anyway, char can alias anything, so if the code instead just casted the double* to char* and did that final loop, it would be perfectly legal by both standards.
|
# ? Aug 11, 2011 02:46 |
|
mjau posted:Union members are allowed to alias even with strict aliasing optimization switched on. That's kind of what they're for. Ithaqua posted:I like it when people make every method in a class virtual, because "I might need to override it some day!" It doesn't hurt anything other than readability, of course.
|
# ? Aug 11, 2011 02:47 |
|
Maybe they miss Java.
|
# ? Aug 11, 2011 02:49 |
|
Plorkyeran posted:and performance I'd never thought of that, actually. I always assumed that was something the compiler figured out, and at runtime it was already squared away. Turns out I'm wrong! http://stackoverflow.com/questions/530799/what-are-the-performance-implications-of-marking-methods-properties-as-virtual
|
# ? Aug 11, 2011 03:10 |
|
MEAT TREAT posted:Seriously what the gently caress is an aliasing violation? I tried looking it up, but the examples I saw didn't make any sense. Is that something that you C guys have to deal with constantly? Basically "aliasing" is when you have one location that's referred to by multiple names. If you assume that anything at all can be aliased to anything else in the current scope, then that really limits what optimizations you can do - you have to actually write everything to memory before you read through a pointer, for example. So for performance, the compiler is allowed to assume that in most cases there is no aliasing. If there actually is aliasing when the compiler assumes there isn't, then you can run into some problems with your reads getting stale values and the like.
|
# ? Aug 11, 2011 03:21 |
|
First Time Caller posted:This is pretty miniscule compared to some of the things I've seen in this thread but I thought it was pretty retarded. That's actually a pretty decent way of doing it, compared to a "{", HTML block, then a closing "}" possibly many lines away. A bit weird and rarely used, but understandable.
|
# ? Aug 11, 2011 05:24 |
|
|
# ? Apr 19, 2024 20:46 |
|
Zamujasa posted:That's actually a pretty decent way of doing it, compared to a "{", HTML block, then a closing "}" possibly many lines away. Surely the horror is the comparison that cannot possibly* be true, and/or the misspelling of "yin". * I know nearly no PHP and would not be surprised to hear that I am wrong here.
|
# ? Aug 11, 2011 05:42 |