Live data from Hacker News

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

bitbucket.org

81–90 of 304 posts

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

#81

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 readab…

Programmers got it from mathematicians. I had the impression it was a fairly long standing use of the word.

Mathematicians got it directly from cartography. A “map” “maps” points from one set of coordinates to another, for example when you want to plot latitude and longitude on a flat paper.

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

#82
post #39

It's amazing that at the same age Steven Wolfram himself had written his first 100 page book "concise directory of physics) and at just one year older wrote his first book on quantum physics.

From all the amazing things Mr. Wolfram has done at such a young age almost makes him the Chuck Norris of science.

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

#83

This is awesome! Keep up the good work. As a fellow developer who began writing software around your age, I have some advice that is definitely subjective and biased, but which you may indeed find helpful. 1. Keep practicing. Practice makes perfect. Explore different languages, frameworks, and problem spaces (interfaces, servers, distributed systems, statistics, etc.) to see what you find most interesting. You will m…

9. Bookmark this page, so you can come back and see the wonderful advice that you got when you were 12. It will make more sense as you get older.

:)

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

#84

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.

When I was 12 I ignored this on pretty much any website I signed up for. Words do little to stop a determined 12 year old.

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

#85
post #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 u…

Though, keep in mind that some of this stuff (most notably the [...arr] syntax) won't work in old browsers if you make a web project (IE 11 is a big offender here). See https://caniuse.com/ for a useful source of info on what will work with what for stuff like that. If you do web stuff (and you don't want to just say "no IE 11" - some people, and even some big companies, do that!), usually the easiest way to handle s…

This project explicitly says Node. But in any case, these days I generally recommend using Babel to transpile the newer JS to browser friendly JS as the productivity and readability improvements in newer versions of JS are worth the effort to me to set up the babel build step.

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

#86

This is awesome! Keep up the good work. As a fellow developer who began writing software around your age, I have some advice that is definitely subjective and biased, but which you may indeed find helpful. 1. Keep practicing. Practice makes perfect. Explore different languages, frameworks, and problem spaces (interfaces, servers, distributed systems, statistics, etc.) to see what you find most interesting. You will m…

Would you please provide an example on how one proceed with T shaped learning and expertise?

That's a good question. I left that intentionally broad so as not to prescribe a certain type of learning system or self-education.

There's a lot of ways to learn anything, but I would say that the first step is pursuing a variety of subjects that you find interesting, and even some you think are boring. A lot of seemingly boring things I've found turn out to be quite fascinating when it comes down to it. (e.g. database design)

Over time, you will pick things up, and put them back down. You will return to some, and stay away from others, but eventually you will build a repertoire of knowledge and experience in a variety of different fields. I would also bet that at least one subject will interest you so much that you keep coming back and in which you will ultimately develop expertise.

Experimentation is the name of the game!

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

#87

Great work! I made a quick Observable notebook out of your code, in case anyone wants to see what it does without downloading or running it on their own machine: https://beta.observablehq.com/@jrus/wolfram-cellular-automat...

Dang, that's a neat tool. It's different enough from a Node environment, though, including some of the necessary rewrites of stuff, that I wonder if a "more Node-y" sandbox would be more useful for this particular case. An example: https://codesandbox.io/s/r0kwk0o28p (I tweaked the rule number, column width, and output to print to the page, but otherwise it's the same as the original.)

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

#88
post #39

It's amazing that at the same age Steven Wolfram himself had written his first 100 page book "concise directory of physics) and at just one year older wrote his first book on quantum physics.

From all the amazing things Mr. Wolfram has done at such a young age almost makes him the Chuck Norris of science.

Catching the disease of cellular automata isn’t a good thing. Fredkin was also affected. This young person has many years to do useful things.

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

#90
post #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 u…

I think it is good he's learning to do the loops by hand first. It's good to have an understanding of algorithms first when learning to code.

I second this. Knowing why something is better to use is most likely learned through doing it a worse way first.
Post reply on HN