Ryan Bates Profile Banner
Ryan Bates Profile
Ryan Bates

@rbates

38,491
Followers
506
Following
51
Media
14,267
Statuses

Producer of RailsCasts - Ruby on Rails Screencasts

Southern Oregon
Joined March 2008
Don't wanna be here? Send us removal request.
@rbates
Ryan Bates
9 years
Hello, world!
584
917
1K
@rbates
Ryan Bates
7 years
Announcing: RailsCasts Pro and Revised episodes are now free! Anyone can watch them without a subscription at
84
597
1K
@rbates
Ryan Bates
7 years
For those wondering how I have been, I am now happily engaged! We will be getting married this summer.
Tweet media one
113
32
987
@rbates
Ryan Bates
7 years
I am now married! We are back from our honeymoon in Australia and everything has been better than I imagined.
Tweet media one
93
12
953
@rbates
Ryan Bates
2 years
Active Record tip: Pass an incomplete range to a `where` clause do a greater/less than comparison.
Tweet media one
18
72
562
@rbates
Ryan Bates
7 years
I have started working for @reinteractive and loving it so far. It feels great to get back into Rails development!
40
46
519
@rbates
Ryan Bates
4 years
To make amends, @digitalocean donated $5,000 to an open source project of my choice. I chose Stimulus Reflex, @hopsoft and team have done an amazing job. What a classy move DO, thanks!
14
43
519
@rbates
Ryan Bates
1 year
Why do I have no plans to restart RailsCasts? I produced content that I personally wanted to watch. I scratched my own itch, and the itch isn’t there now.
64
10
507
@rbates
Ryan Bates
2 years
Clever code requires a high skill level to write, an equally high skill level to read, and an even higher skill level to debug. Embrace dumb code.
15
83
404
@rbates
Ryan Bates
2 years
I love doing full-stack web development. It's satisfying to solve a problem from beginning to end across the entire stack.
14
26
396
@rbates
Ryan Bates
2 years
I will never understand the npm culture of adding an external dependency to save 5 lines of JavaScript.
33
40
396
@rbates
Ryan Bates
2 years
My wishlist for the JSON format - trailing commas - keys without quotes - comments
21
26
380
@rbates
Ryan Bates
8 months
The more I work with Ruby the less metaprogramming I do: Monkey patching, method_missing, respond_to, instance_eval, etc. I will often prefer a more direct approach even if it means making the code more verbose.
16
11
322
@rbates
Ryan Bates
4 years
I no longer recommend DigitalOcean for hosting. They pulled the rug out from under me. RailsCasts has moved back to @linode .
32
40
281
@rbates
Ryan Bates
1 year
If you make something that you personally want and can’t find anywhere else, chances are others will want it too. This is how RailsCasts became successful with zero marketing.
13
11
219
@rbates
Ryan Bates
2 years
Anyone else have difficulty reading Ruby code that makes heavy use of modules? I have no idea where a given method is defined or what methods are available in a given context.
48
6
215
@rbates
Ryan Bates
4 months
It is often said Ruby is optimized for programmer happiness. I say it’s optimized for short-term happiness at the cost of long-term happiness. A joy to write, but can be difficult to maintain.
35
15
216
@rbates
Ryan Bates
2 years
My programming journey: - Early career: Copy & paste code that does almost what I want then modify it. - Mid career: Reuse existing code whenever possible to stay DRY. - Late career: Copy & paste code that does almost what I want then modify it.
4
29
205
@rbates
Ryan Bates
2 years
Pro tip: If you always use the “auth” abbreviation you never need to learn the difference between authentication and authorization. 😉
2
15
202
@rbates
Ryan Bates
2 years
Active Record callbacks that trigger other callbacks are very difficult to debug. To avoid this, don’t save models in callbacks. You can also use services instead of callbacks to be more explicit.
13
22
198
@rbates
Ryan Bates
3 years
One of the few issues I have with web development is that our work is never complete. There is satisfaction in calling something “done”.
17
8
188
@rbates
Ryan Bates
2 years
If you can’t remember the name of an internal method, make a guess. If it’s wrong, rename the method to match the guess.
8
13
182
@rbates
Ryan Bates
1 year
Finally found a Ruby formatter I’m happy with: syntax_tree. It is fast, integrates well with VS Code, and I love the output.
5
10
177
@rbates
Ryan Bates
1 year
Glad to see is still up and running.
15
1
176
@rbates
Ryan Bates
2 years
Every new feature, every new dependency, and every new line of code has a maintenance cost that can sometimes outweigh the initial development cost.
5
23
174
@rbates
Ryan Bates
9 years
If you want to learn functional programming without tackling a new language, check out this free, online book: http://t.co/ZrLouzEQGm
2
72
170
@rbates
Ryan Bates
9 years
Thanks for the warm welcomes everyone. So many that you crashed my Twitter client.
31
48
160
@rbates
Ryan Bates
4 years
For those interested in the full story, here's what happened between me and @digitalocean :
14
25
164
@rbates
Ryan Bates
9 years
How to write a Git commit message: http://t.co/D31dVh1lks
3
114
157
@rbates
Ryan Bates
2 years
When closing an issue/ticket due to user error, consider opening a new issue to improve documentation or to make the interface more intuitive to reduce the chance of the error happening again.
4
18
158
@rbates
Ryan Bates
2 years
Dividing code changes into Git commits is a skill that improves over time. It can be challenging at first to make small, meaningful commits that keep tests passing.
5
17
156
@rbates
Ryan Bates
2 years
The most reliable way to find bugs in your code? Let someone else use the app while you watch.
11
15
155
@rbates
Ryan Bates
3 years
This question also helps me with procrastination: What would my life be like if I repeated what I did today on every day for the rest of my life?
12
19
149
@rbates
Ryan Bates
9 years
Some great graphic design tips for us programmers. Part 1: Part 2:
2
65
140
@rbates
Ryan Bates
2 years
I wish Twitter and Mastodon supported `code formatting`.
13
4
140
@rbates
Ryan Bates
2 years
I need to call Jury Duty every evening this month to see if my number is mentioned, so naturally I hacked together a Ruby script to do it for me. It uses Twilio to call, transcribes the message, and texts me the result. Here’s the gist:
9
11
139
@rbates
Ryan Bates
2 years
Passing a boolean to a method is a code smell. There’s often a conditional shortly after that uses the boolean. Try refactoring the code by making a separate method to remove both the conditional and the boolean.
11
11
139
@rbates
Ryan Bates
9 years
Yes, I came back after two years to retweet cat pictures.
8
40
136
@rbates
Ryan Bates
2 years
Ruby, I love you, but you sure do make it easy to shoot myself in the foot.
17
5
129
@rbates
Ryan Bates
2 years
I’m impressed by Goldiloader. I recently added it to a large Rails app and it made nearly all `includes` calls redundant and solved quite a few other N+1 queries automatically.
3
14
126
@rbates
Ryan Bates
9 years
Trying out @elixirphoenix today. I'm impressed!
9
76
126
@rbates
Ryan Bates
8 months
Verbose code is often easier to understand and grep. It’s a little more work to type, but that’s rarely the bottleneck.
12
12
124
@rbates
Ryan Bates
3 months
I’m convinced Rails engines are almost never the right abstraction for a gem. The view/controller layer is too app-specific. Use generators instead.
12
7
125
@rbates
Ryan Bates
9 years
Programming is easy until you start typing. And then it's hard.
11
140
114
@rbates
Ryan Bates
2 years
Has anyone tried changing their Rails app directory structure to vertical slices (feature based) instead of horizontal layers? Any success?
39
10
114
@rbates
Ryan Bates
8 months
The hash shorthand is my favorite addition in recent Ruby. {foo:} instead of {foo: foo}. It makes passing named arguments around so much more convenient.
8
3
115
@rbates
Ryan Bates
3 years
Procrastination happens when what you should do doesn’t line up with what you want to do. Find a way to change one side or the other to line them up.
6
13
110
@rbates
Ryan Bates
8 years
Try taking "I should" out of everyday vocabulary and replacing with "I want". It helps to think twice about our own pressures.
7
38
106
@rbates
Ryan Bates
2 years
My advice for organizing a large code base: Use namespaces. A lot.
6
9
107
@rbates
Ryan Bates
2 years
It’s sad how often a large service is down but their status page is green.
11
4
106
@rbates
Ryan Bates
2 years
Advice for conference speakers: Aim to inspire more than educate. There are more efficient mediums for education. Inspiration can be life changing.
1
11
105
@rbates
Ryan Bates
3 years
I recently watched this excellent video on agile team organization and recognized the voice from a Minecraft dev video. I did not expect some of my favorite things to collide. You made my day @henrikkniberg !
1
5
103
@rbates
Ryan Bates
7 months
If you’re using VS Code, the Alternate File extension is awesome for quickly switching between Ruby source, specs, and view component templates. I should have used this sooner!
6
5
103
@rbates
Ryan Bates
9 years
Money saving tip: whenever you want to buy something, first wait a week. Often you will forget about it or realize you don't need it.
9
64
97
@rbates
Ryan Bates
2 years
I’m a little jealous of Phoenix’s HTML-aware component templates.
10
7
97
@rbates
Ryan Bates
4 years
Update on @digitalocean : They sent a thoughtful apology and are willing to continue sponsoring RailsCasts. While I do appreciate their years of sponsorship in the past, I have no plans to go back to DigitalOcean.
5
3
97
@rbates
Ryan Bates
3 years
If an idea doesn’t stick well enough to be implemented now, don’t be afraid to toss it. Good ideas tend to float back up to the surface in a muted state that stays relevant.
4
3
97
@rbates
Ryan Bates
2 years
Developers are constantly trying new things they have never done before. It comes with the field. A good senior developer is a good beginner.
2
21
95
@rbates
Ryan Bates
1 year
Git Tip: Running `git checkout -` changes to the previously accessed branch just like `cd -` changes to the previous directory. You can use it with other commands too such as `git rebase -` to rebase off of the previous branch.
5
19
94
@rbates
Ryan Bates
3 years
Is Ruby on Rails your preferred framework for backend web development these days?
Yes
2993
No
1583
I don’t do backend dev
223
64
22
92
@rbates
Ryan Bates
12 years
Thanks everyone. Here's a list of tunneling services: http://t.co/foacTFZ7 http://t.co/Hk8cpMes http://t.co/ux2gr7kv
4
12
87
@rbates
Ryan Bates
9 years
Let me get this straight. Dynamic typing is old stuff and strong typing is the cool new thing? We change faster than the fashion industry.
18
59
87
@rbates
Ryan Bates
8 months
I’m setting up a new MacBook Pro and accidentally put my mouse on the edge of the screen. The mouse showed up on my other laptop! Dragging files across works seamlessly too. What is this sorcery?!
19
0
87
@rbates
Ryan Bates
12 years
Oh, and if you're wanting a GUI interface for a database, Induction is looking promising: http://t.co/ymVFiJls
6
40
85
@rbates
Ryan Bates
2 years
Us 10 years from now: Remember that NFT thing?
6
8
85
@rbates
Ryan Bates
2 years
@JasonSwett I recorded RailsCasts episodes in a closet because it was the quietest place in the house. I don’t recommend it.
11
2
83
@rbates
Ryan Bates
2 years
Oops, I ran `brew upgrade redis` to upgrade Redis and it’s upgrading every package under the sun. Apparently I should have run `brew install redis` to upgrade Redis. 🤦‍♂️
20
3
82
@rbates
Ryan Bates
2 years
@ShinoKouda The solution? Keep inventing new places to put logic. Start with PORO. Abstract it into a complex framework. Decide logic doesn’t belong. Rinse and repeat.
1
2
82
@rbates
Ryan Bates
12 years
Finally a debugger for Ruby 1.9.3:
4
119
78
@rbates
Ryan Bates
13 years
It's amazing how much can be done with CSS these days. Here's a nice collection of techniques: http://bit.ly/fLPeo0
0
49
79
@rbates
Ryan Bates
5 months
Command line tip: Do you ever forget what aliases you have set up for commands you run frequently? Running `alias` without any arguments will list them all. Pipe this to fzf for easy searching: `alias | fzf`
3
7
80
@rbates
Ryan Bates
12 years
Cool, Ruby and Rails doc apps for iOS: http://t.co/DasHmv36
4
92
78
@rbates
Ryan Bates
2 years
My favorite feature of JavaScript? Modules. My least favorite feature of Ruby? Modules.
9
7
75
@rbates
Ryan Bates
9 years
So, what do you consider to be the most significant change in web development over the past two years? What have I missed?
130
49
73
@rbates
Ryan Bates
8 months
When writing business logic, I used to favor POROs (Plain Old Ruby Objects). Now I prefer class methods and extract POROs through refactoring. I still keep the class method around as the interface for the logic.
4
1
72
@rbates
Ryan Bates
2 years
The improved `end` syntax error message is the feature I’m most excited about in Ruby 3.2, and there are some great features!
2
5
72
@rbates
Ryan Bates
2 years
Verbose code is often viewed as a negative, however being overly-concise is worse when it hides important details needed for debugging and understanding the code. Dependencies, state manipulation, and namespacing are all areas I prefer to be verbose and explicit.
4
6
71
@rbates
Ryan Bates
2 years
Don’t fear duplicate code. Fear undocumented duplication. Add a comment to both sides of duplicate/similar code to hint at potential refactoring.
1
7
69
@rbates
Ryan Bates
12 years
Cool, @heroku released a PostgreSQL app for OS X: http://t.co/CzWfrOPD
4
80
69
@rbates
Ryan Bates
2 years
Five years ago today we lost @jseifer . While I only met him a few times, I’ve always appreciated his sense of humor and the joy he brought us through it. Here are some of the skits he did with @greggpollack . May he continue to make us smile!
1
11
67
@rbates
Ryan Bates
3 years
@rafaelfranca The only reason I didn’t follow you sooner is I haven’t been active on Twitter in years. Thank you for your work on Rails!
1
0
68
@rbates
Ryan Bates
2 years
Avoid polluting existing code when adding new features.
3
10
68
@rbates
Ryan Bates
13 years
Compare many JavaScript frameworks through these Todo app examples: http://t.co/xx1qn2G1
2
47
66
@rbates
Ryan Bates
2 years
What subject from grade school is the most useful as a programmer? Surprisingly I rely more on Language (English) than Math.
18
6
66
@rbates
Ryan Bates
12 years
If you haven't watched the @meteorjs screencast yet... You should. http://t.co/sBiHkJXg
5
40
60
@rbates
Ryan Bates
2 years
Software development is like casting a 3D object onto a 2D plain. Attempting to model every aspect of a complex domain can become a mess. First choose an angle and build a beautiful representation of the domain that is intentionally limited for the software medium.
3
11
60
@rbates
Ryan Bates
8 months
I surround code changes with two different types of refactoring: pre and post change. Pre-change refactoring is to make the change easier to implement. Post-change refactoring is to make the code easier to understand.
3
5
64
@rbates
Ryan Bates
9 years
Swift becoming open source? Now I'm interested.
5
54
64
@rbates
Ryan Bates
2 years
It’s nice that RubyMine helps read code that makes heavy use of modules/mixins, however I wonder if this furthers the problem by masking readability issues. A good goal is code that is easily readable outside of an IDE.
13
4
62
@rbates
Ryan Bates
2 years
How you communicate with developers through code is more important and challenging than how you communicate with the machine.
5
13
61
@rbates
Ryan Bates
2 years
Attempting to satisfy the requirements of different types of users through a single UI can lead to a sub-optimal experience for all users. Consider splitting the UX (or even the entire app) around the type of user to provide focus and reduce the requirements.
3
2
61
@rbates
Ryan Bates
3 years
High performance can cover a myriad of UX issues. I'd rather do 5 clicks at 50ms each than 2 clicks at 500ms each to accomplish the same thing.
0
2
60
@rbates
Ryan Bates
2 years
How I stack pull requests in GitHub: 1. Enable “Automatically delete head branches” under General settings. 2. Set base branch when creating stacked PR. 3. Merge bottom (oldest) PRs first. This automatically changes next PR’s base to “main”
2
8
60
@rbates
Ryan Bates
9 years
"What do you do for a living?" "I'm the April Fools guy at Google, it's a full time, year-round job."
2
27
61