Well not really. I wrote the code in this repo about a year into my Ruby career, when I was still very much a Java programmer and only toying with the lovely little language that would come to dominate my professional life.
I had thought that all of this was lost forever, but it turns out I had this old computer in a closet and it had an even older backup archive. Of such accidents are archaeological legends made.
The code in this repo is a partial implementation of a program that I have written in every programming language that I've ever learned: It simulates the Newtonian mechanics of particles. In plain English it keeps track of various point masses, things like the Earth and Sun, and the gravitational forces between them, calculating the motions of each numerically. I use this program as a sort of tenth level "Hello world" project when I'm learning a new programming language. It's complicated enough to ensure that you have mastered the basics of the language while not being impossibly involved. And, once you get it working it's fun to see the Earth come back to its starting point after 365 days.
Do keep in mind that the code here is a momentary snapshot of work in progress! The code is not done, it relies on an ancient version of Ruby and a C extension that I stopped maintaining more than a decade ago.
I'm releasing it here for a number of reasons:
-
It's just fun.
-
Some folks asked me to (see previous reason).
-
Mostly though, I want newish Ruby programmers to see that learning a new programming language is a process, a process we all go through. So go ahead and laugh when you look at the code. Laugh at the tabs, at the Java-ish camelCaseMethodNames, at the complete lack of tests and probably a million other things. I'll be laughing with you.
Russ