|
the best part of stringly typed is when they shove an array into a string delimited by some character but don't consider if that delimiting character may be part of the content (people who stringly type never consider this)
|
# ? Oct 12, 2016 14:34 |
|
|
# ? May 30, 2024 08:41 |
|
comedyblissoption posted:the best part of stringly typed is when they shove an array into a string delimited by some character but don't consider if that delimiting character may be part of the content I did this with a csv parser.
|
# ? Oct 12, 2016 14:49 |
|
Just use non-printing ASCII characters for the delimiters, duh. No one's never going to type an ASCII ACK! *starts accepting non-ASCII content*
|
# ? Oct 12, 2016 14:53 |
|
why use ASCII ACK when there's the convenint ASCII record separator that nobody ever knows exists
|
# ? Oct 12, 2016 17:41 |
|
I wonder if this is what conversation was like at lunch the day csv was implemented.
|
# ? Oct 12, 2016 18:01 |
|
xzzy posted:I wonder if this is what conversation was like at lunch the day csv was implemented. Someone needs to make a series of one minute clips reenacting moments like that. "And that protocol's name was... TCP"
|
# ? Oct 12, 2016 18:28 |
|
Suspicious Dish posted:why use ASCII ACK when there's the convenint ASCII record separator that nobody ever knows exists I got a dump file from our data warehouse team the other day that used the ASCII unit separator between fields and was pleasantly surprised once I figured out what the undisplayable character was.
|
# ? Oct 12, 2016 20:13 |
|
I've seen this sort of thing a lot recently, in dusty old layers of legacy code : return a == b ? true : false;
|
# ? Oct 12, 2016 20:19 |
|
Stoatbringer posted:I've seen this sort of thing a lot recently, in dusty old layers of legacy code : ... what language? (though I guess it doesn't really matter)
|
# ? Oct 12, 2016 20:50 |
|
Stoatbringer posted:I've seen this sort of thing a lot recently, in dusty old layers of legacy code : I'm guessing C89 with poorly defined true & false.
|
# ? Oct 12, 2016 21:00 |
|
Dr Monkeysee posted:I got a dump file from our data warehouse team the other day that used the ASCII unit separator between fields and was pleasantly surprised once I figured out what the undisplayable character was. Even better there are several layers above it so you've got record, group and file separators giving multiple levels. It's really weird that the original committee felt that these separators were worth 3% of the code space but everybody ends up developing a new way to express the same thing. And if for some reason you've got to handle data with those characters, there's the Data Link Escape character which is specifically for declaring that the next character should be passed through as raw data even if it is a control character. edit: It'd be an amusing Goon Project to get those characters in wider use.
|
# ? Oct 12, 2016 21:00 |
|
Reuters has used ASCII delimiters up until this decade and finally moved over to binary, primary competition was XDR which is a standard binary encoding for RPC.
|
# ? Oct 12, 2016 21:36 |
|
Yeah, IPTC 7901 also uses those along with SOH/STX. http://www.iptc.org/std/IPTC7901/1.0/specification/7901V5.pdf
|
# ? Oct 12, 2016 21:52 |
|
hobbesmaster posted:You assume it's a raw pointer and -> isn't overloaded as well. If it works though that moves the horror to whoever defined the behavior of those operators. This is C, so no overloading. I don't think this piece of code has ever been executed, because the calling code, in the same file, checks for device validity ahead of the function call. Maybe some early testing caused a crash so the author added another check?
|
# ? Oct 13, 2016 03:14 |
|
Stoatbringer posted:I've seen this sort of thing a lot recently, in dusty old layers of legacy code : I still catch myself doing this once in a while. I've always caught it before code review, thankfully.
|
# ? Oct 13, 2016 03:42 |
|
TCL has a pattern that uses magic string arguments to imitate namespaces, ie string first, string cat, etc.
|
# ? Oct 13, 2016 04:05 |
|
jony neuemonic posted:I still catch myself doing this once in a while. I've always caught it before code review, thankfully. I'm fond of the rarer bool x = (y == z) ? y : z; which occurs occasionally in the code we took on when we acquired another company
|
# ? Oct 13, 2016 09:42 |
|
xzzy posted:I wonder if this is what conversation was like at lunch the day csv was implemented. No audio, but I think this a picture of that very moment. I should check, but the majority of the datasets we're dealing with are definitely not comma-separated. Part of it is because commas are the fraction symbol in our locale, the other is because cfr. screenshot. Beef fucked around with this message at 16:51 on Oct 13, 2016 |
# ? Oct 13, 2016 09:48 |
|
Hammerite posted:I'm fond of the rarer This can be different from just returning one of y, z though.
|
# ? Oct 13, 2016 11:09 |
|
It's the same as just using z. Barring operator overloading shenanigans.
|
# ? Oct 13, 2016 11:17 |
|
leper khan posted:This can be different from just returning one of y, z though. I am aware that this is true in principle, yes, but you should not design your classes in that way so if you write that code you are definitely doing something wrong one way or another
|
# ? Oct 13, 2016 12:24 |
|
Uh how can that be different from just returning one or the other when x is a boolean which implies y and z are boolean? There's no way you're overloading the assignment operator on some class to sometimes return boolean when the object is secretly a struct. Unless you're talking about some language where the ternary expression doesn't have precedence or something. But even in that case that would be the equivalent of if x = blah blah, do y, otherwise, do z. Which changes the entire argument. Coffee Mugshot fucked around with this message at 13:51 on Oct 13, 2016 |
# ? Oct 13, 2016 13:48 |
|
Coffee Mugshot posted:Uh how can that be different from just returning one or the other when x is a boolean which implies y and z are boolean? There's no way you're overloading the assignment operator on some class to sometimes return boolean when the object is secretly a struct. Yeah, I made a mistake, just pretend I began the statement with "var" instead of "bool".
|
# ? Oct 13, 2016 14:20 |
|
Vim Perils: *Wants to undo some changes, hits 'u' to undo* "Huh, why didn't it undo" *Hit 'u' again, nothing happens* *Hit 'u' several more times* "Oh! I'm hitting '7', not 'u'! Silly me!" *Actually hits 'u' this time, entire document reverts to what it was when i first opened Visual Studio*
|
# ? Oct 13, 2016 15:04 |
|
Begrudgingly doing some Web programming and just found out the fastest) recommended way to clone an object in JavaScript is to turn it to json and back
|
# ? Oct 13, 2016 16:08 |
|
All command line text editors are stupid and bad.
|
# ? Oct 13, 2016 16:17 |
|
xtal posted:Begrudgingly doing some Web programming and just found out the fastest) recommended way to clone an object in JavaScript is to turn it to json and back Have you considered Object.assign()?
|
# ? Oct 13, 2016 16:20 |
|
xtal posted:Begrudgingly doing some Web programming and just found out the fastest) recommended way to clone an object in JavaScript is to turn it to json and back Probably , but there're caveats of this approach: code:
|
# ? Oct 13, 2016 16:31 |
|
It's only a shallow clone and I'm unsure of its compatibility
|
# ? Oct 13, 2016 16:46 |
|
xtal posted:It's only a shallow clone and I'm unsure of its compatibility Compatibility isn't really a problem, except for IE 11, but for deep copies then welp.
|
# ? Oct 13, 2016 16:48 |
|
Suspicious Dish posted:why use ASCII ACK when there's the convenint ASCII record separator that nobody ever knows exists There's even two so you can implement stringly-typed mappings!
|
# ? Oct 13, 2016 16:50 |
|
fleshweasel posted:All command line text editors are stupid and bad. You can have vim keybindings without using a command line editor.
|
# ? Oct 13, 2016 16:51 |
|
xtal posted:Begrudgingly doing some Web programming and just found out the fastest) recommended way to clone an object in JavaScript is to turn it to json and back How do you deal with circular references?
|
# ? Oct 13, 2016 16:53 |
|
LOOK I AM A TURTLE posted:How do you deal with circular references? Whimper softly.
|
# ? Oct 13, 2016 18:45 |
|
LOOK I AM A TURTLE posted:How do you deal with circular references? Burn the code, pillage the spec, replace everything with a pong clone that bounces the balls at the wrong angle.
|
# ? Oct 13, 2016 18:52 |
|
Klades posted:You can have vim keybindings without using a command line editor. Which raises the question: Why?
|
# ? Oct 13, 2016 18:57 |
|
hobbesmaster posted:Which raises the question: Why? some people are sadly exposed to vim key bindings at an impressionable age, and the resultant brain damage cripples their ability to learn and work with proper emacs keybindings
|
# ? Oct 13, 2016 19:00 |
|
I'd rather damage my brains than my fingers: this thread has proven many times over you only need the latter to have a successful career in software.
|
# ? Oct 13, 2016 19:09 |
|
Soricidus posted:some people are sadly exposed to vim key bindings at an impressionable age, and the resultant brain damage cripples their ability to learn and work with proper emacs keybindings Modeless heathen! hobbesmaster posted:Which raises the question: Why? Some people prefer the tools provided by vim, even if they're using an interface that allows a mouse. If I need to delete a line, I just press "dd" and it's gone. Erase a word? Navigate to it, cw, type, esc. There's a definite learning curve, so it's understandable if a person doesn't care to learn it, but I like it.
|
# ? Oct 13, 2016 19:10 |
|
|
# ? May 30, 2024 08:41 |
|
hobbesmaster posted:Which raises the question: Why? It seems pretty inconsequential, but I find the reaching for the mouse and clicking around to things I'm trying to find can interrupt my train of thought. With a decent IDE/editor and vim bindings, I can navigate through an entire codebase without taking my fingers off the keyboard. A few years back I put some effort into being more proficient with vim and learning all the navigation keyboard commands built into Visual Studio, and once that became automatic I felt much more productive. However, this has the side effect of making me significantly less productive on someone else's machine without vim bindings or with a different keyboard shortcut setup. I also have the honor of being the fastest code editor in the office, which has vastly improved my love life.
|
# ? Oct 13, 2016 19:49 |