Showing posts with label Guide. Show all posts
Showing posts with label Guide. Show all posts

Friday, May 4, 2012

JavaScript Style Guides And Beautifiers


Recommended JavaScript Style Guides

  1. Idiomatic.js. This is not only highly recommended and very comprehensive, but is also the style guide we've adopted for several of the projects I'm involved in. It includes contributions by jQuery core contributor Rick Waldron, jsPerf contributor Mathias Bynens and many other experienced JS devs in the community. Not all developers agree 100% with the practices it advocates, but that's the great thing about a forkable style guide – it's easy to adapt to your own needs.
  2. jQuery Core Style Guide. Perhaps the most popular style guide modern JS developers are aware of, it is used by the jQuery core team, jQuery UI, QUnit and many other projects. Rick Waldron once again had a hand in this as have Adam Sontag and John Resig, also of jQuery fame.
  3. Google JavaScript Style Guide. Written by former Google JavaScript developers such as Robby Walker (Closure Linter), this contains several readability best practices that those from a particularly traditional software engineering background will appreciate. Further comments on it can be found here.
  4. Dojo Style Guide Another very comprehensive alternative by the people that brought us the excellent dojo toolkit. Interestingly this guide is based on the structure of the Java programming conventions guide. If you like what you see, you might also appreciate dojo's inline documentation sguide, which remains my favorite style of inline commenting in JS.
  5. Aloha Editor JavaScript Style Guide This guide comes from the authors of the relatively non-trivial contentEditable-based Aloha Editor. Whilst it recommends the jQuery style guide, it has some useful (minor) additions such as how they suggest styling AMD modules.
  6. Crock's Code Conventions For JavaScript Another good guide, although perhaps not as detailed example-wise as others. I feel this has been superseded by Idiomatic.js, but if you strongly disagree with it or the jQuery core style guide, this is a much recommended fallback.

Friday, October 28, 2011

Rails 3 Beginner to Builder

The Ruby Style Guide

One thing has always bothered me as Ruby developer - Python devs have a great programming style reference (PEP-8) and we never got an official guide documenting Ruby coding style and best practices.



Table of Contents

Rails Style Guide


Abstract
The goal of this guide is to present a set of best practices and style prescriptions for Ruby on Rails 3 development. It's a complementary guide to the already existing community-driven Ruby coding style guide.

While in the guide the section Testing Rails applications is after Developing Rails applications I truly believe that Behaviour-Driven Development (BDD) is the best way to develop software. Keep that in mind.

Rails is an opinionated framework and this is an opinionated guide. In my mind I'm totally certain that RSpec is superior to Test::Unit, Sass is superior to CSS and Haml (Slim) is superior to Erb. So don't expect to find any Test::Unit, CSS or Erb advice in here.

Some of the advice here is applicable only to Rails 3.1.

Table of Contents

  • Developing Rails Applications
  • Configuration
  • Routing
  • Controllers
  • Models
  • ActiveRecord
  • Migrations
  • Views
  • Assets
  • Mailers
  • Bundler
  • Priceless Gems
  • Flawed Gems
  • Managing processes
  • Testing Rails Applications
  • Cucumber
  • RSpec
  • Views
  • Contollers
  • Models
  • Mailers
  • Uploaders
  • Further Reading
  • Contributing
  • Spread the word