How to do hard things
61–70 of 123 posts
Re: How to do hard things
#62Re: How to do hard things
#63I am a 4th semester CS student from Germany and still don't grasp recursion, even though I already took the data structures & algorithms courses. If you did have something like a magic moment where it made sense to you, please enlighten me as I would really like to truly gain an intuition (and implement a parallelized msd-radixsort for learning-purposes because I failed to do this assignment yesterday).
It forces you to learn recursion since for most of the book it only uses pure functional programming with no mutation, so the only way to do loops is with recursion. Overall I would say it gave me a strong base to understand not just recursion but functional programming which has helped me pick up new languages more easily during my career.
Also I used Clojure instead of scheme to do the exercises. It's a wonderful modern lisp that works on JVM and can land you a job. The examples usually work with minor modifications and I would say it's worth it to learn.
Re: How to do hard things
#64I am a 4th semester CS student from Germany and still don't grasp recursion, even though I already took the data structures & algorithms courses. If you did have something like a magic moment where it made sense to you, please enlighten me as I would really like to truly gain an intuition (and implement a parallelized msd-radixsort for learning-purposes because I failed to do this assignment yesterday).
I had two A-level maths teachers at school. One always started by getting the class to do a simple as possible example like the above before launching into more complicated stuff, the other started off explaining complex stuff. The first approach worked far better, with the second our minds just kind of glazed over.
There's something a little counter intuitive about it like your neurones have to wire up on the simple example before getting the more complex. Doing the simple stuff then sleeping on it and doing the complex the next day works better still I think.
Re: How to do hard things
#65The most valuable thing I learned at university was how to tackle difficult problems. Taking advanced math and science courses where I had to really study, and still struggled, and having to write essays so frequently that I could no longer procrastinate or wait for the spark to hit me, was more valuable in the long run than any of the actual knowledge I gained. The advice to break a hard problem down into simpler pi…
Professors were also good at teaching, which reduced the need to study at home even further.
It hurt me in the long run - i am really bad at putting in effort unless something catches my attention(thankfully programming can totally absorb me), and i quite frequently 'wait for the spark'(walking helps with that a lot).
Re: How to do hard things
#66I am a 4th semester CS student from Germany and still don't grasp recursion, even though I already took the data structures & algorithms courses. If you did have something like a magic moment where it made sense to you, please enlighten me as I would really like to truly gain an intuition (and implement a parallelized msd-radixsort for learning-purposes because I failed to do this assignment yesterday).
If you imagine your code as a sequence of instructions, recursion is basically a `JMP` to the start of the stack again, normally with different values.
Once a condition is met, instead of jumping back to the start, it returns something. That condition then repeats itself inside all the repetitions eventually returning the value to the original caller.
# imagine we're recursing to subtract to zero
1. call function subtract with 10 (set x = 10)
2. subtract x by 1
3. if zero, return 0
4. else return the result of calling the function with x-1 (jump to 2)
Once I realized deep down at the CPU level it's all a sequence of instructions, recursion is nothing but moving the pointer. With higher level languages there's a bit more involved, but the gist is the same.Re: How to do hard things
#67I am a 4th semester CS student from Germany and still don't grasp recursion, even though I already took the data structures & algorithms courses. If you did have something like a magic moment where it made sense to you, please enlighten me as I would really like to truly gain an intuition (and implement a parallelized msd-radixsort for learning-purposes because I failed to do this assignment yesterday).
1) There is always an exit condition ( or it would run forever , we never want that)
2) There is always a value that changes and it is passed to the next execution, or otherwise it wouldn't make sense it would be always the same execution and the exit condition would never trigger.
3) Think like frames of a movie, in paper o whiteboard, write a table with a column for every variable and a row for every step, my first programming teacher taught me this, and 19 years later it save me in a white board interview, it helps to calm down and just go step by step seeing how values evolve.
So these 3 together, allow you to think in how the values change in every step, and how to get to the point that the exit condition is meet.
Hope it helps! good luck!
Re: How to do hard things
#68I am a 4th semester CS student from Germany and still don't grasp recursion, even though I already took the data structures & algorithms courses. If you did have something like a magic moment where it made sense to you, please enlighten me as I would really like to truly gain an intuition (and implement a parallelized msd-radixsort for learning-purposes because I failed to do this assignment yesterday).
I didn’t realize that it was a threshold moment, and I didn’t even know if it was syntactically legal or allowed for a function to call itself (I had no formal CS training) but I remember struggling with the “how much should these child elements be indented” problem and eventually trying it and it worked; it was quite a rush for 14-year-old me.
Maybe try implementing something simple and straightforward that uses it, like a web front end that displays a directed graph of nested comments/message replies?
Re: How to do hard things
#69My biggest realization about doing hard things is that I needed to let go of my intellectual entitlement. Just because something is (or seems) effortless to others, doesn't mean it will be the same for me. Part of this entitlement stemmed from a (now eroded by bitter experience) belief that I'm somehow a faster learner than normal, that _I_ don't have to do the work. For example, about seven years ago I wanted to lea…
Re: How to do hard things
#70His use of loops just seems like an implementation of breaking a problem down into smaller components. If I wanted to learn to learn a difficult skill, such as writing a decent novel, I'd break it down as follows: 1) Research what skills I'll need to develop. At my current stage of learning I don't know what I don't know. 2) Figure out a path to start developing skills. This might be writing a small story every singl…
For a long time I've had this idea about creating a website where this type of idea is expressed. I envision it to be some large hierarchical tree like structure (not unlike the ones you see in games like FInal Fantasy) where you pick a topic you want to learn and it gives you the basics to learn and then once mastered allows you to goes deeper by diverging into specialised categories.