9 votes

Best practices?

I am beginning to reintroduce myself with web app development and have about fifteen years of classic ASP/ASP.NET under my belt.

I’ve decided to continue on with my decision to learn Ruby on Rails.

In retrospect, my university professors passed only one (as best as I can remember) best practice onto us fledgling programmers:

Documentation

Besides documentation, are there other general best practices to consider?

And, specifically, are there best practices when developing with Ruby on Rails?

4 comments

  1. [2]
    arp242
    Link
    Documentation is only useful if it's 1) actually read, 2) clear and well-written, and 3) up to date. In practice, I find that a lot of documentation is none of those things. Actually writing...

    Documentation is only useful if it's 1) actually read, 2) clear and well-written, and 3) up to date. In practice, I find that a lot of documentation is none of those things.

    Actually writing documentation up front or together with the program can have some benefits on its own as they can serve as design notes ("writing is thinking"), but documentation for the sake of it is often not very useful.

    As for the question, don't fight Rails. It has a specific way of doing things and while you can work around them if you don't like it, you're probably not going to have a good time if you do.

    7 votes
    1. Eric_the_Cerise
      Link Parent
      I'm fond of pseudocoding a project in such a way that the pseudocode becomes the documentation as the actual code is written. Agree on Rails. It is a great system, as long as you accept that it's...

      I'm fond of pseudocoding a project in such a way that the pseudocode becomes the documentation as the actual code is written.

      Agree on Rails. It is a great system, as long as you accept that it's way of doing things is the "right" way.

  2. Bamans
    Link
    My recommendation is being wary. If you run into a issue where the web frameworks are preventing you from doing something, I’d be very skeptical of the advice you find online to get around it. For...

    My recommendation is being wary. If you run into a issue where the web frameworks are preventing you from doing something, I’d be very skeptical of the advice you find online to get around it. For example, issues with things like csrf where many of the top answers are to simply turn it off. Many of the defaults in thing like RoR are set the way they are for a reason, and it’s better figure out why, rather than blindly turning them off.

    4 votes
  3. balooga
    Link
    Best practices can be a little subjective but if you're looking for some expert-crafted, opinionated recommendations, a good style guide can be helpful. I've found the ones by Airbnb to be...

    Best practices can be a little subjective but if you're looking for some expert-crafted, opinionated recommendations, a good style guide can be helpful. I've found the ones by Airbnb to be sensible and well-written. Here is a link to the one for Ruby / Rails. Pair that with what others have noted, that Rails has a "right" way of doing things, for best results.

    2 votes