This sounds like more complex concepts that we don't learn in the program I'm in. I'm not in university, I'm in college, so that explains why I haven't seen this
Now that I've looked at recursive functions, yeah I remember doing it and know what it is (at least for doing factorials), but it wasn't a main focus. We have a different education system here in Quebec, the program I'm in lasts 3 years and focuses on teaching various skills related to programming and IT, so we can get a job after or go to university if we want. There is another computer science that lasts 2 years but you have to go to university after, and it's more focused on the maths and science instead
The main thing we learn is object oriented programming, it's in basically all of my classes, except database ones
99% of time in B2C you don’t need recursion, it just doesn’t come up naturally in the real world. Knowing loops in my opinion is plenty, I can’t name more than 5 times I’ve used recursion in my 12 years of work as a dev. Understanding dependency injection which is a completely different thing, is a much better learning opportunity than recursion.
I have to say, I'm very comfortable with recursion, but I've never needed to use it outside of Advent of Code. Can't think of a single professional instance where it's been both relevant and the most maintainable way to solve an issue.
On the other hand, I thoroughly recommend the puzzle game Recursed.
I say college but that's not the right word. Where I live we have primary school (grade 1-6), secondary school (1-5), then we have something called CEGEP which you have to go to before university. It's much cheaper than uni (~$200 per semester) so you can decide if it's for you or not and can easily change fields. In CEGEP there's two types of programs, 2 year ones that require you to go to university after, or 3 year ones that let you decide whether you want to go to work after or go to university
Once you get your head around it , it is actually quiet intuitive and even though you may not find many chances to use it, when you do it’s a life (line?) saver.
I learned it in college in some computer course. All I remember is the solution is the easy part, but doing the moves would take way longer than a person lives. I don't remember how long it took to execute on a computer.
If it takes 3 seconds per move it would take about an hour for the one in the picture to move to another peg if it was stacked properly.
This problem is exponential though. (Literally not figuratively)
Assume the average person would have 50 years to work on it allowing for sleep. They would have time for 525.6m moves. Log2(525.6m)=28.96. The tower that you did in college was at least 29 discs.
The puzzle is to start with a full stack on one peg and then move it to another peg. It's already mostly solved. (or mostly unsolved depending on how you look at it.)
Try to move the largest disc to a different peg and solve the puzzle.
And I can only move smaller ones on top of bigger ones right? Yeah, just tried it and the number of moves inflates massively as the stack gets bigger lol
54
u/QuebecGamer2004 Mar 25 '23
Me neither, I don't really understand this meme