|
Soricidus posted:reminder that the primary design consideration for c++ iterators was “how do we make these look and behave like pointer arithmetic” Almost everything I would do with iterators, I do instead with either Foldable/Traversable or pattern matching. It really is a more elegant system.
|
# ? Jan 12, 2018 22:37 |
|
|
# ? May 25, 2024 02:46 |
|
If you ever have to document an iterator, replace one instance of the word with "irritator."
|
# ? Jan 13, 2018 00:10 |
|
vOv posted:Using iterators is cool and good but I really really wish they were simpler to implement and that there was some kind of 'range' type instead of passing begin/end pairs everywhere. I think I mentioned this before, but ranges have been proposed for inclusion into a future standard.
|
# ? Jan 13, 2018 03:13 |
|
The inclusion of range in the standard is waiting for the inclusion of concepts, which has officially been Real Soon Now for over ten years. But it looks like they might finally get into C++20, so who knows.
|
# ? Jan 13, 2018 22:24 |
|
I lust for C++ death.
|
# ? Jan 13, 2018 22:47 |
|
Shinku ABOOKEN posted:I lust for C++ death. std::death is due for consideration in C++22
|
# ? Jan 13, 2018 22:55 |
|
I’m std::launder
|
# ? Jan 13, 2018 23:50 |
|
pokeyman posted:I’m std::launder sorry about your inscrutability and lack of real-world use cases
|
# ? Jan 14, 2018 06:59 |
pokeyman posted:I’m std::launder I just looked this up, and this has strengthened my resolve to never, ever use placement new or reinterpret cast.
|
|
# ? Jan 15, 2018 02:07 |
|
The Phlegmatist posted:sorry about your inscrutability and lack of real-world use cases Me too bud, me too.
|
# ? Jan 15, 2018 05:29 |
|
From a Twitter thread Android had a wtf log level: https://developer.android.com/reference/android/util/Log.html#wtf posted:wtf(String tag, String msg,Throwable tr)
|
# ? Jan 15, 2018 05:50 |
|
It can also tell if you're a goat
|
# ? Jan 15, 2018 14:11 |
|
baka kaba posted:It can also tell if you're a goat Or a monkey, for that matter
|
# ? Jan 15, 2018 14:49 |
|
boo_radley posted:From a Twitter thread Hmm, I think the anti-Android sass here is "So it's called every time the user turns the screen on or just on each boot? " Also, what do you mean 'had'? That looks current and not marked obsolete or anything like that.
|
# ? Jan 15, 2018 16:27 |
|
Is the monkey on the Death Star? the actual horror is there are gravity constants for real planets too, implying Android Auto for moon buggies is in our future
|
# ? Jan 15, 2018 16:33 |
|
given that star wars regularly gives no fucks wrt. physics and all spacecraft in the star wars universe apparently have artificial gravity, on what basis would one estimate the force of gravity on the death star?
|
# ? Jan 15, 2018 18:07 |
|
boo_radley posted:From a Twitter thread E: corrected tense
|
# ? Jan 15, 2018 18:25 |
|
Internet Janitor posted:given that star wars regularly gives no fucks wrt. physics and all spacecraft in the star wars universe apparently have artificial gravity, on what basis would one estimate the force of gravity on the death star? I'd say that someone did the math using whatever data (material density, size and whatnot) they could, but I'm sure there's a canon source that spells out the surface gravity.
|
# ? Jan 15, 2018 18:26 |
|
Surface gravity on the Death Star isn't even perpendicular to the surface half the time.
|
# ? Jan 15, 2018 20:08 |
|
Doom Mathematic posted:Surface gravity on the Death Star isn't even perpendicular to the surface half the time. You're confusing the intrinsic surface gravity with the gravitomotronic fields invented by biggs darklighter's great great great granduncle in 399393 bby to defeat the sith lord darth unpleasant. I'm 90% sure thats the real star wars explanation for that.
|
# ? Jan 15, 2018 22:54 |
|
Internet Janitor posted:given that star wars regularly gives no fucks wrt. physics and all spacecraft in the star wars universe apparently have artificial gravity, on what basis would one estimate the force of gravity on the death star? I'm guessing theres a reason it says unspecified imperial rather than SI units.
|
# ? Jan 15, 2018 23:03 |
|
Can (a ==1 && a== 2 && a==3) ever evaluate to true? is a fun thought experiment.
|
# ? Jan 16, 2018 20:39 |
|
canis minor posted:Can (a ==1 && a== 2 && a==3) ever evaluate to true? is a fun thought experiment. code:
|
# ? Jan 16, 2018 21:38 |
|
at least go all out with itcode:
|
# ? Jan 16, 2018 21:47 |
|
isn't the simplest (in that it doesn't require malicious operator overloading or the like) answer "there's another thread that can also mutate a"?
|
# ? Jan 16, 2018 21:49 |
Winter Stormer posted:
This was my first thought as well, but the question specifies "in JavaScript" (which doesn't have operator overloading).
|
|
# ? Jan 16, 2018 21:50 |
The Phlegmatist posted:at least go all out with it It's like Wizards in Discworld. I want to hire a programmer whose job is knowing how to dynamically refrain from abusing operator overloading.
|
|
# ? Jan 16, 2018 21:52 |
|
VikingofRock posted:This was my first thought as well, but the question specifies "in JavaScript" (which doesn't have operator overloading). That's correct, though tbf after I've read through the SO, I've started thinking of how to do it in other languages. define made a visit in those thoughts as well. also - it's fun to see how JS allows such simple statement to be abused.
|
# ? Jan 16, 2018 21:53 |
|
Jeb Bush 2012 posted:isn't the simplest (in that it doesn't require malicious operator overloading or the like) answer "there's another thread that can also mutate a"? Not in JavaScript, no. VikingofRock posted:This was my first thought as well, but the question specifies "in JavaScript" (which doesn't have operator overloading). Yet. Doom Mathematic fucked around with this message at 22:08 on Jan 16, 2018 |
# ? Jan 16, 2018 22:06 |
|
The Phlegmatist posted:at least go all out with it It's actually easier in C#: C# code:
E: fixed typo. Nude fucked around with this message at 01:23 on Jan 17, 2018 |
# ? Jan 16, 2018 22:10 |
|
Everybody is missing the more important line in that SO question.quote:This is interview question asked by a major tech company. My answer was that it's impossible. They said nothing is impossible. It happened 2 weeks back Somebody in this company is, just to begin with, using non-strict equality. So, no linting is going on here. That's the first alarm bell. But on top of that, they either wrote a custom implementation of toString/valueOf which doesn't always return the same value OR they used a as a global variable with a non-deterministic getter which doesn't always return the same value OR they've exhumed the rancid corpse of with OR MAYBE WORSE. Not as a thought experiment! This happened for real! Back slowly away from this organization.
|
# ? Jan 16, 2018 22:18 |
|
Doom Mathematic posted:Everybody is missing the more important line in that SO question. I doubt it came about like that, they probably just thought it up as a way to suss out candidates who really think about what's going on under the hood of the code they're writing. I'm not claiming it's a good way to do that.
|
# ? Jan 16, 2018 22:22 |
|
I'm afraid to look Nude posted:I always kind of wondered why C# allowed properties in general instead of just explicit getters and setters functions honestly. Properties are a guarantee the compiler can rely on in an object's interface so the JIT can probably do more optimizations around property access than hand-rolled getter/setters and are a lot less annoying to use. Dunno if either of those is the reason, but both seem good.
|
# ? Jan 16, 2018 22:25 |
|
Doom Mathematic posted:Everybody is missing the more important line in that SO question. That turned grim pretty quickly. I'd rather hope this is to get a programmer that thinks everything is possible and can separate right from wrong (but you're probably right, as I assume the best in people) Munkeymon posted:I'm afraid to look Oh, you kind of can - for `+` (but that's not proper overloading, but rather casting (?)). I think operator overloading won't come soon to JS, if at all. Still people try to do it canis minor fucked around with this message at 22:43 on Jan 16, 2018 |
# ? Jan 16, 2018 22:29 |
|
Well, I wasn't in the interview, we only have the candidate's paraphrase for it, but "They said nothing is impossible. It happened 2 weeks back" says to me that it happened. But even if it was dreamt up as a thought experiment, the only way code like this can happen is if you disobey hard-earned years of best practice and deliberately shirk industry standard code quality tools. Nobody should ever need to know how == or with work anymore. These practices are, in large part, why programming in JavaScript is more tolerable now than it was in ages past. This says something about practices at this potential employer, about the kind of code they are responsible for, the level of nonsense that employees are going to have to put up with. Maybe somebody wrote a non-deterministic getter somewhere along the line, and this is a simplification of that problem intended to highlight the issue. Getters have legitimate use cases and I guess they can go wrong in that way if they become too complex. Still doesn't explain the double-equals thing though.
|
# ? Jan 16, 2018 22:29 |
|
Doom Mathematic posted:Well, I wasn't in the interview, we only have the candidate's paraphrase for it, but "They said nothing is impossible. It happened 2 weeks back" says to me that it happened. You're missing the full stop
|
# ? Jan 16, 2018 22:42 |
|
Nude posted:It's actually easier in C#: You can make it even easier than that if you're going to swap && for ||...
|
# ? Jan 16, 2018 23:58 |
|
Not a coding horror per se, but Sage sells two distinct pieces of software with the same name. We went to install our interface software on a client's machine and Whoops! this Sage 50 is not like the other Sage 50s. Why are there two? What benefit does having two Sage 50s with incompatible APIs provide? Obviously they know something we don't. At our next dev meeting, I'm going to propose splitting our main product into three incompatible versions that are assigned to new clients randomly.
|
# ? Jan 17, 2018 01:02 |
|
Hammerite posted:You can make it even easier than that if you're going to swap && for ||... My bad that was a typo my code works if you do &&.
|
# ? Jan 17, 2018 01:22 |
|
|
# ? May 25, 2024 02:46 |
|
Munkeymon posted:Properties are a guarantee the compiler can rely on in an object's interface so the JIT can probably do more optimizations around property access than hand-rolled getter/setters and are a lot less annoying to use. Dunno if either of those is the reason, but both seem good. I'm pretty sure they're just syntactic sugar for getters and setters. I don't think that the CLR has any special use for them.
|
# ? Jan 17, 2018 01:25 |