Style Guidelines

52 views
Skip to first unread message

Dylan Markow

unread,
Aug 13, 2012, 11:02:54 PM8/13/12
to bubbl...@googlegroups.com
Would it be worth us throwing up a github wiki page or something with some basic coding guidelines? A couple examples I've run into:
  • Half the specs start with it "should ..." and the other half don't (I prefer omitting the "should")
  • Some of the code has extra spacing within parentheses (eg. foo( a , b , c ) instead of foo(a, b, c))
Maybe something like https://github.com/styleguide/ruby/ would be a good starting point?

James Harton

unread,
Aug 13, 2012, 11:16:49 PM8/13/12
to bubbl...@googlegroups.com
Hey Dylan.

The shoulds are easy. Every spec I have written has no "should" and every one I have refactored I have ripped it out. Unless anyone else is any more opinionated I would prefer to see them gone.

I (personally) use extra spacing for arrays, i.e.: [ :a, :b, :c ], and hashes { :a => 1, :b => 2, :c => 3 } but not methods foo(a,b,c). I'm just quirky like that.

-- 
James Harton
@jamesotron
+64226803869

--
You received this message because you are subscribed to the Google Groups "BubbleWrap" group.
To post to this group, send email to bubbl...@googlegroups.com.
To unsubscribe from this group, send email to bubblewrap+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/bubblewrap/-/iT8gWC_T14QJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Marin Usalj

unread,
Aug 15, 2012, 3:18:42 PM8/15/12
to bubbl...@googlegroups.com
+1 for James and shoulds.

I've wrote plenty of HTTP ones with should, but that was the first time  I've worked with the RSPEC-style BDD.
Feel free to remove them.

I've wanted to ask the similar question on Github, but about camelCase vs snake_case methods.
Lots of the API definitions are still using the camelCase (e.g. view.whenTapped and all that block helpers).

I'm aware that changing them would break lots of projects, but I guess we could alias and make warnings until BW hits 2.0.

Dylan Markow

unread,
Aug 15, 2012, 3:42:45 PM8/15/12
to bubbl...@googlegroups.com

I like the take from Matt's MacRuby book: use camel case for methods/callbacks defined in iOS / Objective-C, then use snake case for our own defined methods.

Reply all
Reply to author
Forward
0 new messages