Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dhh
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
dhh
6y ago
I get the rush to provide technical comparisons to something that was just revealed five minutes ago, but none of what you just said is actually how Hotwire or Turbo works. There's no client DOM in memory on the server, there's no
2.
▲
by
dhh
12y ago
Rails will have custom configuration built-in from 4.2, but you can also just use the gem today: https://github.com/dhh/custom_configuration Then you can centralize all your configuration in config/environments&#x
3.
▲
by
dhh
12y ago
Incentivizing any behavior is likely to end in ruin: http://www.alfiekohn.org/books/pbr.htm
4.
▲
by
dhh
12y ago
Here are some Rails sites: Basecamp, Github, Shopify, Airbnb, Soundcloud, Indiegogo. All have millions of users.
5.
▲
by
dhh
12y ago
I'm working with code bases that have passed the decade mark now. They're not of trivial size. They're still imminently maintainable. They are proudly Rails Applications.
6.
▲
by
dhh
12y ago
Everyone has their own definition of complexity. I make no mince about a decade worth of developing Basecamp is where I draw my primary experience from. That system is small by web scale standards -- only 70 million requests/day, 1.5 t
7.
▲
by
dhh
12y ago
Responsive views only go so far. Trying to shrink an app designed for a desktop browser down to a 4" phone is a fool's errand. Much easier to go with different templates in that case.
8.
▲
by
dhh
13y ago
Love when people play code ping pong. There's too much talk and not enough play in these threads. But I have to ask you, do you really think that splitting out those two classes improved things for the example? Or was this just future
9.
▲
by
dhh
13y ago
Yes, when stumbling across bad code, the first instinct should be: how can I make this simpler. Not how can I wrap this bad code in more convoluted patterns. Don't use a big word when a small one will do. Additionally, I find that the
10.
▲
by
dhh
13y ago
On a separate note, I feel like this article series might better be titled "The Missing Parts of Our Knowledge of Basic Rails Features". Reinventing basic features doesn't make your Rails deployment "advanced", it j
11.
▲
by
dhh
13y ago
Ensuring that the Ticket is valid is obviously a domain model concern. Policy objects can be a fine idea when they're swappable and you need to allow for multiple different policies. This is not one of those cases. Here's a much s
12.
▲
by
dhh
13y ago
I asked for specific code, you gave me specific code, so here's how I would have structured that without the (imo, needless) command pattern: https://gist.github.com/dhh/9348053 It includes a lot of more context t
13.
▲
by
dhh
13y ago
Please do share the 3 or 4 controllers all sharing this logic. I'd be happy to play code pong with them.
14.
▲
by
dhh
13y ago
Let's just say I have philosophical differences with the views presented in that presentation. Also, I never said never. I said this particular example was a poor example and the general principle derived from it was equally poor. Garb
15.
▲
by
dhh
13y ago
Why would the delivery of the emails fail? Because your SMTP server is down? That's an exceptional state, handle it with exceptions -- not with conditions. Or maybe because the email addresses are invalid? Handle that when they are cap
16.
▲
by
dhh
13y ago
If reassigning a case is part of the domain, it belongs in the model. I don't know how to put this gently, but this concoction looks like a hot mess with no separation between modeling and controlling. These commands have a ton of doma
17.
▲
by
dhh
13y ago
Yes, rewriting a system after it's already settled and designed can indeed bring a cleaner code base about. But don't confuse that with "better architecture". Don't even get me started on the hand-wavy "loosely
18.
▲
by
dhh
13y ago
Here's another version that doesn't even use private methods in the controller and uses a PORO for the email grouping: https://gist.github.com/dhh/9333991
19.
▲
by
dhh
13y ago
Coulda, woulda, damn shoulda. You're future coding with your "what ifs". Most controller actions are not reused. The time to extract for reuse is when you need to reuse. Not crystal balling about that you probably will be in
20.
▲
by
dhh
13y ago
I rewrote the code in this example to use the "Beginner's Version" of Rails ( sigh ). You judge which you like better: https://gist.github.com/dhh/9333694
21.
▲
by
dhh
13y ago
The proof is always in the pudding. While there are good and reasonable times to introduce "interactors", this particular example is poor. The tests presented are anemic, and the code is absolutely not any clearer by being extract
22.
▲
by
dhh
13y ago
By this I hope you mean that the smaller it is, the better. /lib is intended for non-app specific code. The halfway house before code is extracted into either a Rails PR or a separate gem.
23.
▲
by
dhh
13y ago
It relies on a header, which can't be set through the attack vector, so it's all kosher.
24.
▲
by
dhh
13y ago
We reuse all controllers and models for our mobile views and for our API. We just do that reuse at the server instead of through the client. So no loss there.
25.
▲
by
dhh
13y ago
I think you're forgetting that Rails was created for free, in my spare time, while I was being paid $30/hour working for 37signals and other US clients on a variety of projects. But that's even besides the point. Companies le
26.
▲
by
dhh
13y ago
Once that statement is true, Rails will BE the enterprise. Don't bank on it. (And by that I mean we'll continue to release new versions that at times will be backwards incompatible and require work to upgrade to).
27.
▲
by
dhh
14y ago
37signals has 36 employees, less than ten of them is likely to be in the office at any one day. Working remotely is not an all or nothing proposition. You can have some people in an office, others remotely. But of course you knew that and w
28.
▲
by
dhh
14y ago
The first draft is already 90% complete and the book has been sold to the publisher. The decision to write this book was taken months ago.
29.
▲
by
dhh
14y ago
Californians pay 13% state taxes plus 37% federal at the top end. Not that far off the 57% then.
30.
▲
by
dhh
14y ago
The "enterprise" bit is a misnomer for this book. Doesn't have anything to do with enterprise. I love talking about patterns when the discussion is centered around actual code. Which is exactly why PoEAA is so good.
More ›