90% of the Ruby code I’ve written the past few years has been class methods without shared state. The code has clearer dependencies and is easier to read, test and maintain. OOP has its place, but I don’t think it fits the majority of web-app logic.
- 粉丝规模
- 3.8万关注 478
- 日常浏览中位数
- —30天 0条
- 收藏率
- —
- 网络权威分
- 54/ 100
- 30 天黑马爆款
- 0收录于 2026-11-26
近 90 天已收录 0 / 5 条有效公开帖,满 5 条后计算日常浏览基线。
近 3 天粉丝成长曲线
移动鼠标查看每日粉丝变化
近 14 周发文节奏
收录于 2026-11-26,已记录 0 天公开动态;收录前暂无历史数据。
- 14 周推文
- 0
- 活跃发文日
- 0/4
- 活跃周数
- 0/1
- 周均产出
- 0.0
- 单日峰值
- 0
- 高频星期
- —
Git tip: Enable 3-way diffs for merge conflicts. It shows the original content between the two changes so you have a better understanding of what has changed: git config --global merge.conflictstyle diff3
TIL about t.co/LN9BSGFViE, a collection of commands to configure macOS through the command line.
Git tip: What if you want to amend an earlier commit? I have this function in my dotfiles.
gfix() { git commit --fixup $1 && git rebase -i --autosquash $1^ }
Stage changes and run `gfix <commit-sha>`. This will open interactive rebase in your editor so you can review.
Goodbye Google Search. Hello Perplexity! t.co/S7DVLcQqmv
Whenever you’re tempted to reuse a method that *almost* does what you want: Stop, duplicate the method, make the modifications, and then refactor the actual duplication.
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.
OOP is great for games, simulations and UIs that have independent entities whose behavior largely depends on their internal state. I find processing web requests is clearer with a more procedural style – a list of instructions that need to be performed in sequence.
Over the past year I’ve been favoring class methods over PORO (plain old Ruby objects) for business logic and love this approach. So much easier to organize, test, reuse and refactor.
Tip for mac users: Make a shell script of `defaults write` commands to set up macOS the way you like it. Then just run the script when setting up a new system. (see t.co/LN9BSGFViE for possible commands)
I love how Ruby handles keyword arguments. I miss them in just about every other language.
We all have different apps with different requirements. If vanilla Rails is plenty then I think vanilla Rails does too much. t.co/d1ZhCKsTdA
Ruby’s metaprogramming is like a forbidden fruit. Always there tempting me, and I almost always regret using it.
What an awesome little game Replicube is. It’s like Picross 3D meets shader programming. The puzzles are a fun challenge and the interface is charming. Thanks @walaber! t.co/KtrCIxlQLp
Git tip: I like to keep a clean git history on my local branch. I often run `gcn!` to amend the staged changes to the previous commit. This is an alias I stole from oh-my-zsh.
alias gcn!='git commit --verbose --no-edit --amend'
I Googled “capybara drag_to” and the results caught me by surprise.
I’m tempted to set `travel_to` in every test for constant time and then intentionally testing edge cases such as leap year, daylight savings, odd time zones, etc. Anyone do this?
Anyone else find GitHub code diffs near impossible to use in Safari lately? Slows to a crawl and/or doesn’t render.
One benefit of giving each major feature its own namespace is you can easily run tests for that feature.
$ rspec spec/**/some_feature
Anyone participating in Advent of Code this year? I’m doing it in Gleam: t.co/ve2dPLWfyC
同领域相似创作者
浏览 科技与产品 全部创作者 →Chris Oliver 构建 Rails 产品,并分享实用的 Rails 开发与安全知识。
Ruby on Rails 官方账号发布框架更新、安全公告、社区进展及编程智能体评测。
软件教师与视频创作者,同时担任 SDR 播客联合主持人。
专注数据可视化的工程师,Beyond Code 播客联合主持人及 Markvis 制作者。
