r/ruby • u/Edthal01 • Oct 06 '26
What I learned 60 years ago
I just started to read "Elements of Programming Style" (Kernighan & Plauger). I was first taught FORTRAN 60 years ago. I guess you never forget. I understood the Newton's method and the commands on page 4 and think I might have a chance to rewrite it in Ruby. Too much to do at home right now. Probably won't get back to it until after the holidays.
All encouragement and guidance will be appreciated.
30
Upvotes
9
u/DJ_German_Farmer Oct 06 '26
r/ruby’s version of the wholesome post, love it!
Enthusiasm for code is sorely needed right now especially in our community.
2
u/Zestyclose-Turn-3576 Oct 06 '26
That'll be interesting.
I did something similar to the opposite. Having done FORTRAN77 many years ago, and since learned Ruby, I implemented a simple solar system model in modern object oriented Fortran.
So that was built out of objects like:
It made the physics pretty simple, as you could take any pair of objects and ask the pair what the force vector was between them.
Do you think you'll be trying to make an object-oriented version of the code?
2
u/mrspuff Oct 06 '26
Sounds like fun, OP! I'm an OG Fortran, C, assembler geek doing python and ruby now. Think about using Claude code - not to write the code, obviously, but it can help you look up docs and troubleshoot.
2
u/Competitive-Win-9916 Oct 12 '26
I believe in you stranger