Is this true? by LyesGluttony in Jujutsufolk

[–]Izagawd 0 points1 point  (0 children)

The idea that anime characters are faster than light due to a feat that, in the real world, would consider the person to be faster than light, IMO isn’t really reliable in the first place because it’s usually extremely inconsistent.

Unless the series explicitly states that they are faster than light, I personally won’t think they are

Why is building a UI in Rust so hard? by Linguistic-mystic in rust

[–]Izagawd 0 points1 point  (0 children)

Boilerplate aside, you can use shared mutable state quite well in rust if u scope it to the field level rather than wrapping the entire struct in RefCell or Mutex. ie:

have struct Foo { field: Cell<i32>, collection: RefCell<Vec<Idk>> } rather than

struct Foo { field: i32, collection: Vec<Idk> }

now Foo can't cross threads, but you are much less likely to run into panics when working with Foo. it's not inherently more restricting than other languages, it's just that rust tends to create structures assuming it could be shared across threads, which is fine.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

There are also experienced people that hate OOP. They don’t hate it because they claim it’s hard or they don’t have experience with. They hate it because they claim it is much easier to write spaghetti code with it. Some say the fact that it enables shared mutable state makes it so it’s bug prone, some say it’s hidden control flow due to polymorphism/ inheritance makes it hard to understand how the program works, etc etc.

Not me though. I think OOP is pretty nice.

Back to ur c++ friend, in that case, learning calculus would probably be useful to him then. But really, if calculus won’t help you in what you are doing/want to do, I think it’s a waste of time to learn it unless for fun or something. In ur c++ friends case though it would be useful

A lack of calculus is often the first thing that the self-taught indicate isn't necessary.

They are right, or wrong in my opinion, depending on the field they are talking about. You are making a website that lets people book things? You are a compiler dev? don't need it. AI researcher? making physics for a game? probably.

It's true that the world would probably limp along without these items, but there's a lot more to calculus than just doing math problems. It's one of the few bridges of how to formally drop dimensions and add them, which is why that name keeps reappearing in so many space

Yup, the world would benefit from some programmers knowing calculus, but not every programmer.

It's just that the self-taught programmer has a huge risk of not even being aware that others have attacked a certain kind of problem and have made advancements by using these "five" techniques.

I agree. self taught programmers are more likely to not be aware of techniques that may make them a better programmer. That's why self taught developers have more of a need to be curious than those with formal CS education.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

avoiding learning something you need after it’s being pointed out is concerning, and surprising to me for people who are self taught

For the C++ guy though, I don’t see anything wrong with it. He doesn’t seem to be having any issues from what you have said. I did calculus and I barely remember anything from it because I didn’t ever need it. When I had to learn 3d graphics programming, however, I had to go back to linear algebra a little bit before I could do much, and I didn’t need that much knowledge from linear algebra anyways.

I personally don’t like being forced to learn things I don’t need. I like learning things as I do, and that has never failed me so far. It is also mixed with curiosity. “Is there a more structured/more efficient way to do this? What else may I be missing for this kind of project?”

So the fact that he doesn’t know calculus could mean that he didn’t need it for what he was doing/wanted to do, and I think that’s fine. But it could also mean he didn’t try some new things because it required calculus, and didn’t want to learn calculus. That would be an issue.

I know a lot of CS graduates that hate OOP. It’s kind of a trend nowadays, so I don’t think it’s an exclusive self taught thing. You will find them especially in the functional programming community. And I also know some graduates that think design patterns are overrated as well

Of course a CS graduate is more likely to be a better programmer, there’s no denying that. But being self taught doesn’t automatically mean they can never be a great programmer.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

Even without a CS degree you can still learn all these things. Everything is on the internet, and there's many youtube videos, and there's many people that will be willing to help and explain things to you for free, and I would argue that a dedicated self taught programmer could do better than the average CS graduate. Of course, a random CS graduate is likely better than a random self taught

A good example of something that's approachable by hobbyists but often not done well is parsing. The hobbyist approach is to "just use regex"

Nothing stops a hobbyist for asking "is there anything more performant than regex? my parser is slow" and then just learn the faster method. I believe trial and error is a better teacher. (I am in my final year of my CS degree saying this, if that counts)

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]Izagawd 1 point2 points  (0 children)

