Earlier quoted context omitted.
Thanks Steve! I watched your video and although I don't understand everything, I learned a lot. Separating my program into functions is a good idea. Your video clarified the map function for me. Through your video, I understood that I was running code multiple times, when it only needs to run once (how I parsed my rules was one of these instances that you went over in your video), so thanks for pointing that out. Aga…
So glad to hear, Liam! Was a pleasure to put it together. Good luck, and feel free to reach out if you get stuck on anything.
Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
211–220 of 304 posts
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#212Earlier quoted context omitted.
sine and cosine last year? Now I want to know what your parents are feeding you!!! ;)
I also picked up sine and cosine at around that age; it was thanks to programming. Various example BASIC programs (e.g. Lissajous curve and circle plotters and such) used those functions and from their behavior I kind of picked up the relationship to both undulation and the circle. I found out about the arctangent function, and from that I realized that it could be used for 3D projection. I made a proof-of-concept pr…
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#213Liam, 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.
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#214Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#215Earlier quoted context omitted.
Is this serious? I started programming around 9 or 10 on a Commodore 64. I would go to the local library to get programming books for it. Now you can hit F12 in your browser and get a powerful console into JS. JS is fine, encourage the thirst for knowledge.
JS is an objectively bad programming language. It is not fine, it is just annoyingly common and convenient. The main advances in its ecosystem are related to transpiling it from other, saner, languages. If he has fun writing JS, then great for him. He's 12, he'll do it if he wants. But it'd be doing him a disservice not to open his eyes to much wider, greener pastures of the programming world.
see how that sounds? that's how you js haters sounds each time I see this bs here on this and many other platforms that wouldn't be possible without js.
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#216Liam, 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!
Liam - whatever Steve suggested are very good pointers but please remember you are getting accolades here because you cared to publish your code. Don't hesitate to publish your initial version without any hesitation in future also.
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#217If you pursue a career in programming, you'll look back at your early work and have a great personal self-documentation tool to remind you of how far you've come.
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#218I am not saying you don't do this, but please please ensure you always sleep well, follow a good diet and go out and play.
Sometimes, computers make us give up good habits!
Kudos for your great work and keep learning, keep shipping!
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#219Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#220Great job! One way to improve this code is to add comments. Use comments to describe what each function does and what the parameters are supposed to be. Then you can tell at a glance what the function does without having to analyze the code later on. Us old people tend to forget things.
Comments in a twelve-year-old's code? For whom? Seven-year-olds? (I'm serious.)