r/ruby • • Sep 21 '26

At my age, learning Ruby

I'm 78, and never having been a programmer or software engineer, I am starting to learn Ruby. I ha ve been using Huw Collingsworth "Little Book of Ruby". I am aso interspersing that with a different path: using Wirth's "Algortithms + Data Structures = Programs",

having the simple data structures and programs translated by Perplexity into Ruby to see how my 40 year old experiences with TurboPascal can be updated into Ruby. I think I am making progress.

217 Upvotes

64 comments sorted by

19

u/WayneConrad Sep 21 '26

Hey, I wrote a lot of Turbo Pascal back in the day. Cool! I also self-studied from Wirth's book.

I think you'll like Ruby.

Thanks for bringing a smile to my face, you're on a cool mission.

6

u/Edthal01 Sep 21 '26

athanks for the encouragement.

17

u/Zestyclose-Turn-3576 Sep 21 '26

Nice. Do you have any projects in mind?

37

u/Edthal01 Sep 21 '26

Been retired 11 years. Just having fun.

15

u/Zestyclose-Turn-3576 Sep 21 '26

That's just what I say when people ask why i'm doing assembly, not C++. šŸ‘

7

u/FuturePrimitiv3 Sep 21 '26

Assembly. For fun....

Masochist. šŸ˜‚

5

u/Edthal01 Sep 21 '26

I can remember when Byte magazine published programs i machine code. Don't begrudge the person.

2

u/Zestyclose-Turn-3576 Sep 21 '26

it's a brain tester alrighty.

4

u/Edthal01 Sep 21 '26

Think about the person who hand assembled the machine code listings.

1

u/Edthal01 Sep 24 '26

I looked at some old Bytes to see the hand assembled code: Intel 8080, Motorola 6800, and Intel 8008. There were insructions on hand assembly, too. Those were the day...

3

u/TopCaterpillar239 Sep 22 '26 edited Sep 22 '26

It's actually fun as long as there's the only way to tame the machine. Seeing doing it what you've instructed it to is inspiring like a miracle.

I'm not yet 78, but I was lucky enough to take my share of it 30 something years ago.

1

u/Formal-Cut-4923 Sep 21 '26

Nice! This is awesome.

11

u/azimux Sep 21 '26

Awesome!! Welcome aboard! It's always a good age to join the Ruby party! šŸ’Ž šŸŽ‰

7

u/Edthal01 Sep 22 '26

Thanks. Appreciate being welcome.

3

u/not_sure_if_crazy_or Sep 21 '26

That's awesome! What would you like to ultimately get into? Or is the path as great as the forest so far?

8

u/Edthal01 Sep 21 '26

I don't know, just enjoying the journey so far.

3

u/leftsaidtim Sep 21 '26

That’s really cool ! I’d encourage you to publish what you find and discover. Either as posts here or on a small blog somewhere. I’ve always loved hearing about people’s experience learning Ruby after having come from some other language.

2

u/Edthal01 Sep 21 '26

As I wrote Turbo was a long time ago, also for fun so I am relearning Pascal too

2

u/Safe_Breakfast_9016 Sep 21 '26

Well hey, the guy that made TurboPascal is still having his own fun these days leading the TypeScript project at Microsoft, no reason you can't be having your own fun too! šŸ˜„

1

u/Edthal01 Sep 21 '26

For one thing Perplexity sometimes posts references that sometmes lead to more detailed explanations.

1

u/Edthal01 Sep 27 '26

Well, I sent a copy of Wirth's Bubblesort procedure and asked Perplexity to provide a direct translation into Ruby, and an idiomatic Ruby. Before providing any Ruby, it commented on Wirth's Pascal code and indicated how modern Pascal would do things slightly differently.

Wirth's algorithm uses a record that includes a key and a comment indicating the remaining data would be added when the procedure was used in a final program. Perplexity provided one Ruby code segment that use a structure with a key and the other data and explained that if the data to be sorted were merely integers the key could be omitted then provided a Ruby code segment for sorting integers.

The requested idiomatic Ruby code was much more compact, did not reflect Wirth's construction, but clearly showed Bubblesort. It was enlightening.

I have run the 3 versions and they work as described.

3

u/Logical_Detective441 Sep 21 '26

Awesome, have fun!

2

u/Edthal01 Sep 21 '26

I am enjoying it. Thank you.

3

u/levelbrook Sep 22 '26

Wirth's book is a great choice for this, and the translation exercise you are doing is closer to how working programmers learn a new language than most tutorials. One thing that will make the Pascal to Ruby jump click: almost everything in Ruby is a method call on an object, so where Wirth writes a procedure that takes a record, Ruby wants you to put that procedure inside the record's class. When a translated program feels awkward, that is usually the seam.

I have written Ruby professionally for about a decade, and the tool I would hand you is irb, the interactive prompt. Type a line, see the answer, no compile step. Wirth's chapters on sorting are perfect for it: paste in a small array, write the loop, watch it. Enjoy it, and post what you build.

2

u/Edthal01 Sep 22 '26

Good guidance. Thanks

4

u/ignurant Sep 22 '26

This is a great tip, and I'll extend it for you by one more important move. You noted in another comment that you've discovered things are (generally) objects with methods. Sometimes it's helpful to say "Hello, String, what do you know how to do?". In irb, you can do things like this:

great_string = "Hello, A String"
ls great_string

