News for hackers. Stuff that matters.
Re:Don't make me think, or why I switched to Rails from Java... by jmondi on Friday February 04, 2022 @12:15PM (#30209595)
As someone who came from other MVC frameworks outside of Ruby, learning Rails has been a cluster-f of searching through documentation circa 2013. The whole rails “convention over configuration makes it easier” is a load of bologna, because the only way to know the “convention” is to either have gone to a rails boot camp, reading the docs top to bottom, or maybe watching rails casts.

The best way to work on rails is to either already know rails yourself, or be working with a rails guru, which admittedly there are a bunch of those.

At least with a configuration over convention you can just look at the code and figure out what is happening. With rails, there are certain magical things you just Need To Know and the only way to know those things are to already know them before running into it.

Re:Don't make me think, or why I switched to Rails from Java... by matt_mb on Friday February 04, 2022 @12:37PM (#30209914)
"Reading docs top to bottom" is the answer to this frustration. It's strange that people don't think this is something they should do.
Re:Don't make me think, or why I switched to Rails from Java... by sodapopcan on Friday February 04, 2022 @12:51PM (#30210109)
I was going to say the same thing and figured someone else already had.

People would often ask how I knew so much about rails and, ya, the answer is that I read the guides. They are extremely readable and it doesn't take that long. Like a couple of days. You might be surprised how much is retained by just reading through them, even without actually trying things out as you go.

I would like to stress: read the guides, not the docs. Use the docs for reference.

Re:Don't make me think, or why I switched to Rails from Java... by chowells on Friday February 04, 2022 @02:55PM (#30212100)
I've skimmed the guides. They never contain anything useful. They're just a bunch of recipes. They don't actually document a darned thing.

Programming is not regurgitating recipes without understanding. Copilot can do that. Programming is actually understanding both the problem domain and the solution space, and knowing how to find some permutation of elements in the solution space to address anything in the problem domain.

The rails guides document about 10% of the problem domain. That's mostly ok, because the problem domain exists in the wider world, and there's lots of documentation elsewhere. The problem is that the rails guides document about 1% of the solution space. And that's an issue, because rails claims to be the solution space.

Rails routing is done by passing a block into the framework that's instance_exec'd on... Something. Want to know what, so that you know what API is available to you? Too bad. Here are a list of recipes for the couple most common things you might want to do. Want to do anything more sophisticated, or just understand what your options are? Uh, sorry.

