|
chippy posted:I just found this line of C# to check that two ints (noDetails, noPictures) are equal. it took me a second to even parse it's purpose. I know I'm a little late and this is C#. I'm not a rust genius, but wouldn't the equivalent in rust compile to a simple comparison? (I've been reading the rust book so it is on my mind) Seems like it is one step away from being generic for any size collection. e: pre-emptive "this isn't clearer and isn't better code than the standard aaa == bbb for this case, just musing" taqueso fucked around with this message at 15:31 on Mar 8, 2018 |
# ? Mar 8, 2018 15:21 |
|
|
# ? May 25, 2024 09:27 |
|
Bruegels Fuckbooks posted:isn't that present tense? i mean, facebook did move from "Move fast and break things" to "Move Fast With Stable Infra," and google has progressed to actually supporting products for longer than a year before the programmers get bored, but job postings are still slobbering all over the agile bullshit, and the visionaries at my company decided to take the SAFe agile poo poo seriously so within the past two weeks, my inbox has been clogged with diagrams that look like: It is definitely present tense. And I don't think agile is to blame so much as misapplication of it.
|
# ? Mar 8, 2018 15:24 |
|
a hot gujju bhabhi posted:It is definitely present tense. And I don't think agile is to blame so much as misapplication of it. You know what to call a tool that nobody can figure out how to use correctly? A lovely tool.
|
# ? Mar 8, 2018 16:11 |
|
You know what you call a person who buys a pre-filled toolbox, dumps everything out onto the ground, puts a blindfold on, and starts swinging the tools around randomly? A manager.
|
# ? Mar 8, 2018 16:16 |
|
Steve French posted:You know what to call a tool that nobody can figure out how to use correctly? While I generally agree with this sentiment, in this case I think what happened is a bunch of marketers and consultants turned agile into Agile™ in order to cash in on the hype. Of course that means it has to be as complicated as possible because otherwise you wouldn't need to pay consultants to tell you how to figure it out
|
# ? Mar 8, 2018 16:34 |
|
Bruegels Fuckbooks posted:isn't that present tense? i mean, facebook did move from "Move fast and break things" to "Move Fast With Stable Infra," and google has progressed to actually supporting products for longer than a year before the programmers get bored, but job postings are still slobbering all over the agile bullshit, and the visionaries at my company decided to take the SAFe agile poo poo seriously so within the past two weeks, my inbox has been clogged with diagrams that look like: I'm an enabler
|
# ? Mar 8, 2018 17:06 |
|
taqueso posted:I know I'm a little late and this is C#. I'm not a rust genius, but wouldn't the equivalent in rust compile to a simple comparison? (I've been reading the rust book so it is on my mind) My attempt (I don't actually know Rust): https://godbolt.org/g/uXWQLx The generated assembly definitely isn't a simple comparison, but maybe you're thinking of a different implementation that does get optimized? C# definitely doesn't optimize it, of course: https://dotnetfiddle.net/QHsGcv code:
|
# ? Mar 8, 2018 17:07 |
|
taqueso posted:I know I'm a little late and this is C#. I'm not a rust genius, but wouldn't the equivalent in rust compile to a simple comparison? (I've been reading the rust book so it is on my mind) I don't know Rust, or enough about any compiler to know if any of them would optimise this away to a single comparison. And yeah, you're right, it's not a bad way to do it for a variable-sized collection really. It also looks quite a lot like something I would write if I was dealing with a variable number of ints*, and not something something the dev in question would write; he would almost definitely use a loop. So I can only conclude he actually lifted the pattern from some of my code, but why he went to the trouble of doing that instead of just writing isEqual = noDetails == noPictures is beyond me. *e: Actually, I'd probably be more likely to do something like code:
chippy fucked around with this message at 17:17 on Mar 8, 2018 |
# ? Mar 8, 2018 17:08 |
|
HappyHippo posted:While I generally agree with this sentiment, in this case I think what happened is a bunch of marketers and consultants turned agile into Agile™ in order to cash in on the hype. Of course that means it has to be as complicated as possible because otherwise you wouldn't need to pay consultants to tell you how to figure it out Oh yes, this most definitely happened as well. And not just complicated, but also rigidly defined (again, why else would you be paying someone to tell you how to do poo poo?), also as far as I can tell running entirely counter to the ostensible core principles of agile.
|
# ? Mar 8, 2018 17:15 |
|
I work on an embedded system. It has a lot of... "fun" issues that I could talk about, but for now here's a thing I hit yesterday. The system is in three parts: There's the main part, which is basically the manager and is mostly facilitating communication between the other parts, the outside world, and the OS. Then there's the part doing most of the heavy lifting, which is off on its own CPU. Then there's the GUI, which is on the same CPU as the manager. These all use TCP to communicate One of the things the (horrible and terrible and poo poo) GUI lets you do is set the time. Yesterday it was noted that doing so would, depending on your machine, either not work or crash the GUI. This was pretty strange, so I looked into it. 1) The GUI figured out what year you'd indicated (from the scrolling list of years) by doing a string->int parse on the current selection. But the list of years only goes back to 2017, so if your device was set to an earlier date for some reason (like the default, 1970), it would fail to put the dial on a valid date to start with, which would for some reason also prevent it from changing when you scrolled it, and an attempt to get the current selection would return null and this is QML, which means javascript, which means quiet failure at runtime. This is why on some machines setting the date in the GUI simply wouldn't work. 2) In all cases where one component needs to send a message and get a response, there's a timeout period of 5 seconds after which it is assumed that the other component has had an issue and the communication is aborted. I realized that sometimes this timeout was happening instantly when changing the date. I wonder what the code handling this looks like... code:
|
# ? Mar 8, 2018 17:30 |
|
Jabor posted:Also the name is literally a racial slur. I thought it was ableist Also since nobody mentioned the thing where their code was written to randomly discard 90% of log messages about a particular error because it happened too often I'm gonna bring it up because lmao https://stackoverflow.com/questions/16833100/why-does-the-mongodb-java-driver-use-a-random-number-generator-in-a-conditional
|
# ? Mar 8, 2018 17:32 |
|
So with Agile falling out of vogue, is it time to go back to Waterfall?
|
# ? Mar 8, 2018 17:37 |
|
Agile and Waterfall are not mutually exclusive. They aren't even the same kind of thing.
|
# ? Mar 8, 2018 18:12 |
|
chippy posted:*e: Actually, I'd probably be more likely to do something like No need to do that, if the list is empty .All() will immediately return true anyway
|
# ? Mar 8, 2018 18:29 |
|
chippy posted:I don't know Rust, or enough about any compiler to know if any of them would optimise this away to a single comparison. I'm at work right now, but I am super out of rust practice so this will be a fun exercise to try in a few hours. I'll see what I get with a few methods. I think the data will have to be in the form of a tuple or something else that has a fixed size instead of a vec to get the magic to happen. You get different machine code for each type, so it should generate an implementation for vectors of u32, vectors of u64, each size of tuple etc. (afaik ...) taqueso fucked around with this message at 18:46 on Mar 8, 2018 |
# ? Mar 8, 2018 18:42 |
|
NihilCredo posted:No need to do that, if the list is empty .All() will immediately return true anyway If you're attempting to mimic the behavior of Distinct().Count() == 1, then you'd want it to return false on an empty list. That aside, the First call should probably be brought out of the predicate, and if you want the code to be suited for any IEnumerable<int>, then it'd have to be written completely differently.
|
# ? Mar 8, 2018 18:42 |
|
QuarkJets posted:You only dislike the weak bosons because they have a mean decay time greater than your longest-held erection this is the most owned I have been since 50 CERN researchers published a paper on my "low energy physics"
|
# ? Mar 8, 2018 19:51 |
|
Jeb Bush 2012 posted:this is the most owned I have been since 50 CERN researchers published a paper on my "low energy physics" Oh hey I remember you, our arxiv post suggested that your manhood represented a breakthrough discovery because even in an excited state it has less energy than the vacuum ground state lol. Tell your mom that the ATLAS liquid argon calorimetry group says hi (BTW argon is odorless, unlike your breath)
|
# ? Mar 8, 2018 20:55 |
|
This is all wonderful, terrifying and soul-crushing.
|
# ? Mar 8, 2018 21:40 |
|
Steve French posted:You know what to call a tool that nobody can figure out how to use correctly? I didn't say nobody could figure it out, I said that some people were using it poorly or incorrectly. Anyway, I finally have a coding horror to share. The place I work at unfortunately had a team of very incompetent developers who would do all kinds of crazy poo poo, and I've been meaning to find a tidy snippet without too much business specific stuff in it so I could post it here: code:
|
# ? Mar 8, 2018 22:51 |
taqueso posted:I know I'm a little late and this is C#. I'm not a rust genius, but wouldn't the equivalent in rust compile to a simple comparison? (I've been reading the rust book so it is on my mind) Just tested it out, and the answer is yes! Both for iterator-style and imperative style. Input: Rust code:
code:
|
|
# ? Mar 8, 2018 23:06 |
VikingofRock posted:Just tested it out, and the answer is yes! Both for iterator-style and imperative style. That's wild. I would be interested to hear about the compiler magic behind that.
|
|
# ? Mar 8, 2018 23:22 |
|
Doom Mathematic posted:Agile and Waterfall are not mutually exclusive. They aren't even the same kind of thing. explain
|
# ? Mar 9, 2018 00:10 |
|
QuarkJets posted:Oh hey I remember you, our arxiv post suggested that your manhood represented a breakthrough discovery because even in an excited state it has less energy than the vacuum ground state lol. Tell your mom that the ATLAS liquid argon calorimetry group says hi I was working late in the department one night when who should step out from behind the vending machine but QuarkJets. "I heard they detected gravitational waves," he began as I mentally steeled myself. "Shoulda just pointed they detectors at you getting out of bed in the morning." I gritted my teeth as he continued, "Only thing that moves faster than the speed of light is the female grad students leaving any party you show your face at". I hurried back to my office and sat at my machine to work on my simulation, but QuarkJets's face appeared on the monitor. He continued, "And yo particle accelerator look like a dishwasher" and I was like drat
|
# ? Mar 9, 2018 01:03 |
|
Rust code:
|
# ? Mar 9, 2018 02:28 |
|
Eela6 posted:That's wild. I would be interested to hear about the compiler magic behind that. IIRC, it's called loop or stream fusion and largely something LLVM does to the IR Rust generates. Rust's immutability guarantees help a lot (GHC does something similar). I think it's still really, really easy to accidentally break it if you use iterators in slightly the wrong way, though (like putting external closures in filter or fold functions for instance). E: The idea behind fusion is if you have something like code:
code:
taqueso posted:
Keep in mind that it may be optimizing the function out entirely if it or LLVM decide that everything evaluates to true/false because you're using obvious constants. It's why the black_box function exists for benchmarks, to prevent the compiler from throwing away function calls that obviously evaluate to something at compile time. Linear Zoetrope fucked around with this message at 03:06 on Mar 9, 2018 |
# ? Mar 9, 2018 02:49 |
|
C++ code:
Now the true horror. Why did I even think to do this? Embedded development! Spatial fucked around with this message at 03:19 on Mar 9, 2018 |
# ? Mar 9, 2018 03:11 |
|
Spatial posted:
The USB library, the you-horror version is C++ code:
|
# ? Mar 9, 2018 03:27 |
|
a hot gujju bhabhi posted:I didn't say nobody could figure it out, I said that some people were using it poorly or incorrectly. Yeah, I know you weren't saying that, and I didn't mean to imply that you were, though now I see that I did. What I was alluding to is that agile horror stories are incredibly common, and almost always someone responds to them with a suggestion or claim that they weren't doing it right. Well, yeah. The indication to me here when that's so common is that it's a failure of the tool, not just a failure of those misusing it. There have been lots of discussions about Git here, and the sharp edges it has, and inevitably someone responds with a comment about how it's really not that hard and something about directed graphs. Personally, I don't have issues with it, but I totally get the perspective that when those issues are so common, there's a tool problem, even though I have seen it used very well. I think of agile in the same way
|
# ? Mar 9, 2018 04:16 |
|
Steve French posted:Yeah, I know you weren't saying that, and I didn't mean to imply that you were, though now I see that I did. Fair enough, although thinking of agile as a tool is part of the problem I think. It's really more of a guideline for good practices, or at least it should be used that way. When it's used as a mantra that's when poo poo starts to fall apart. So yeah, it is flawed in that if you try to follow it 100% to the letter, you'll get burned, but I don't think that's how it was ever supposed to be used. I've always seen it as "here's a bunch of ways that you can improve your software development lifecycle, take or leave whichever ones are appropriate for your business". That being said, I admit this is just my reading of it and maybe it is meant to be more stringently applied, in which case, yeah it's not a good thing.
|
# ? Mar 9, 2018 04:29 |
taqueso posted:
If you want to re-implement / play around with what I did, here's my Cargo.toml: code:
|
|
# ? Mar 9, 2018 05:06 |
|
Rust Playground allows you to import the most popular crates (which includes itertools) so you can easily peek at the disassembly on there https://play.rust-lang.org/?gist=95ac417519ad84d133ac7982bc496059&version=stable
|
# ? Mar 9, 2018 16:13 |
|
Doom Mathematic posted:Agile and Waterfall are not mutually exclusive. They aren't even the same kind of thing. Please explain how they're A. not mutually exclusive, and B. not even the same kind of thing.
|
# ? Mar 9, 2018 18:54 |
|
iospace posted:Please explain how they're A. not mutually exclusive, and B. not even the same kind of thing. You can apply waterfall within a sprint don't you?
|
# ? Mar 9, 2018 19:05 |
|
It's been a long time since I looked at the formal definitions of either agile or waterfall, so I'm working off of what I understand them to be rather than what they supposedly actually are. But hey, that's probably what 90% of everyone is doing. So as I understand it, waterfall is basically gather requirements -> create specs -> create design -> implement design, for the entire product all in one fell swoop. Agile is gather minimum requirements -> create specs -> create design -> implement design -> show to clients -> gather new requirements -> specs -> design -> implement, iterate until you run out of money or get bought out. Like, there's a lot of fluff about user stories, but the core of Agile (again, as I understand it) is that you build a minimum viable product, and then keep looping in the customer so they can see the product as it develops and make certain that what you're building actually solves their needs. The actual process of creating the product uses the same style as waterfall, because you'd be completely insane to try to implement something that doesn't have a well-defined specification and scope. You just do a bunch of small waterfalls instead of one big one.
|
# ? Mar 9, 2018 19:15 |
|
Neither "agile" nor "waterfall" has a consistent universal definition. They're vague and contextual terms.
|
# ? Mar 9, 2018 20:44 |
repiv posted:Rust Playground allows you to import the most popular crates (which includes itertools) so you can easily peek at the disassembly on there I couldn't figure out how to turn on LTO there, which is necessary to get itertools iterators to compile away.
|
|
# ? Mar 9, 2018 20:58 |
|
VikingofRock posted:I couldn't figure out how to turn on LTO there, which is necessary to get itertools iterators to compile away. True, I don't think it's possible to enable LTO on the playground. Nightly Rust somehow manages to compile the iterators away without LTO though
|
# ? Mar 9, 2018 21:06 |
|
repiv posted:Rust Playground allows you to import the most popular crates (which includes itertools) so you can easily peek at the disassembly on there Thanks! Rust code:
code:
taqueso fucked around with this message at 22:06 on Mar 9, 2018 |
# ? Mar 9, 2018 21:08 |
|
|
# ? May 25, 2024 09:27 |
taqueso posted:Thanks! Neat! It's cool to see that the Rust compiler can be so aggressive in all these cases, and to see the comparison with the case where it can't be aggressive because it doesn't know the length.
|
|
# ? Mar 9, 2018 21:37 |