Lurker News

Comments (283) 76 threads

Earlier comments
tannerwj1 reply#
Looks great. I tried it and it runs fine. Nice syntax and convention.

Just a tip, you don't need to include `npm init` in your instructions. That command only needs to run when you create a new project. It worked just fine for me with just a `node index.js 18`
Great work!

liamilan#
Thanks! You're right, I fixed it.
mockingbirdy#
Great that you start so early, I've did the same. For me it was a great way to gain confidence and build a skill which is very useful. I wouldn't be the same person now if I didn't program so early.

Seeing how things come to life that you've build with your own hands is a very empowering experience. Keep it up! :)

52-6F-622 replies#
Far better than I could do at that age!

I think the furthest I was getting at that time was building out really terrible looking web pages in Notepad and making awful little animations in BASIC and Turing (learning lang).
Keep it up!

markatkinson1 reply#
I made a colourful ASCII birthday cake in Pascal that beeped happy birthday at that age. Still one of my proudest programming moments.
vram22#
writeln(chr(7)) ?

or something more (e.g. playing different frequencies to sound like the happy birthday song)?
Related, and good fun for kids of all ages (first did something like this on my earliest home computer [1]):
Play the piano on your computer with Python:
https://jugad2.blogspot.com/2013/04/play-piano-on-your-compu...
[1] Lissajous hippo, retrocomputing and the IBM PC Jr.:
https://jugad2.blogspot.com/2012/09/lissajous-hippo.html
Western classic music fans may find the comments on that post interesting - stuff about octaves and frequencies.

keithnz1 reply#
I was on my Atari 800XL making games at that age. I started hitting problems that I thought should be easy. Like, I wanted to draw circles. But the library was just pixels and lines ( when I got to assembly programming, suddenly lines became a problem too ). There was no googling the answers, but luckily I could go "Daaaad..", who was a physicist, and he happily introduced me to trig and I eventually learned to draw circles....slow drawing circles, but still, circles.
lozzo#
+1. Reading your answer made me think you were talking about me. Except I had a TI99/4A, and "Daaaad" was my real google. My circles were probably slower and more pixelated
test65542 replies#
Great 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.

crooked-v#
Also, if you use JSDoc a lot of modern editors can use that to automatically provide type hinting, documentation references on mouseover, etc.
kazinator3 replies#
Comments in a twelve-year-old's code? For whom? Seven-year-olds? (I'm serious.)
tchaffee#
How about for a 32 year old who is just learning JavaScript and comes across this repo? Age has nothing to do with it.
mergejoin#
Why not learn good programming practices at an early age?
Humdeee#
Perhaps for himself when he's thirteen or fourteen and wants to refactor

Load more comments