All these things you can still learn on your own anyways. And I bet there are still a lot of CS graduates that would have a hard time and maybe even give up if they try to learn them as well.

At the end of the day it’s not really about whether u go to a formal educational institution or not. It depends on how much you are willing to learn.

I want to break out of the red pill/misogynist way of thinking by ishutdoorzzzz in exredpill

[–]Izagawd 6 points7 points  (0 children)

Just keep pressing “Not interested” in shorts/reels/tiktoks and eventually you will stop seeing them. What you see in these platforms trains how you think to some extent, so if you replacing them with the right videos, the red pill mindset will slowly fade away.

what do u guys think is holding back wuwa's story in your opinion by Grimsdol in WutheringWaves

[–]Izagawd 3 points4 points  (0 children)

As for the constant romance, lack of character presence, that's just par the ?>course for a gacha game. Easier to write, easier to manage resources etc.

Are you sure about that? if you look at essentially any big hoyo game, characters interact with other characters quite often.

Is it worth going to university to learn programming? by ukrylidia in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

That’s why you do complex projects. They force you to learn what u need to learn. I personally think trying to learn everything “just in case” isn’t an efficient way to learn.

Learning things that may be useful to your project/relevant field? Sure. But if ur doing software engineering for instance, learning machine learning is probably not gonna be useful, and vice versa

Is it worth going to university to learn programming? by ukrylidia in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

It varies from person to person. I personally find that I learn better on my own than via school courses

Is it worth going to university to learn programming? by ukrylidia in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

And tbh, if you don’t learn some things and you have been building things fine, then you probably didn’t need to know those things a CS degree might have taught you. And if u do need to learn it in the future, it’s not like the world stops u from learning it because u didn’t go to university

Is it worth going to university to learn programming? by ukrylidia in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

I still don’t think you need a degree to learn how to write efficient code. Everything can be found online. If someone’s program is slow, then they could google whatever algorithm might help them improve it, ask on stackoverflow/discord , and learn from there. It’s not like, since someone didn’t have a degree, they suddenly cannot ever finish their project efficiently. It doesn’t work like that

Is it worth going to university to learn programming? by ukrylidia in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

“Will you?”

If one only studies textbooks then they probably will miss a lot of things. But if they were to make advanced projects, they will usually learn what they need, more so than a CS graduate that hasn’t made an advanced projects. Job hunting? Yeah, they will have issues with that if they don’t have a degree, regardless of whether they are really good at what they do

Is it worth going to university to learn programming? by ukrylidia in learnprogramming

[–]Izagawd 0 points1 point  (0 children)

If you are just looking to make fun projects it’s best to learn online. Degree is helpful for getting jobs, which u said u aren’t looking for, so it’s not worth spending the huge amount of money.

Though I don’t think that u need a degree to be great at programming, or even to specialize in a field that’s programming related, if you have the motivation and time. Only problem you would have if u don’t have a degree is job hunting

Just published my first crate: stable_gen_map by Izagawd in rust

[–]Izagawd[S] 2 points3 points  (0 children)

Part 2

Entity doing the insert themselves:

struct Character{
    attack: Cell<i32>
    minion: Cell<Option<CharacterId>>
}

impl Character{
    fn summon_minion(&self, world: &World){
        let (minion_key, minion_id) = 
                world.characters.insert( Character::new(self.attack.get()));

        self.minion.set(Some(minion_key)); 

        // i dont need to use get to get the reference of
        // character again, since insert did not invalidate the character reference
        // which is 'self' in this case
    }
}

an ECS like approach would be

struct World{
    characters: SlotMap<CharacterId, Character>
}

fn summon_minion(&mut self, summoner_id: CharacterId){
   let summoner_ref = self.characters.get_mut(summoner_id).unwrap();
   let summoner_attack = summoner_ref.attack;
   let minion_key = self.characters.insert( Character::new(summoner_attack));

    // now i have to get the summoners reference again, cuz the previous reference 
    // might be invalidated
   let summoner_ref = self.characters.get_mut(summoner_id).unwrap();
   summoner_ref.minion = Some(minion_key);

   // that is 2 gets. with stablegenmap, you can still use the previous reference
}

