![]() ![]() ![]() Ruby is a programming language written in C (and in Ruby). On other occasions, we mean that something happens under the hood and there's no way to understand it.Įspecially in the latter case, is this a good term? Or does it restrict us in the things we think we can and cannot understand? Debunk Some Ruby Magic We adore some functionality that happens in the background (AKA "automagically"). But it's actually basic Ruby functionality that lets you do good and bad. And while you were debugging you thought it was evil witchcraft. You spend an hour trying to understand what's going on until a colleague tells you that he monkey-patched the String class in a different method to do some debugging for another bug and forgot to remove it: # Monkey-patched String somewhere globally □ The inspect() method returned the old "Johnno" as expected but with some additional weird output. Let's say you are one of those developers and do: # person.rb - 1500 lines of code, definitely a fat model.īut then in your view, you see a different output: debug parse_old_name: - Johnno Sometimes, when things get returned in a view, developers inspect() the returned value and see what gets returned in the browser. some code to decide what and how to return the name. ![]() Your Person class' name is returned as "Johnno", although you expect just "John" # person.rb Imagine you jump into a console and try to debug a method that doesn't seem to do the right thing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |