Live data from Hacker News

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

bitbucket.org

51–60 of 304 posts

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

#51
post #43

Earlier quoted context omitted.

It's a program that fits in one screen and has 3 functions. No need for these trendy overcomplications.

The fact that it's dead simple is the point of the recommendation. It gives an opportunity to learn the tool with the bare minimum of moving parts involved.

I'd prefer that we unlearn many of these things instead.

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

#52
post #3

Earlier quoted context omitted.

This comment violates HN's rules. Please assume good faith and don't attack people. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/showhn.html Consider the ridiculous downside of someone being 12, posting their program to HN, and meeting with this as a first comment. How awful.

No it's not awful. People will doubt him sometime, and it's better to learn how to deal with that and gain a life skill rather than expecting every person to be sweet and supporting. There are some kids who just goes on game chats to mess with others, play loud music, bully them, grief them etc. They are usually around 12 years old to 16 years old. I'm sure these things are not new to this kid. Welcome to the planet.

who hurt you dude?

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

#54

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!

I made a colourful ASCII birthday cake in Pascal that beeped happy birthday at that age. Still one of my proudest programming moments.

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

#55
post #21

At 12, I was writing 6809 and 68k asm, and cracking games. The most impressive demos in the Atari scene were written when we all were around 15. Because we had plenty of spare time and still lived at our parent's house. And because we loved programming. Nowadays, kids are just not interested in computers any more, besides playing Fortnite and more generally, using apps or wasting time on Youtube and Instagram. Trivia…

Ignore this guy

The OP opened the door with fishing for positive ageism, and then that person responded with negative ageism.

The taijitu is whole.

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

#56
I like how the array named 'map' reflects our original use of this word, rather than the special meaning which it has acquired to programmers.

In Javascript and other languages 'map' has become a kind of "functional operation" so we cant call things 'map' anymore (in public). We have to say 'space' or 'state' or 'grid' or something... but I do still think 'map' was good.

Congratulations on a very efficient and readable project. Bravo !

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

#57

This is awesome liam. im just over twice your age and am just now writing game of life simulators.... man, what was i doing at 12???

Trust me, there can be downsides to starting early. In my case, I virtually skipped having social interactions not on the internet until I was around 20 or so. Not everyone will have this kind of affliction, but you can't have it all - you gotta choose what's important to you. I hope this doesn't come off as being too negative, I mostly say this because I think you should try to appreciate what you did learn rather than lamenting about not being able to start with coding super early.

...that being said, this is way cleaner than any code I'd written at 12 I'm pretty sure.

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

#58
Hey looks good :)! Just a few things you might not know about:

Google String.prototype.padEnd. It’s built in to JS and should be able to replace your zero fill function.

And instead of mutating the ruleSet array you should be able to use Array.prototype.map like this:

const ruleSet = zeroFill(8, rules.toString(2)) .split('') .reverse() .map(item => parseInt(item, 10));

And you can clone arrays like this, instead of using loops:

const oldArr = [...arr];

Also arrays are still mutable even if you assign them to const variables.

I’d offer more help but I’m on mobile. Sorry for the poor formatting. Hope this helps anyway. Good luck!

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

#59
post #48

Technically, you shouldn't be using this site ;) > If you are under 13 years of age, you are not authorized to register to use the Site. But I applaud you for getting into programming this early.

[deleted]

My assumption was that this was inserted as the generic response to having to deal with COPPA. Not sure if you're collecting information that would be afoul of that law.

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

#60

Good work. For a next step, I would suggest giving a try at breaking it up into multiple files using import/export statements (it doesn't need it but it's good practice), and using a bundler like Parcel to build the finished file. npm i --save-dev parcel-bundler ...then move your source JS files to a folder named src, and add to package.json... "scripts": { "prepare": "parcel --target node src/index.js" "start": " no…

Of the things to learn when one is starting out, I would not put code modularisation and toolchains at the top of my list (especially for something so small).

Additionally, this runs in Node, so you don't need to compile the source files with `parcel`.

Post reply on HN