HomeRugbyScrim and Ruby for Web Dev: Is It a Good Combo?

Scrim and Ruby for Web Dev: Is It a Good Combo?

Okay, so today I decided to mess around with Scrim and Ruby, and let me tell you, it was a bit of a rollercoaster. I’ve dabbled in Ruby before, mostly just basic scripts, but Scrim was completely new to me. Think of it like a playground where you can run code and see the results instantly, it is interactive.

Scrim and Ruby for Web Dev: Is It a Good Combo?

Getting Started

First things first, I needed to get everything set up. Since I already had Ruby installed on my machine (thank goodness for small victories!), I figured the Scrim part would be easy. I just searched for “scrim ruby” and opened their interactive platform on their website.

With everything loaded, I was ready to roll. I started with some super basic Ruby stuff, just to get my feet wet. I typed out the classic:

ruby

puts “Hello, world!”

Hit enter, and boom! There it was, “Hello, world!” printed right below my code. Ok, so far, so good.

Scrim and Ruby for Web Dev: Is It a Good Combo?

Experimenting with the Basics

Feeling a bit more confident, I decided to try some simple variable assignments and operations:

  • I declared a variable: my_name = "Bob"
  • Then I did a little string interpolation: puts "My name is #{my_name}"

Again, Scrim handled it like a champ. It showed me the output immediately, which was “My name is Bob”. Nice!

Playing with Loops and Conditionals

Now, things were starting to feel interesting. I wanted to see how Scrim handled loops and conditionals. I whipped up a quick loop:

ruby

for i in 1..5 do

Scrim and Ruby for Web Dev: Is It a Good Combo?

puts “This is loop number #{i}”

end

Scrim printed out each iteration of the loop, one number at a time, just like I expected. Then, for good measure, I added a simple if/else statement:

ruby

age = 25

Scrim and Ruby for Web Dev: Is It a Good Combo?

if age >= 18

puts “You can vote!”

else

puts “Not old enough yet!”

end

Scrim and Ruby for Web Dev: Is It a Good Combo?

And yup, Scrim correctly told me “You can vote!”.

Building a simple function

Okay, I wanted to create a simple function using Ruby on the interactive platform. I wrote down a quick multiply function:

ruby

def multiply(a, b)

return a b

Scrim and Ruby for Web Dev: Is It a Good Combo?

end

puts(multiply(2,3))

Scrim prints out “6”. So far so good.

Wrapping Up

All in all, my little adventure with Scrim and Ruby was pretty fun. It’s a great way to quickly test out snippets of Ruby code without having to set up a whole project. I can definitely see myself using Scrim more often, especially when I’m learning something new or just want to play around with an idea. It’s like having a little Ruby sandbox right there in your browser. I’m not saying I’m a Ruby expert now, not by a long shot, but at least I’m a little more comfortable with the basics and can use Scrim.

Stay Connected
16,985FansLike
2,458FollowersFollow
61,453SubscribersSubscribe
Must Read
Related News

LEAVE A REPLY

Please enter your comment!
Please enter your name here