|
Symbolic Butt posted:the1percent/the99percent
|
# ? Sep 13, 2018 17:13 |
|
|
# ? Dec 7, 2024 05:58 |
gru/minion
|
|
# ? Sep 13, 2018 17:31 |
|
VikingofRock posted:gru/minion
|
# ? Sep 13, 2018 18:24 |
|
ctps:code:
|
# ? Sep 13, 2018 19:31 |
|
gonadic io posted:ctps:
|
# ? Sep 13, 2018 19:34 |
before posting that you oughta warn us to brace ourselves!
|
|
# ? Sep 13, 2018 20:00 |
|
VikingofRock posted:before posting that you oughta warn us to brace ourselves! i'm just loving around writing a scrabble thing but got caught in a bunch of nested loops: https://github.com/djmcgill/Rubble/blob/master/src/main.rs i might legit try something like https://github.com/TeXitoi/rust-mdo to let me nest loops without increasing indentation which i could do with a bunch of and_then idk
|
# ? Sep 13, 2018 20:18 |
gonadic io posted:
I think that's a bit overkill here. I got rid of four levels of indentation by replacing your match statements with if lets. It even fits within 80 columns now! IMO this sort of strategy is the way to go when only one match arm can logically continue the function. As for the rest of the indentation, most of it comes from nested for loops. A lot of times those can be logically separated out into an iterator, which can then be chained together in all the usual ways. For example here you could imagine making an ConnectedTiles iterator that returns all tiles connected to a given start tile and then in all_tiles_connected() just return whether your total tile count is the same as connected_tiles(arbitrary_tile).count(), or for the inner loop you could make a Neighbors iterator which gives the neighbors of a given tile. VikingofRock fucked around with this message at 21:49 on Sep 13, 2018 |
|
# ? Sep 13, 2018 21:37 |
|
i think using let match would look a bit nicer than if let:code:
code:
|
# ? Sep 13, 2018 21:46 |
Lime posted:i think using let match would look a bit nicer than if let: I don't know how I forgot that. Yeah your way is much better.
|
|
# ? Sep 13, 2018 21:50 |
|
in my opinion the all_tiles_connected method is just begging to be broken into at least 3 methods there
|
# ? Sep 13, 2018 21:53 |
|
ty for the suggestions. the lack of early return from a mapping closure bothers me way more than i thought it would. maybe generators solves this?
|
# ? Sep 13, 2018 21:54 |
gonadic io posted:ty for the suggestions. the lack of early return from a mapping closure bothers me way more than i thought it would. maybe generators solves this? I recently ran into a way to get around this. The idea is you use filter_map() to end iteration early and then check a sentinel value. code:
You could pretty easily extend this to returning things besides Option or Result. Whether this is a clever trick or a dirty hack is left as an exercise to the reader.
|
|
# ? Sep 13, 2018 22:50 |
|
FB's PHP compiler to end support for PHP: https://hhvm.com/blog/2018/09/12/end-of-php-support-future-of-hack.html
|
# ? Sep 14, 2018 00:10 |
|
VikingofRock posted:I recently ran into a way to get around this. The idea is you use filter_map() to end iteration early and then check a sentinel value. lol nice 1) use the failure crate for all projects imo 2) there is an either crate too but you might have to duplicate the machinery and they're the same thing anyway so why bother gonadic io fucked around with this message at 01:15 on Sep 14, 2018 |
# ? Sep 14, 2018 00:43 |
|
you cna have short-circuiting iterators with generators - playground e: although if you're writing a custom looping function I guess you can just do the same thing with options but with None and Some instead of Yield and Return code:
gonadic io fucked around with this message at 01:26 on Sep 14, 2018 |
# ? Sep 14, 2018 01:15 |
|
prisoner of waffles posted:FB's PHP compiler to end support for PHP: https://hhvm.com/blog/2018/09/12/end-of-php-support-future-of-hack.html
|
# ? Sep 14, 2018 01:28 |
|
jonathan blow is mad about rust: https://www.youtube.com/watch?v=4t1K66dMhWk dont watch the video. it's way too long. it sucks
|
# ? Sep 14, 2018 12:59 |
|
animist posted:jonathan blow is mad about rust: I'm the voice he does here: https://www.youtube.com/watch?v=4t1K66dMhWk&t=711s
|
# ? Sep 14, 2018 14:19 |
|
People care about what that dude thinks about anything?
|
# ? Sep 14, 2018 15:35 |
|
brand engager posted:People care about what that dude thinks about anything? yes unfortunately Symbolic Butt posted:I'm the voice he does here: im the part where he unironically says "Like a lot of new programming languages are made by people who just are making small stylistic changes..." without any self awareness whatsoever
|
# ? Sep 14, 2018 16:20 |
ctps: defending my dissertation today somehow all this terrible programming paid off!
|
|
# ? Sep 14, 2018 16:36 |
|
lmao the first mention of it I see on my twitter feed is a thread making GBS threads on him https://twitter.com/ManishEarth/status/1040599002557960197
|
# ? Sep 14, 2018 16:36 |
|
brand engager posted:lmao the first mention of it I see on my twitter feed is a thread making GBS threads on him I measured 30 mins for what only seemed the first 10s of her talk, though her presentation sounds a lot worse than his. Also, he's probably right.
|
# ? Sep 14, 2018 17:46 |
|
animist posted:jonathan blow animist posted:dont watch that's a given
|
# ? Sep 14, 2018 17:48 |
|
MrMoo posted:I measured 30 mins for what only seemed the first 10s of her talk, though her presentation sounds a lot worse than his. Also, he's probably right. Jonathan blow is never right
|
# ? Sep 14, 2018 17:53 |
|
I watched almost all of it, around 30min he finally gets to the main point which is this:Jonathan Blow posted:it seems like a little bit of Stockholm's syndrome to me where it's like "oh the borrow checker is so good because it made me program in this certain pattern. but the real reason the borrow checker is not complaining anymore is just that I managed to turn it off but I didn't realize that that's what I did" and he isn't 100% sure if that's what's really going on, which is fine but I'm not sure why he is wrapping this query in an 1 hour long video rant btw this is a pattern that I noticed about rust programmers before and in the end maybe he kinda has a point here but just lol at jblow
|
# ? Sep 14, 2018 18:02 |
VikingofRock posted:ctps: defending my dissertation today good luck
|
|
# ? Sep 14, 2018 18:05 |
|
Symbolic Butt posted:I watched almost all of it, around 30min he finally gets to the main point which is this: You mean smashing keys until it works doesn't leave you with a greater understanding of what's happening underneath? Hot Take!
|
# ? Sep 14, 2018 18:24 |
|
Hi, I'm a fng learning Java and I need help with my first set of Homework for my programming class It's very basic stuff but I have 0 experience with this and the assignment is pretty difficult. I'll be willing to paypal or venmo you $ for the time spent helping me. Feel free to send a PM if it interests you. Also, feel free to own me for being such an idiot and posting this in this thread. Thanks!
|
# ? Sep 14, 2018 18:51 |
|
what’s a fng
|
# ? Sep 14, 2018 18:52 |
|
loving new guy
|
# ? Sep 14, 2018 18:52 |
|
Symbolic Butt posted:I watched almost all of it, around 30min he finally gets to the main point which is this: I don't really see how jblow's paraphrased criticism is applicable, and I'm not willing to watch an hour long rant to see him ignore all the benefits of the system edit: i guess the other interpretation here is i guess he means you start programming in a style you don't need to constantly borrow poo poo in the first place like you might in other languages? i really don't see anything wrong with this comedyblissoption fucked around with this message at 19:02 on Sep 14, 2018 |
# ? Sep 14, 2018 18:59 |
|
*jblow voice* you really need to use a smart pointer here
|
# ? Sep 14, 2018 19:10 |
|
comedyblissoption posted:the only way you "turn off" the static borrow checker is wrapping your stuff in abstractions like RC (like reference-counted smart pointers) though, and rust idioms typically don't require you to do this his thesis is something like "she unwittingly wrote an arena-style memory allocator to fool the borrow checker" which seems to be the usual way to go in games written in C++ anyway. but anyway I still didn't watch the original video by the rust programmer yet but I'm beginning to suspect that she didn't really imply what he's saying she implied, that the "righteous borrow checker guided her to do the right design".
|
# ? Sep 14, 2018 19:12 |
|
Symbolic Butt posted:his thesis is something like "she unwittingly wrote an arena-style memory allocator to fool the borrow checker" which seems to be the usual way to go in games written in C++ anyway. lol but she didn't. jblow has this terrible affliction where he opens his mouth sticks his foot into it and then blames feminism for why he's getting dunked on for his dumb as hell views. please think of this rational, clearly thick skinned, reasonable man's feelings also, just fuckin' lol at an hour long response to a 5 minute portion of a 45 minutes video he didn't watch all the way through (also, rust doesn't permit per-container allocators yet, so no, she did not write an arena allocator. she wrote an ecs in rust where she doesnt have to worry about an invalid entity bringing the entire system to its knees)
|
# ? Sep 14, 2018 19:22 |
|
Symbolic Butt posted:I'm beginning to suspect that she didn't really imply what he's saying she implied, that the "righteous borrow checker guided her to do the right design". iirc the first half of the keynote was in c++, she showed how traditional OO poo poo completely falls apart for games, and why ECS is good design. then she moves over to rust, and shows that ECS has a bunch of benefits aside from working well with the borrow checker. MrMoo posted:Also, he's probably right.
|
# ? Sep 14, 2018 19:23 |
|
Slurps Mad Rips posted:(also, rust doesn't permit per-container allocators yet, so no, she did not write an arena allocator. she wrote an ecs in rust where she doesnt have to worry about an invalid entity bringing the entire system to its knees) He covered that, he calls it "arena" according-to-him, but not what other people (tm) may understand as that. Invalid entity is fairly mild and Blow says a crash would be better than hiding it because you can go debugging and fix it quickly. The allocator scheme she creates allegedly does not eliminate an incorrect but valid entity being presented due to possessing a stale reference and so the language is not really helping at all and required the same development strategy other languages require too.
|
# ? Sep 14, 2018 20:13 |
|
What is an ecs
|
# ? Sep 14, 2018 20:23 |
|
|
# ? Dec 7, 2024 05:58 |
|
Sapozhnik posted:What is an ecs entity component system
|
# ? Sep 14, 2018 20:25 |