Oh, you want to set and read cookies? Here's a recipe for how to read cookies and how to set them with lots of options. You changed how you're setting cookies and now browsers are returning two cookies of the same name and you want to know how to detect and fix this? Silence from the rails guides! (In fairness, the rack documentation actually included enough information to solve that. But it wasn't mentioned in the rails guides about cookie handling. And the rack documentation was a specification, not a guide. It actually tells you what pieces there are and describes their semantics.)

And it just goes on and on. Rails has about one hundred options for every one actually mentioned in the guides. In some sense that's a good thing. The guides only give you an incredibly limited set of tools. It's very good that the rest exist. But it means that the guides are a very bad way to learn rails, because they don't give you enough information to solve unforeseen problems yourself, or even enough information to understand code someone else wrote to solve those issues.

They put you in the position of hoping someone else anticipated your weird problem and already told you how to solve it. They don't equip you for solving anything weird by yourself.

Re:Don't make me think, or why I switched to Rails from Java... by sodapopcan on Friday February 04, 2022 @03:35PM (#30212729)
This feels pretty stawman-y to me. They are meant to be highly digestible examples of everything the framework has to offer. They can be read through quite quickly, yet people still fail to and then you have people who don't know what scopes are or reinvent ways to do enums and what-have-you just because they weren't aware this stuff exists already. If you need to drill down into a specific topic, that's what the docs and blog posts are for. Having the level of detail you describe in the guides would only turn-off newcomers even more.
Re:Don't make me think, or why I switched to Rails from Java... by multiplegeorges on Friday February 04, 2022 @03:43PM (#30212876)
The guides are great for someone doing what most people use Rails for. Recipes with some side cases are very appropriate for that audience.

If you want to know more about an API, there's https://api.rubyonrails.org and the classes are quite will documented. These docs don't show up in the guides and might be what you're looking for. I should also point out that the API docs are directly linked in the header of the Guides.

Specifically for routing, there's lots of additional detail here: https://api.rubyonrails.org/classes/ActionDispatch/Routing/M...

Re:Don't make me think, or why I switched to Rails from Java... by ryukoposting on Friday February 04, 2022 @04:52PM (#30213828)
> Programming is not regurgitating recipes without understanding.

Call me cynical, but the problem with this argument is that professional software development is about making something that fulfills a set of requirements, and ideally is modular+generalized enough in its design that it can be reused in the future to reduce future development time+costs.

With this in mind, I can see why the Rails documentation wouldn't really care if you learn how Rails works- all they care about is that you know how to use it.

This isn't to say that the desire for greater understanding is bad, just that it's not an effective way to keep an aging, tried-and-true web framework relevant.

Re:Don't make me think, or why I switched to Rails from Java... by pech0rin on Saturday February 05, 2022 @05:55AM (#30219952)
You do know you can read the api documentation right? Also you can read the code. The guides are not supposed to have every answer to bugs you encounter. 1% of the solution space? Please, youre so far off it’s laughable
Re:Don't make me think, or why I switched to Rails from Java... by boredtofears on Friday February 04, 2022 @04:26PM (#30213488)
Err, wouldn't you look at the source for most of these things? What framework do you use where that isn't true?
Re:Don't make me think, or why I switched to Rails from Java... by jonahx on Saturday February 05, 2022 @11:42AM (#30222861)
The source is an over-engineered mess of nested abstractions. So yes, you can do this, and I have, but it's not a lot of fun.
Re:Don't make me think, or why I switched to Rails from Java... by danielheath on Friday February 04, 2022 @03:50PM (#30212990)
Want to know what’s available somewhere? Write “public_methods - {}.public_methods” to stdout.
Re:Don't make me think, or why I switched to Rails from Java... by pricci on Friday February 04, 2022 @04:44PM (#30213740)
I like doing "ls" in pry.
Re:Don't make me think, or why I switched to Rails from Java... by jbverschoor on Sunday February 06, 2022 @03:03AM (#30230419)
I did the same for Java, FreeBSD, rails, and in the past the directx docs

Documentation is important. Otherwise you’ll just google for tutorials which are often outdated and still don’t cover the architecture/design.

It’s also fun to see all the little decisions and tools available if you read (properly written) docs

Granted you need to have proper docs

Re:Don't make me think, or why I switched to Rails from Java... by mirekrusin on Friday February 04, 2022 @12:45PM (#30210042)
When people ask me how to improve their programming this is my first advice - speed read docs/stdlib top to bottom and keep writing a lot of little things. It’s amazing how many people choose painful path of learning through osmosis.
Re:Don't make me think, or why I switched to Rails from Java... by jmondi on Friday February 04, 2022 @12:55PM (#30210176)
If you want to make an app from scratch, you must first understand the universe.

This is a ludicrous approach for most. Sure, if you learn from reading and love to read technical manuals, go for it. But to imply this is the best way for most to learn is completely ridiculous.

Re:Don't make me think, or why I switched to Rails from Java... by weaksauce on Friday February 04, 2022 @01:43PM (#30211112)
> This is a ludicrous approach for most.

there are about 35 guides in the rails guide list and half of those are digging deep into the framework... reading the first 10 of them would get you about 95% of what you really need to know in rails so that you can look up stuff later. hell even just doing the getting started guide walks you through a fairly complete rails application.

https://guides.rubyonrails.org/

Re:Don't make me think, or why I switched to Rails from Java... by clairity on Friday February 04, 2022 @02:58PM (#30212142)
yah, that's what i did when i first got into rails (~3.0/3.1): read 5-10 of the guides while working through michael hartl's tutorial and reading/watching a number of railscasts (which are dated now, but still have good basic info).

i'm working (slowly) on a personal project in rails 7 using all the hotwire with importmaps newness, and so far, it's been so much better than recent rails' diversion into all that node/yarn/webpacker mess.

Re:Don't make me think, or why I switched to Rails from Java... by weaksauce on Friday February 04, 2022 @08:55PM (#30216262)
I just put all the essential ones through firefox reader mode and the high end of reading them at what is what an average reader can read at based on the word count and it puts it at 10.31 hours of reading. that's a basically complete understanding of rails that most people don't have. to get 80% there you could probably skim most of them and read the main articles on models, views, and controllers and be done in a few hours. (firefox uses a somewhat naive approach though that just counts words and can't distinguish new code vs. the interesting bits so i'd wager the time is less since there is a lot of repetition in code)

it's not a ton of investment compared to how much time it would save you if you use rails later.

Re:Don't make me think, or why I switched to Rails from Java... by wtallis on Friday February 04, 2022 @01:26PM (#30210854)
"Best way to learn" seems too vague to have a productive conversation about. If your goal is to become proficient with a framework, then reading the docs top to bottom is probably a great thing to do, but if you merely want to hack together a one-off project over a weekend then it's probably not worth investing the time to exhaustively learn about all the features and paradigms of that framework.
Re:Don't make me think, or why I switched to Rails from Java... by jmondi on Friday February 04, 2022 @02:28PM (#30211688)
Did you learn English by reading the dictionary top to bottom? I’m gonna go ahead and guess that no, you didn’t. You learned English by being surrounded in it and practicing.
Re:Don't make me think, or why I switched to Rails from Java... by wtallis on Friday February 04, 2022 @02:35PM (#30211786)
You're being strangely combative in this thread, as though you are personally offended by something. What's your problem, and why are you letting it drive you to make such weak arguments? Do you have some past trauma related to being forced to read, or is it just bad experiences with Rails specifically?

It really doesn't take more than a few seconds to figure out why your analogy of learning a language by reading a dictionary written in that language is both stupid and inapplicable here, so I'm not going to try to further address that aspect of your comment (especially since you don't seem inclined to directly respond to anything in my comment).

Re:Don't make me think, or why I switched to Rails from Java... by jmondi on Friday February 04, 2022 @03:23PM (#30212534)
You’re right, I apologize. You are right that my analogy is stupid on a bunch of different levels.

I’ve been surrounded by so many rails fans who use it for every possible problem. “If all you have is a hammer, everything is a nail” was the epitome of what was happening. Then being left with trying to sift through old versions of documentation, trying to figure out what is the “current” way of doing things in rails vs the previous ways, aye yi yi. Rails has definitely left me with a sour taste in my mouth.

I’m not saying rails is bad, it is great in so many situations. I’m just saying it is not a silver bullet, and the cult behind it has some real blinders on.

I stand by my original argument though that for most people, reading documentation top to bottom isn’t the best way to learn. If it works for you, great.

Re:Don't make me think, or why I switched to Rails from Java... by 4m1rk on Saturday February 05, 2022 @02:31AM (#30218724)
People who throw Rails at any problem, either have not maintained a Rails project for long enough or they don't know any other alternative tech.
Re:Don't make me think, or why I switched to Rails from Java... by mirekrusin on Friday February 04, 2022 @03:36PM (#30212756)
Programming language is not natural language, think more how did you learn math?
Re:Don't make me think, or why I switched to Rails from Java... by bluefirebrand on Friday February 04, 2022 @04:37PM (#30213637)
By having stuff demonstrated by a teacher and then repeatedly solving small problems.

Not once did I read a textbook front to back.

Re:Don't make me think, or why I switched to Rails from Java... by oblio on Saturday February 05, 2022 @04:43AM (#30219518)
And obviously, talking to classmates. Let's not forget the social aspects of learning.
Re:Don't make me think, or why I switched to Rails from Java... by mirekrusin on Friday February 04, 2022 @03:33PM (#30212693)
You don't need to understand universe, just the tools you'll be using to make an app.
Re:Don't make me think, or why I switched to Rails from Java... by desmosxxx on Friday February 04, 2022 @05:23PM (#30214197)
You have to build the universe first.
Re:Don't make me think, or why I switched to Rails from Java... by weatherlite on Friday February 04, 2022 @12:52PM (#30210137)
You're right but tbh some docs are kinda horrible. Tried to go through the Spring MVC docs, didn't get far. But maybe I was just being impatient idk.
Re:Don't make me think, or why I switched to Rails from Java... by calt on Friday February 04, 2022 @01:25PM (#30210833)
Your sibling comment recommends the guides not the full lib docs, and, assuming your chosen technology has both, I'm inclined to agree with them.
Re:Don't make me think, or why I switched to Rails from Java... by ryukoposting on Friday February 04, 2022 @04:26PM (#30213496)
It's the single most irritating interaction I have had with a coworker, and I have had it at least once at every job I've ever had.

"Hey, thing xyz is super confusing, can you (help me use it|explain how it works|rewrite it so I understand it)?"

"Did you read the document I sent? The document (has sample code that does the thing you're trying to do|explains how it works|explains why the simpler approach doesn't actually work in practice)"

"...No."

It's incredible how some devs can learn 15-20 different programming languages, and completely forget English in the process.

Re:Don't make me think, or why I switched to Rails from Java... by jmondi on Friday February 04, 2022 @12:52PM (#30210141)
Call me crazy, I’d just rather read the relevant section of code I am working on and be able to understand it from there, rather than first having to understand the entire universe.
Re:Don't make me think, or why I switched to Rails from Java... by givemeethekeys on Friday February 04, 2022 @01:33PM (#30210959)
When working with a framework, it helps to understand the framework. Then, all the individual pieces make better sense. The advantage is that you only have to gain this understanding once.
Re:Don't make me think, or why I switched to Rails from Java... by MadcapJake on Friday February 04, 2022 @02:33PM (#30211762)
A framework is a social contract, if you will. The framework authors are taking on the onus of some complexity to give you a cleaner and easier to grok codebase. The tradeoff is that you do need to read the guides or you will be diving deep into framework internals whenever you want to understand some app level code.
Re:Don't make me think, or why I switched to Rails from Java... by Jetrel on Friday February 04, 2022 @03:22PM (#30212517)
The problem with RoR is that it's an all-encompassing framework. It gives you a huge collection of things you typically don't need — entire major layers like the database are frequently completely irrelevant to projects. This isn't just true of small projects, but can often extend to a large part of a career.

One of the grave dangers that older/wiser programmers have learned is to stop trying to pathologically "drink the entire river". Programming has a constant deluge of new frameworks, tools, and publications coming out, and it's easy to fall into the trap of thinking you need to know, well, everything. I know a lot of 'aspiring programmers' who accomplish next to nothing precisely because they waste most of their time reading about programming instead of actually practicing it. It's sadly rather similar to 'aspiring writers', or any other craft — some reading is helpful, but not when it crowds out the actual task it's meant to teach. Life is short, and you have a choice between "actually making things" and "doing prep work for making things". That's all reading the docs is — it's just prep work. It's completely useless unless it parlays into actually accomplishing things.

There are semi-rare cases where some language/framework is actually teaching you new fundamentals and is worth deep-reading to gain core skills as a programmer. Haskell broke new ground. Lisp was enlightening. Smalltalk was a worthy historical study. Rust is genuinely changing things. Unfortunately, Rails just isn't special.

When I was considerably younger, I used to pathologically do this — I used to buy books on programming, and read them like a school textbook "exam cram". I read entire books on languages (like Perl) that ended up exiting the zeitgeist before I ever did any work in them — and I now have no reason to do so (I feel sorry for Perl, because Larry Wall seems like a cool guy, but perhaps it's a testament to its influence on other languages that it no longer has uniquely redeeming features). I even read books on various applications. Naively, at the time, I looked at learning as a pure, unalloyed good — rather than a dangerous spend of lifetime I'll never get back.

I deeply regret wasting that time on that instead of learning a meaningful skill.

Re:Don't make me think, or why I switched to Rails from Java... by multiplegeorges on Friday February 04, 2022 @03:47PM (#30212943)
> Unfortunately, Rails just isn't special.

This is why Rails is so good at what it does.

I don't want it to be special. I want it to be mature, work, and allow me to be productive. I have work to do!

Re:Don't make me think, or why I switched to Rails from Java... by dustymcp on Saturday February 05, 2022 @12:52PM (#30223644)
This, if it works for you and your coworkers thats all that matters.
Re:Don't make me think, or why I switched to Rails from Java... by Lio on Friday February 04, 2022 @05:28PM (#30214263)
> The problem with RoR is that it's an all-encompassing framework. It gives you a huge collection of things you typically don't need — entire major layers like the database are frequently completely irrelevant to projects.

You do know you can just turn off the parts you don’t want, don’t you?

Don’t want database support? Just turn it off or don’t include it in the first place.

Rails doesn’t have to be “special” it just has to get the job done and it does.

Re:Don't make me think, or why I switched to Rails from Java... by Drew_ on Friday February 04, 2022 @12:45PM (#30210044)
Agreed but as evident in this post's discussion, developers only have the desire to do so once for <insert-favorite-web-framework> and then the need to do so again for any other framework is understood as the other being clearly terrible and immature.
Re:Don't make me think, or why I switched to Rails from Java... by arpyzo on Friday February 04, 2022 @06:55PM (#30215285)
This is a fine answer if you're responsible for a small numbers of technologies, otherwise there are far too many "top to bottom" docs to read in a lifetime, let alone the time you have to meet whatever deadline is in front of you.

Where it gets even trickier, is that these days nobody is responsible for just a small numbers of technologies.

Does your app use the internet? Read about TCP/IP and DNS and other internet technologies top to bottom. Does your app use a database? Read the DB docs top to bottom. How about multiple data stores? Is you app publicly facing? Read about 100 different potential security issues top to bottom. I could go on...

Re:Don't make me think, or why I switched to Rails from Java... by 4m1rk on Saturday February 05, 2022 @02:14AM (#30218632)
Only if the docs were good enough! You always have to look at the source code for most Gems and it's full of unnecessary "magic". I guess Django is a much better alternative because of Python different school of thought
Re:Don't make me think, or why I switched to Rails from Java... by boredtofears on Friday February 04, 2022 @12:44PM (#30210030)
I couldn't have had a more opposite experience. My last job was as a solo dev on a legacy Rails 3.2 project. I didn't even know Ruby when I took the job, but have a lot of experience with other MVC frameworks. Learning Rails has mostly been a breeze with a lot of "I wish framework <X> did it this way, this makes a lot more sense" type of moments.

Rails docs are among the best I've ever used for a framework personally. They blow most things in the JS ecosystem out of the water.

Re:Don't make me think, or why I switched to Rails from Java... by atmosx on Friday February 04, 2022 @01:00PM (#30210250)
Apparently people prefer blog posts to docs. This is not a problem of course, until you need to either debug (hence understand what you're doing at depth) or build something non-trivial.
Re:Don't make me think, or why I switched to Rails from Java... by space_fountain on Friday February 04, 2022 @01:38PM (#30211031)
The problem with Rails is not a lack of blog posts or docs, it's that there's often no way to find what doc you need to read without already understanding the framework. Reading the entire docs and then trying to remember and understand it is a style under which some people learn well and I think it is important for mastery, but the ability to trace back and understand a small piece of a framework is valuable too especially when you're first starting out. Certainly when I try to understand something with node or js libraries I don't jump to blog posts, but I am usually able to find what I need to google to to get the docs I want. That wasn't the case with rails when I was first starting
Re:Don't make me think, or why I switched to Rails from Java... by machiaweliczny on Saturday February 05, 2022 @05:19PM (#30226847)
No the real problem with Rails is autoimport and bad tooling that you can't jump to source easily. I would love rails if jump to definition worked well but it's deal breaker.
Re:Don't make me think, or why I switched to Rails from Java... by jack_riminton on Friday February 04, 2022 @01:04PM (#30210309)
Agree. Perhaps the original poster was struggling to get to grips with the MVC setup because beyond that Rails is pretty easy to understand

Sure there are bits of 'magic' but you could build an entire AirBnB clone before you'd need to dive into them

Re:Don't make me think, or why I switched to Rails from Java... by MakerSam on Friday February 04, 2022 @12:43PM (#30210009)
I agree that Rails has a kind of a steep learning curve. Also agree that I didn't find the Rails Casts helpful - I found them out of date, so I didn't spend any time watching them.

For me, learning how to learn a new thing at times seems like the hardest part for me. For Rails, the best I've found is the Michael Hartl tutorial [1]. He walks you through setting up a blog with Rails - first the quick way and then the hard way, so you walk away with a nice understanding. He keeps the tutorial up to date and he's been available for questions when I've emailed him. It costs a few bucks ($39) but well worth it IMHO. I spent a few weeks going through that book, did a few apps on my own, and then was able to create new apps fairly quickly.

The official Rails Guides are a great resource too and kept up to date too [2].

Configuring your local rails development environment is pretty easy with the thoughtbot laptop script [3], otherwise it can be kind of a pain to do it from scratch.

[1] https://www.learnenough.com/ruby-on-rails-6th-edition-tutori... [2] https://guides.rubyonrails.org/ [3] https://thoughtbot.com/blog/laptop-setup-for-an-awesome-deve...

Re:Don't make me think, or why I switched to Rails from Java... by rmbyrro on Friday February 04, 2022 @02:09PM (#30211440)
Shouldn't we read the docs for everything we use?

I'm appalled everything I realize most developers don't actually read docs... It's unbelievable. Do we expect things to work the way each of us imagine? Or what do one expect when starts using something without reading the documentation?

Re:Don't make me think, or why I switched to Rails from Java... by ecshafer on Friday February 04, 2022 @01:37PM (#30211030)
I have the exact opposite experience. I have done a lot of Java - Spring, Node + Angular / React development. And having just started a job with Ruby on Rails, I have never found a new language + framework + ecosystem to be so easy to jump in on and learn and understand. The convention over configuration works really really well.
Re:Don't make me think, or why I switched to Rails from Java... by emodendroket on Friday February 04, 2022 @12:38PM (#30209932)
If that's not bad enough you're probably working on a legacy app with a whole bunch of mix-ins, proxies, Active Record callbacks, and other nonsense that makes it nigh on impossible to understand what any code does.
Re:Don't make me think, or why I switched to Rails from Java... by weatherlite on Friday February 04, 2022 @12:54PM (#30210162)
Saying that mixins and callbacks are always incomprehensible is silly. They're just a way to pack up code and they can work beautifully. If you don't wanna use them you're gonna have to write the logic in some alternative way, so a bunch of service objects I guess? Does that automatically make code comprehensible - the fact it's using many small classes? I'm sure people can and are writing shitty services as well.
Re:Don't make me think, or why I switched to Rails from Java... by wonnage on Friday February 04, 2022 @01:43PM (#30211111)
There’s nothing more frustrating than debugging some ruby module with 10 different mixins defining functions with generic ungreppable names like “user”. Then it turns out the mixins have mixins.

The common refrain is well, don’t write shitty code then, but all code starts off looking good to the person who wrote it. I guarantee if you have 400 engineers working on a Rails app it will end up in this state because it (ironically) lacks sane guardrails

Re:Don't make me think, or why I switched to Rails from Java... by weatherlite on Friday February 04, 2022 @02:10PM (#30211453)
Rubymine's autocomplete got to a state where I barely ever have to grep anything.

Look what you're describing can happen, it's just not that often or is the norm. It's usually some crappy legacy project no one wants to upgrade or touch that reaches such a state, there's absolutely no reason why what you described can't be refactored. The fact it isn't being refactored tells you more about the company/teams working on it than about the framework.

Re:Don't make me think, or why I switched to Rails from Java... by emodendroket on Monday February 07, 2022 @01:27AM (#30241101)
Rubymine's autocomplete is the best available but it's pathetic compared to what IntelliJ platform can offer in most languages.
Re:Don't make me think, or why I switched to Rails from Java... by weatherlite on Monday February 07, 2022 @08:00AM (#30244206)
It's not as good as a typed language but it's pretty good and it will only get better with time.
Re:Don't make me think, or why I switched to Rails from Java... by emodendroket on Tuesday February 08, 2022 @12:03AM (#30255075)
Even compared to what they offer for PHP or JavaScript it's unimpressive.
Re:Don't make me think, or why I switched to Rails from Java... by hw on Friday February 04, 2022 @11:03PM (#30217214)
> The common refrain is well, don’t write shitty code then, but all code starts off looking good to the person who wrote it. I guarantee if you have 400 engineers working on a Rails app it will end up in this state because it (ironically) lacks sane guardrails

This can be said the same of any other framework or language. It is up to your team to organize the code, write documentation, agree upon linting rules and of course encourage best practices. If you’re leaving those decisions to each engineer writing code - thats the problem

Re:Don't make me think, or why I switched to Rails from Java... by wonnage on Friday February 04, 2022 @01:38PM (#30211036)
I’m not sure if this is still a thing but I remember the Rails community being obsessed with aliasing methods and other ways of dynamically defining code at runtime. Coupled with the fact that Ruby is already hard to statically analyze and ‘grep’ is your only hope… good luck following the alias_method_chain rabbit hole…
Re:Don't make me think, or why I switched to Rails from Java... by mrinterweb on Sunday February 06, 2022 @03:59PM (#30236944)
So maybe your problem is there is too much documentation that spans too far back and getting current relevant examples and docs is the hard part. The rails guides are kept current, but any popular framework that has been around for a while is going to have a similar problem. Rail's guides are pretty good compared to many others I've seen. Also there are books, courses, video series, and plenty of other resources that are up-to-date. There is no shortage of high quality up-to-date learning content available. It just may take some work to weed out some of the older content.
Re:Don't make me think, or why I switched to Rails from Java... by hw on Friday February 04, 2022 @11:20PM (#30217358)
There is a reason why most coding bootcamps are based on Rails and React instead of Go, Java, PHP, .Net etc - they are easy to learn, work and reason with.

> the only way to know the “convention” is to either have gone to a rails boot camp, reading the docs top to bottom, or maybe watching rails casts.

I mean, when learning a new language or framework, reading the docs or watching videos and tutorials are part of the course? What other MVC frameworks have you worked with where someone new could just go in and start building an app without actually learning it first?

Re:Don't make me think, or why I switched to Rails from Java... by andrei_says_ on Friday February 04, 2022 @12:32PM (#30209834)
What are some specific “magical things” that are not mentioned in the rails guides?

There’s always room for improvement and the documentation is an important part of the framework.

Re:Don't make me think, or why I switched to Rails from Java... by MakerSam on Friday February 04, 2022 @12:54PM (#30210156)
I don't think the Rails Guides mention Devise, the authentication gem, which is pretty important if you want create a public facing website with users. The devise documentation is pretty good though. Again, a little bit of a learning curve, but once you learn it you can add user authentication to your site pretty quickly.

https://github.com/heartcombo/devise#getting-started

Re:Don't make me think, or why I switched to Rails from Java... by jemmyw on Friday February 04, 2022 @04:38PM (#30213649)
You don't need devise, so I think it's good it's not included. It used to be that devise was good to use as it had the best practice way to set up the password fields etc. But that has been moved to rails core. It's still worth reading the devise documentation, but I'm so familiar with how it sets things up I can just set it up manually faster than messing around with devise itself.
Re:Don't make me think, or why I switched to Rails from Java... by craigmcnamara on Friday February 04, 2022 @01:20PM (#30210777)
It's not in the guide because it's not core Rails. But there is a great site called RubyToolbox to help you find things that aren't core Rails. https://www.ruby-toolbox.com/categories/rails_authentication
Re:Don't make me think, or why I switched to Rails from Java... by nomilk on Friday February 04, 2022 @08:41PM (#30216167)
AFAIK there's nothing in the rails guides to help with authorisation. I googled and couldn't decide between pundit and cancancan. I went with the latter because of some tutorial videos I found. But it wasn't easy: 1. I couldn't find documentation for methods so common as `can?` [1], and 2. the 'magic' of how rails automatically sets instance variables differently and sometimes not at all before each action was also very confusing. Like many other things, it was confusing until you understood what it was doing, but figuring out exactly what it was doing and why took hours of experimenting with the behaviours of each action, and being the recipient of quite a lot of condescension on stack overflow for even asking.

[1] https://stackoverflow.com/q/63674415

Re:Don't make me think, or why I switched to Rails from Java... by rileytg on Friday February 04, 2022 @05:10PM (#30214040)
most rails devs i know started with this guide: https://www.railstutorial.org/

combine that tutorial with skimming the top guides gets someone from 0 to very productive in days or weeks depending on prior experience.

Re:Don't make me think, or why I switched to Rails from Java... by conductr on Friday February 04, 2022 @05:23PM (#30214200)
When I learned rails the community had a fundraiser to fund the documentation writing (this was v0.7 or so IIRC). Being able to read the docs sounds like a dream come true.
Re:Don't make me think, or why I switched to Rails from Java... by anm89 on Sunday February 06, 2022 @12:32PM (#30234713)
this does not match my experience. the official rails docs are extremely comprehensive and are totally up to date.

this is also true for a majority of the popular gems in the community

Re:Don't make me think, or why I switched to Rails from Java... by cooervo on Friday February 04, 2022 @01:07PM (#30210353)
the same BS happens with django
Re:Don't make me think, or why I switched to Rails from Java... by bsder on Friday February 04, 2022 @08:22PM (#30216037)
As a beginner, I didn't find this to be true. Django worked fine and could do what I wanted.

I suspect that if I were coming from Javascript where "I know what I want to do" if only I could "make Django do it", I would feel the impedance mismatch.

This is a very standard problem--"You can write FORTRAN in any language." Leaving behind the idioms you are used to and adopting the idioms of your new environment takes time and energy.