サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Pixel 9
blog.rubybestpractices.com
This time we’ll explore the space between begin and end. Today’s article won’t be as much about individual best practices but rather I will try to explore various aspects of begin ... end blocks so you can decide how to make best use of this tool. In fact, there are so many aspects that this construct sometimes reminds me of a swiss army knife – not so much because you can do everything with it bu
Originally published as part of the first volume of the Practicing Ruby newsletter on February 5, 2011. Most of these issues draw inspiration from discussions and teaching sessions at my free online school, Mendicant University. SOLID is a collection of five object oriented design principles that go nicely together. Here’s a super brief summary pulled from the wikipedia page on the topic: Single r
Today we’re back to normal blog mode, where each article stands for itself. Muppet Labs are closed and we will be continuing our journey across the Ruby universe starting with an indepth look at Ruby’s Struct class — Ruby’s Swiss army knife for structured data. Struct can be used without any additional require statement — it’s just there. This means it comes with zero additional overhead during in
Originally published as part of the Practicing Ruby newsletter on December 21, 2010. Most of these issues draw inspiration from discussions and teaching sessions at my free online school, Ruby Mendicant University. You should follow @seacreature on twitter if you want to keep up with my more recent projects. Today we’re going to wrap up this series on modules by looking at how mixins can be useful
Originally published as part of the Practicing Ruby newsletter on December 10, 2010. Most of these issues draw inspiration from discussions and teaching sessions at my free online school, Ruby Mendicant University. You should follow @seacreature on twitter if you want to keep up with my more recent projects. Using Mix-ins to Augment Class Definitions Although knowing how to use modules for namespa
For the tl;dr crowd, there are sixteen student projects and four sample exercises from the course towards the end of this document. The Original Idea Back when I wrote about the Ruby Mendicant University idea in June, I didn’t have a particular plan for it. I knew I wanted to teach a free online course of some kind, drawing from my life experiences as much as possible to form the learning material
The last few weeks have been a wild ride. Starting in January, I’ve been releasing a chapter at a time here on the RBP blog, and many of those chapters were pretty well commented on. Just for the sake of completeness, here’s a link back to each of those posts: Chapter 1: Driving Code Through Tests Chapter 2: Designing Beautiful APIS / Chapter 3: Mastering the Dynamic Toolkit Chapter 4: Text Proces
If you’re reading this blog, you probably know that the Ruby Best Practices book exists. Even if you haven’t read it, you might have a sense for the sort of topics we cover based on the content you’ve seen on this blog. But now, everyone is going to get a chance to read RBP the way its meant to be read: as a conversation. For the next 8 weeks, I will post a chapter from RBP every Friday. You don’t
When we know something is ugly or “evil”, we’re quick to replace it with what we know to be a better solution. But if we don’t know why the solution is better, it makes it hard for us to investigate those things that look reasonable on the surface, yet have weaknesses just beneath the skin. I’ll run through a quick example of what I mean, and then, it’ll be your turn to run with it and report back
A remark: we enabled comment moderation because the blog was recently target of spam. You probably have not seen much of it because we were pretty quick in removing it manually. So if your comment does not show up please be patient. There are some basic concepts (often called “aspects”) that need to be implemented for many classes although not all classes need all (or even any) of them: initializa
The following blog post is a direct excerpt from the Ruby Best Practices book. If you’ve been enjoying this blog, you’d probably love the book, so I’ve decided to release some content here to give you a sense of what to expect. Enjoy! UPDATE: For those coming from other languages, Ruby’s code blocks are inherently closures , and provide syntactic sugar for methods that accept Proc objects (Ruby’s
As promised, we’re back with more design discussion and hopefully some interesting ideas. Let’s start with a quick recap of what has happened so far. First, Sandi Metz posted on her blog about type specific coupling that a case statement can introduce. Her proposed solution encouraged us to pass the responsibilities down to the individual objects, which is certainly desirable. Aaron Patterson got
EDITORIAL NOTE: This is the first of hopefully many guest posts to the RBP blog. If you are interested in writing an article for us, contact any of the RBP bloggers for details on how to submit content. Sandi Metz recently blogged about ruby case statements being similar to calling is_a? on a particular object, and how we should be using duck typing rather than inspecting the type of the class. He
Note: This post is inspired by JEG2’s excellent code reading talk at MWRC 2009, called LittleBIGRuby Go watch it if you have time, then come back and read this. We all need to hunt bugs and we all need to integrate our code with other systems. Some of us need to make use of undocumented libraries, and others need to examine code code to perform security audits. Why is it then, that so many develop
All Posts (feed) Solve the problem, not just a problem Geeks are prone to build complex tools to solve problems, but the real goal is to solve the right problems. The Korma blogging tool hits that sweet spot. 2009-04-13 20:11 by James Britt Using Blocks for Robustness One way to look at Ruby's blocks is as anonymous functions and one of the uses of them is to make your code more robust. 2009-04-
このページを最初にブックマークしてみませんか?
『Ruby Best Practices -- Blog』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く