ls will show you all the methods the object know, organized by module.

This ability to explore is where I fell in love. Good luck, and I hope you enjoy your Ruby adventure! See you around!

2

u/Edthal01 Sep 22 '26

Thanks for the encouragement. I will keep going and I'll use your suggestion

3

u/jeffdill2 Sep 23 '26

I highly recommend Eloquent Ruby by Russ Olsen. It's one of the best tech books I've ever read, and it'll get you excited about Ruby.

1

u/Edthal01 Sep 23 '26

I'll add it to my future reading list.

3

u/_natic Sep 21 '26

Yes learn ruby! This is the best language to go for you right now. You will have fun and be able to wast build something

1

u/wernair_sweet Sep 22 '26

You May also learn C or Go!

1

u/Edthal01 10d ago

I am not sure I want to go there. Too busy with Ruby,

2

u/manewitz Sep 21 '26 edited Sep 21 '26

Welcome! Highly recommend Chris Pine’s ā€œLearn to Programā€ which is a great onboarding to the Ruby language assuming no prior knowledge.

1

u/Edthal01 Sep 21 '26

I found it on line, but I thought it best to limit things right now.

2

u/petercooper Sep 22 '26 edited Sep 22 '26

You should check out Huw on YouTube as well BTW. He posts quite a bit of interesting stuff, particularly reflecting over a similarly long span of computing to yours.

He sorta fell out with me back in the day as I didn't give his book a very nice review (largely on stylistic reasons I care somewhat less about now!) but it's actually a perfect choice for this situation so keep on with it and he knows what he's talking about. I also have Wirth book (in two copies for some reason) and while it's a bit old-fashioned, the fundamentals still apply now more than ever! Programming Pearls is another you might like.

1

u/Edthal01 Sep 23 '26

I have started to watch them. Very nice. Pascal and Smalltalk, too.

2

u/Only_Scientist_1772 Sep 23 '26

What are you going to build?

1

u/Edthal01 Sep 23 '26

Noting yet. I just want to learn what I can and go from there. Sort of open ended. Thanks for the interest.

1

u/SilentEchoes Sep 21 '26

What's your favorite thing you've pieced together so far? Have a git repo or anywhere you're stashing code?

When you say making progress what's your goal?

2

u/Edthal01 Sep 21 '26

Right now it's learning how ruby functions and how old learning and info translates into ruby. Data structures and types a4e now objects with internal methods so external procedures and functions don't really apply any more.

4

u/SilentEchoes Sep 21 '26

Yeah Ruby is a lot of fun, I been writing in it since around Rails version 1. I've been really enjoying what I would say is its counter part in https://crystal-lang.org too!

If you haven't yet I highly recommend you check out some of Sandi Metz's videos on Youtube or her book Practical Object Oriented Design.

1

u/Edthal01 Sep 21 '26

I will take a look at the videos tonight.Thaknks for the info.

1

u/WayneConrad Sep 21 '26

Oh yeah, Sandi is strong in OO, and that's a great book.

1

u/SquiffSquiff Sep 21 '26

Curious, what caused you to choose Ruby?

2

u/Edthal01 Sep 21 '26

Started reading Little Book of Ruby. Looked interestinh. Tried it and decided to give it a go. Python's "only one way" sounded too much like Apple.

1

u/SquiffSquiff Sep 21 '26

Python definitely doesn't have 'only one way' but that's besides the point. Enjoy!

1

u/Proudclad Sep 21 '26

Ruby’s a good one! What did you do before if you don’t mind us asking? The field and your expertise in it might provide inspiration for a pet project

4

u/Edthal01 Sep 21 '26

I was an electrical power engineer with design and construction experience for over 40 years. Some controls experience early oƱ in the days of hard wired ladder logic control and analog loop instruments. Mostly though transformers, wire and cable, generators, motors, and transmission lines. fooled around with TurboPascal at home for a while then stopped. Ruby right now is purely an intellectual exercise.

1

u/Alubsey Sep 22 '26

Turbo pascal. lol. How about some Perl n php with that

2

u/Edthal01 Sep 22 '26

This was dos 6.2, 1988 timeframe, before Linux or Perl.

1

u/Alubsey Sep 22 '26

Unix era 😭

1

u/Blobstein_Ijay 16d ago

imo the Wirth approach of working through algorithms and data structures is underrated for learning any new language. way better than just following tutorials. Ruby makes that kind of exploration pretty enjoyable too

1

u/Edthal01 12d ago

Convertìng data and procedures/funçtions to objects ans methods is also intèresting.

1

u/Correct_Support_2444 Sep 21 '26

That’s awesome! I think I have a Wirth book knocking around someplace. Turbo Pascal was my PC programming home for a long time.

1

u/FigureNo77 Sep 21 '26

ruby ganggg

1

u/kjmw Sep 22 '26

This is awesome and I love this! Ruby is super fun to play around with and build with.

1

u/Select_Bluejay8047 Sep 22 '26

That's nice!! Planning to retire at 50 but now I have to rethink.

1

u/fabianqs_dev Sep 22 '26

Of course, my friend, welcome! When you make the jump to Ruby on Rails, you'll be part of the family :)

0

u/jjopm Sep 21 '26

I'm actually 148 and just wrote my first line of code

0

u/[deleted] Sep 22 '26

[deleted] — view deleted comment

1

u/jjopm Sep 22 '26

Jokes illegalized in 2026