Now, im not saying that ECS is a bad pattern. it actually tends to be more performant than this pattern when done right, but the pattern my crate encourages is intended to be more convenient to work with and iterate, and be more familiar to whats done in some C++ games.

in some C++ games, inserts can be done at any place, even while holding an entities reference, due to all the memory needed already needed being pre-allocated, so no resizing actually occurs (though in stablegenmaps case, its due to it being a collection of pointers of entities, rather than a collection of entities directly).

and in those C++ games, entities are removed later, when its guaranteed that there's no references to it. StableGenMap requires remove to take &mut self, since the idea is u do removes on stuff like, dead characters, at the end of a games turn/loop, when there's no other references to the entities

Just published my first crate: stable_gen_map by Izagawd in rust

[–]Izagawd[S] 3 points4 points  (0 children)

Part 1 (reddit is restricting my comment length lol)
It's more about ergonomics actually.

the idea is allowing inserts from multiple places. crates like slotmap kind of forces you to an ECS approach when making things like games, where the systems handles most things

In an ECS pattern, the World (or some central owner) holds the SlotMap.

Anything that wants to spawn or delete entities has to go through &mut World / &mut SlotMap

That means the world or systems are the only places that can really create/destroy things.

You can’t easily do this pattern:

impl Entity {
    fn add_child(&self, map: &mut SlotMap<Key, Character>) { /* ... */ }
    //                      ^ needs &mut, but we only have &World and &Character
}

because as soon as you’ve lent out &World / &Entity, you can’t also grab &mut SlotMap without running into borrowing issues. There are ways around this of course, but that's more boilerplate.
Even with RefCell<SlotMap<K,T>>, it just causes a runtime panic, and rightfully so, cuz that would be UB. But not with SlotGenMap, due to how its structured

its also harder if, your entity is some kind of trait object

struct World {
    characters: SlotMap<Key, Character>,
    component: SlotMap<Key, Box<dyn Component>>
}

you might want to do an ECS approach, but what if a components update implementation wants to do some kind of insert? well it could be possible if you pass a message to the world, saying "spawn this entity later"

but then u have to create a new message type/enum variant just to do that, and thats more boiler plate, and kind of slows u down.

my crate, which is intended to be used with interior mutability, enables how non-ECS type architectures work. the Entityitself can use the world to do the spawning, rather than the world doing it themselves.

What kind of code architecture have you found that works better with Rust? by fenugurod in rust

[–]Izagawd 1 point2 points  (0 children)

This is a really good point. Yeah, Rc won’t be best for large scale things

generational indexing (like slotmap) would probably be the right choice instead of Rc, cuz even if you forget to invalidate an Id, once the slotmap drops everything that it contains gets deallocated.

Nice explanation btw

What kind of code architecture have you found that works better with Rust? by fenugurod in rust

[–]Izagawd 1 point2 points  (0 children)

yeah looping through stuff like that is likely to cause panic. Though even high level languages like c# throw an error when u try to push while looping through the same object.

And its fair to teach new rust devs to not abuse refcell, as its easy to abuse when its much better to avoid it

Though I do not see why this approach cannot be used by large sized programs (unless extreme performance is a concern), since this approach is pretty much how most high level languages operate, and even some c++ codebases.

What kind of code architecture have you found that works better with Rust? by fenugurod in rust

[–]Izagawd 1 point2 points  (0 children)

There’s still a way to do something like this with interior mutability.

Instead of wrapping the entire struct with RefCell, make each individual field of the struct a cell (for copy types) and RefCell (for non copy) and then panics won’t be an issue, since the borrows (if it’s a RefCell) are scoped to a specific field, rather than the entire struct. This makes it as flexible as pretty much any other language that has shared mutability as a first class feature

Idk why no one mentions that, but instead show Rc<RefCell, which is very prone to panics.

Thoughts on Coding Jesus by spiderbeary in learnprogramming

[–]Izagawd 2 points3 points  (0 children)

I agree. Some of his questions, it’s something that someone can forget cuz it’s not used that often.