|
I'm going to give that joke a hard pants.
|
# ? Jul 9, 2017 19:44 |
|
|
# ? May 28, 2024 11:41 |
|
Internet Janitor posted:I don't own pants, but a friend lends me his whenever I need them. In turn I lend the pants I'm borrowing to others I know and trust. This thrifty reputation-based economy is an example of pants-by-reference. A) This can't just disappear with the last page. B) gently caress you.
|
# ? Jul 9, 2017 19:53 |
|
TooMuchAbstraction posted:You can fake a set in Go by using map[whatever]bool, so long as you only care about membership (and not intersection/unity/set equality/etc.). But note that I said the code was outputting a list of elements, that happened to be ordered based on the order in which the code iterated over a map. So basically our options were either a) sort the map keys, to enforce a consistent order in the output list, or b) write a comparison function that takes two input lists, sorts them (or converts them to maps, etc.), then iterates over both of them to ensure that every element in each is also in the other. You did say that you are returning a list of elements, but apparently in arbitrary order. Unless there may be duplicates, a set seems a likely candidate to use instead?
|
# ? Jul 9, 2017 22:42 |
|
MC Jaded Burnout posted:I'm going to give that joke a hard pants. Mmm, gotta go mustard on this one.
|
# ? Jul 10, 2017 01:00 |
|
This code made me laugh. I can't even copy and paste it, the entities get all messed up.
|
# ? Jul 10, 2017 03:12 |
|
Doc Hawkins posted:This code made me laugh. Racket is a trip.
|
# ? Jul 10, 2017 03:28 |
|
Steve French posted:You did say that you are returning a list of elements, but apparently in arbitrary order. Unless there may be duplicates, a set seems a likely candidate to use instead? It would be! And if Go had a builtin set, we would use it. As has been thoroughly covered by now, Go does not have such a data structure. And we are not (yet) at the point of using code generators to produce all the different set types we might need.
|
# ? Jul 10, 2017 05:01 |
|
The other month I got a PR from an 'experienced contractor' along the lines ofcode:
Despite telling the 'tech lead' multiple times about his incompetence it took a month to get him fired. The kicker: his task was to change the value fed in from a CSV file that populated some initial data. He did change the CSV but by a factor of 0.5 instead of 0.25. Hence the for-loop shittery. Which in turn broke functionality. no idea how the guy survives. [Edit] The entire project is a coding horror of: what happens when you ask a consultancy (that wants to be a vendor in the same industry as you instead) 'make me an app' with no stipulations, no review, and only let junior developers write code with no senior oversight. you subsidise the development of their product, and then they stop developing yours when they get bored. Such gems as: Supplier wrote their own open-source build tool because the world needs another bazel clone. Supplier subsequently overrode *their* build tools build definitions in the project for reasons I'm yet to determine. Horse Clocks fucked around with this message at 08:00 on Jul 10, 2017 |
# ? Jul 10, 2017 07:45 |
|
Horse Clocks posted:no idea how the guy survives. It's "unprofessional" to be public about a lovely employee or employer, so everyone "quits" for BS reasons and the cycle continues.
|
# ? Jul 10, 2017 08:01 |
|
Horse Clocks posted:what happens when you ask a consultancy (that wants to be a vendor in the same industry as you instead) 'make me an app' with no stipulations, no review, and only let junior developers write code with no senior oversight. Oh hey it's the Facebook origin story.
|
# ? Jul 10, 2017 10:54 |
|
b0lt posted:That isn't even the worst part about D. Their equivalent of boost declared an intifada: Haha holy poo poo. Too bad - it seemed like a pretty nice language when I last checked it out.
|
# ? Jul 10, 2017 15:39 |
|
B-Nasty posted:After all I don't put one leg through my underwear, then in one pant leg, then one sock, then that side's shoe. Me either, until now. Now that's going to be the only way I ever get dressed.
|
# ? Jul 11, 2017 01:12 |
|
Good news folks, pad-left has been obsoleted by ES8!
|
# ? Jul 11, 2017 05:36 |
|
Wait, there's left-pad and pad-left? gently caress off
|
# ? Jul 11, 2017 07:46 |
|
Meat Beat Agent posted:Wait, there's left-pad and pad-left? gently caress off Javascript is taking a page from Ruby's book by having eight different ways to do something all with subtle quirks. Except in this case it's micro-libraries instead of language features.
|
# ? Jul 11, 2017 08:17 |
|
UraniumAnchor posted:Javascript is taking a page from Ruby's book by having eight different ways to do something all with subtle quirks. What do you expect from a language based on Perl
|
# ? Jul 11, 2017 09:59 |
|
Meat Beat Agent posted:Wait, there's left-pad and pad-left? gently caress off pad-left is a whole 1% faster than left-pad!! The gains will be immense!
|
# ? Jul 11, 2017 15:37 |
|
necrotic posted:pad-left is a whole 1% faster than left-pad!! The gains will be immense! Sadly, I would absolutely be willing to believe this to be true.
|
# ? Jul 11, 2017 15:48 |
|
TooMuchAbstraction posted:Sadly, I would absolutely be willing to believe this to be true. pad-left has a benchmark section vs left-pad in the pad-left NPM page.
|
# ? Jul 11, 2017 15:52 |
|
HardDiskD posted:pad-left has a benchmark section vs left-pad in the pad-left NPM page. I like the special case for numeric 0.
|
# ? Jul 11, 2017 15:55 |
|
TooMuchAbstraction posted:Sadly, I would absolutely be willing to believe this to be true. Yeah, its the main selling point of pad-left. All over their readme. as well as links to like 20 other projects of a similar style, such as pad-left-keys!
|
# ? Jul 11, 2017 15:56 |
|
necrotic posted:Yeah, its the main selling point of pad-left. All over their readme. "Man this fellow sure has an impressive resume!" - the HR guy at your dream corporation
|
# ? Jul 11, 2017 16:02 |
|
necrotic posted:Yeah, its the main selling point of pad-left. All over their readme. I wasn't arguing that they aren't 1% faster, just saying that I could absolutely believe that having a 1% faster implementation of "insert some spaces on the left side of this text" results in big performance gains for at least some sites.
|
# ? Jul 11, 2017 17:09 |
|
Ah, I thought you were commenting on the fact that it was a main selling point, not the "immense gains". Yeah if some thing has to do a shitload of left padding you'd see some worthwhile gains, but that's a pretty narrow target. I just love how proud they are of a 1% gain.
|
# ? Jul 11, 2017 17:57 |
|
And we can now all translate our PHP codebases to JS so we can harness these wonderful new features using babel-preset-php. Truly a wonderful time to be alive.
|
# ? Jul 11, 2017 17:57 |
|
The "1%" in those benchmarks is the margin of error, not the difference. Not that it's, you know, that important, ideally.
|
# ? Jul 11, 2017 18:06 |
|
Meat Beat Agent posted:The "1%" in those benchmarks is the margin of error, not the difference. oh yeah i read that totally wrong.
|
# ? Jul 11, 2017 18:28 |
|
Master_Odin posted:And we can now all translate our PHP codebases to JS so we can harness these wonderful new features using babel-preset-php. Truly a wonderful time to be alive. While it's a horror on its own I like the word transpiler https://github.com/fabiosantoscode/js2cpp - JS to C++ using CoffeeScript
|
# ? Jul 11, 2017 18:39 |
|
canis minor posted:While it's a horror on its own I like the word transpiler What happens if you point this and emscripten at each other? Do they eventually converge to a transpilation-stable implementation, or do you get infinitely nested emscripten memory arrays?
|
# ? Jul 11, 2017 18:49 |
|
NihilCredo posted:What happens if you point this and emscripten at each other? Do they eventually converge to a transpilation-stable implementation, or do you get infinitely nested emscripten memory arrays? Translation party, but with programming languages. What a wonderful idea (I'd place my bets on the second though) Also - https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js
|
# ? Jul 11, 2017 19:10 |
|
code:
|
# ? Jul 11, 2017 19:37 |
|
Holy poo poo. That's bad.
|
# ? Jul 11, 2017 19:42 |
|
I like the return inside of the foreach.
|
# ? Jul 11, 2017 20:07 |
|
HardDiskD posted:I like the return inside of the foreach. I was gonna say "what's wrong with that?" Then I realized it's outside of the if. (Initially I didn't notice it was returning a list) So yeah, that code returns the first item if it matches, otherwise it returns an empty list.
|
# ? Jul 11, 2017 20:10 |
|
Snak posted:I was gonna say "what's wrong with that?" The best part is that a Dictionary can only ever have one entry for a given Key, so this logic would only ever return a single item anyway, defeating the purpose of having a List. Edit: The guy's title is Software Engineer III
|
# ? Jul 11, 2017 20:15 |
|
It's like every single part of that code is wrong. The method shouldn't even exist unless to implement error handling.
|
# ? Jul 11, 2017 20:17 |
|
I thought it was bad form to post student code?
|
# ? Jul 11, 2017 20:33 |
|
That code should be an exam question. "Rewrite this code to fix all errors."
|
# ? Jul 11, 2017 20:44 |
|
Internet Janitor posted:Good news folks, pad-left has been obsoleted by ES8! Thankfully, the ES8 implementation actually truncates the output to the correct length instead of, like pad-left and left-pad, just blindly assuming that the filler string has length 1, and returning garbage if it doesn't.
|
# ? Jul 11, 2017 21:21 |
|
|
# ? May 28, 2024 11:41 |
|
boo_radley posted:This seems like a bonkers thing to do. It's always been my assumption that in hashes, the ordering and storage of elements in part of the black box and subject to the whims of designers, compilers and etc. etc. etc. all the time.
|
# ? Jul 11, 2017 22:48 |