Rust Simplified is a series aimed at making Rust much more simple for others to learn. In this episode we cover functions, type information, traits, generics, ownerships, and different various usages of each of these.
Rust Simplified is a series aimed at making Rust much more simple for others to learn. In this episode we cover pattern matching; which is the basis for creating organized data structures and how to use those in simple conditional/destructuring ways. This episode does cover a little bit into other areas, but the main focus here is on pattern matching and those other areas shall be covered in another video.
When a Rubyist learns about Elixir’s pipe operator and how it behaves similarly to Linux/Unix command line piping he, or she, very likely envies that feature and wishes to have it in Ruby. How can I say that or how could I know that? Well it’s a reasonable deduction when I see others, as well…
This past weekend I got to spend 4 days at the Ruby for Good event. This is an event where programmers get together and volunteer their efforts in charitable programming for many needs in our communities. The team I joined up with consisted of 10 developers and most of the team grouped together in about…
Hashes have been optimized for symbols and strings in Ruby which technically are objects but this article is for revealing how much of a difference this makes when using other objects as hash keys. There are some cases where this makes a big difference but many times you won’t notice much of a difference. I…
I’ve received an email from a fellow software developer inquiring about a bit of code where I use Ruby’s splat operator in two different ways. In my Ruby gem cards_lib I wrote a “macro” to take a list of strings and generate card instances from them. You don’t really hear of macros in the Ruby community…
For a long time I’ve been looking for a way to use Ruby’s refinements without building a class & method setup and then instantiating an instance of the class just to use it. And now I’ve finally found a solution. module Moo refine Fixnum do def to_s “moo” end end end # begin/end blocks allow…
As I’ve described in my blog post “Rails Polymorphic Associations” I’ve stated that polymorphic relations in Rails are best for scenarios where a model may “belong to” one of many other kinds of model. So a Comment model with the polymorphic commentable relationship can belong to any other record in your Rails app. This is…
[Don’t Listen to the Naysayers.] How many times have you heard that you can’t do this and you can’t do that and it’s never been done before? I love it when someone says that no one has ever done this before, because then when I do it that means that I’m the first one that has…
One thing you will find yourself needing to do is work across different scopes and in different ways. I would like to show one way of modifying local variables by passing a Binding object. Let’s say you’re going to write encryption classes and you’ll have different ways of encrypting and decrypting. For these you will have…