Live data from Hacker News

Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

bitbucket.org

221–230 of 304 posts

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#221
post #167

Liam, this is incredible ! I thought it might be useful for you to incrementally see how someone in industry would review or change this code, so here's a little code review via video: https://youtu.be/UkVOrcS--04 We very incrementally build up to the final code, which can be found here: https://gist.github.com/stevekrenzel/b490564bf1c7f98e232a6c8... Hope you find it helpful!

If you would start a channel where you review code of random public repos I would definitely subscribe. Well done.

Let us know here if you are planning to do it :)

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#222
post #167

Liam, this is incredible ! I thought it might be useful for you to incrementally see how someone in industry would review or change this code, so here's a little code review via video: https://youtu.be/UkVOrcS--04 We very incrementally build up to the final code, which can be found here: https://gist.github.com/stevekrenzel/b490564bf1c7f98e232a6c8... Hope you find it helpful!

I'm subscribing to you, just incase you do more video's on code reviews.

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#224
post #167

Liam, this is incredible ! I thought it might be useful for you to incrementally see how someone in industry would review or change this code, so here's a little code review via video: https://youtu.be/UkVOrcS--04 We very incrementally build up to the final code, which can be found here: https://gist.github.com/stevekrenzel/b490564bf1c7f98e232a6c8... Hope you find it helpful!

If you would start a channel where you review code of random public repos I would definitely subscribe. Well done.

+1

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#225
post #89

Congratulations! I showed your project to my 12 year old son who has just started to learn programming (in JS no less!) and his jaw dropped. In addition to being a programmer, you are now a role-model. Really well done.

Thanks a ton! Tell your son that it took me a while, and a lot of work, but it feels great to finish something (there are a lot of projects that I don't finish...). I began learning using Scratch a long time ago. They even featured me last year (the project was a solar system in which I used sine and cosine to calculate the rotation of the planets). I then used blocklike.js to move to JS. I watch a lot of YouTube vid…

I've got a 10 year old who's been making a lot of stuff in Scratch since he was 6. I've been trying to think of how to phase him over to less limited languages and wasn't aware of blocklike.js, so thank you for that idea.

Having a lot of projects that you don't finish is completely normal, so don't worry about that.

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#226
post #167

Liam, this is incredible ! I thought it might be useful for you to incrementally see how someone in industry would review or change this code, so here's a little code review via video: https://youtu.be/UkVOrcS--04 We very incrementally build up to the final code, which can be found here: https://gist.github.com/stevekrenzel/b490564bf1c7f98e232a6c8... Hope you find it helpful!

Instead of this:

    (rule & (1 
You could just do:

    (rule >> i) & 1
Otherwise it was a good review! I'd probably also extract parts of this long line so it's not as cumbersome to read:

    return state.map((item, i) =>
        rules[((state[i - 1] || 0) * 4) + (item * 2) + (state[i + 1] || 0)]
    );
to

    return state.map((item, i) => {
        const prevItem = state[i - 1] || 0;
        const nextItem = state[i + 1] || 0;
        return rules[(prevItem 
It also uses bitwise operations instead of arithmetic, even though they are equivalent in this context, simply because we are effectively operating on arrays of bits.

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#228
post #167

Liam, this is incredible ! I thought it might be useful for you to incrementally see how someone in industry would review or change this code, so here's a little code review via video: https://youtu.be/UkVOrcS--04 We very incrementally build up to the final code, which can be found here: https://gist.github.com/stevekrenzel/b490564bf1c7f98e232a6c8... Hope you find it helpful!

I'm a long time coder and still liked watching your video just for watching someone else work in emacs. How do you get emacs to highlight all occurrences of map? Was it a keybinding for "highlight-phrase"?
Post reply on HN