Style Specification

From MacroDeckDevWiki

Jump to: navigation, search

This document covers our preferred style.

Contents

Tabs vs. Spaces

If you use spaces, I will stab you. Don't use spaces. Always use tabs. If tabs look funky on your machine, adjust them until they don't. It looks fine on Notepad++, nano, and Gedit. And Kate. And TextMate. It might occasionally be one tab off, but usually it's right. Spaces screw it up for everyone. As a note, I have my tab size set to 5. Or whatever the default in Notepad++ is.

Naming Conventions

I use a Java naming convention rather than a Ruby naming convention because I'm ass-backwards. If you feel like going through all of my code and fixing that, you can use a Ruby naming convention. Otherwise, use Java. In case you're not aware of what that means...

  thisIsAFunctionName

Also remember to avoid something like this...

  getDownloadIDNowFromTV

...and do this...

  getDownloadIdNowFromTv

...it looks better.

Rails APIs

Don't use any depreciated functions. render_text, render_partial, etc. will result in a stern kick in the nads. Just don't do it. render_component is acceptible.

Schemas

Avoid creating custom schemas (table layouts) except when you need to, and when this comes up, use Rails naming conventions. I mix Rails with Java. Kill me. You should be using DataService to store all of your data. When you're storing data that's not exactly just data, it's okay. For example, users are groups are in their own tables. And because I don't have a filedata column in DataService to avoid extra overhead, StorageService will use its own table as well. But profiles, ratings, etc. will all use DataService. There's a good reason for this -- it makes combining and merging similar items much easier. Also, searching many different types of items is also easy.

Personal tools