0
BAY AREA SCALA ENTHUSIASTS
              WELCOME TO TWITTER!
  HELP YOURSELF TO BEER AND SUCH IN THE KITCHEN.
ROBEY
                    STEVE




        ALEX

               TWITTER’S SCALA HEADS
STYLE GUIDELINES
IMPORTS

ENUMERATE ALL         ALL IMPORTS MUST BE
IMPORTS               AT THE TOP OF THE
                      FILE
 USE...
IMPLICITS



AVOID THEM!

THEY MAKE DEBUGGING CONFUSING

DOCUMENT THOROUGHLY IF YOU HAVE TO USE THEM

RESTRICT TO THE SMAL...
REFLECTION (JAVA)



AVOID IT!

SLOW

POTENTIALLY CONFUSING
COMMENTS


MANDATORY

VSCALADOC

SCALADOC EVERY CLASS AND NON-TRIVIAL METHOD

WRITE IN PASSIVE VOICE, EX:

  “RETURNS A LI...
WHITESPACE



2 SPACES, NO TABS

NO TRAILING WHITESPACE

KEEP LINES TO 100 COLUMNS MAX
LOGGING



USE ONLY JAVA.UTIL.LOGGING.LOGGER

NOTHING GOES TO STDOUT/STDERR

NAME THE LOGGING OBJECT/VARIABLE “LOG”
PROJECT LAYOUT



MAVEN CONVENTIONS FOR DIRECTORY STRUCTURE, EX:

  SRC/[MAIN|TEST]/[SCALA|JAVA]/COM/TWITTER/FOO

DEPLOY J...
VARIABLE NOMENCLATURE



DON’T EXCESSIVELY ABBREVIATE VARIABLE NAMES

  IT’S OKAY TO USE I, J, K, ETC. FOR INDICES

USE “R...
THANKS FOR COMING!
Upcoming SlideShare
Loading in...5
×

TwitterOct2008.pdf

474

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
474
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "TwitterOct2008.pdf"

  1. 1. BAY AREA SCALA ENTHUSIASTS WELCOME TO TWITTER! HELP YOURSELF TO BEER AND SUCH IN THE KITCHEN.
  2. 2. ROBEY STEVE ALEX TWITTER’S SCALA HEADS
  3. 3. STYLE GUIDELINES
  4. 4. IMPORTS ENUMERATE ALL ALL IMPORTS MUST BE IMPORTS AT THE TOP OF THE FILE USE WILDCARDS FOR MORE THAN SIX USE BRACE NOTATION FOR MULTIPLE ITEMS IN A PACKAGE AVOID “RELATIVE” IMPORTS
  5. 5. IMPLICITS AVOID THEM! THEY MAKE DEBUGGING CONFUSING DOCUMENT THOROUGHLY IF YOU HAVE TO USE THEM RESTRICT TO THE SMALLEST POSSIBLE SCOPE
  6. 6. REFLECTION (JAVA) AVOID IT! SLOW POTENTIALLY CONFUSING
  7. 7. COMMENTS MANDATORY VSCALADOC SCALADOC EVERY CLASS AND NON-TRIVIAL METHOD WRITE IN PASSIVE VOICE, EX: “RETURNS A LIST[STATUS] OF 20 STATUSES FOR THE GIVEN USER.”
  8. 8. WHITESPACE 2 SPACES, NO TABS NO TRAILING WHITESPACE KEEP LINES TO 100 COLUMNS MAX
  9. 9. LOGGING USE ONLY JAVA.UTIL.LOGGING.LOGGER NOTHING GOES TO STDOUT/STDERR NAME THE LOGGING OBJECT/VARIABLE “LOG”
  10. 10. PROJECT LAYOUT MAVEN CONVENTIONS FOR DIRECTORY STRUCTURE, EX: SRC/[MAIN|TEST]/[SCALA|JAVA]/COM/TWITTER/FOO DEPLOY JARS USE ANT + IVY AS THE BUILD SYSTEM
  11. 11. VARIABLE NOMENCLATURE DON’T EXCESSIVELY ABBREVIATE VARIABLE NAMES IT’S OKAY TO USE I, J, K, ETC. FOR INDICES USE “RV” FOR TEMPORARY RETURN VALUES
  12. 12. THANKS FOR COMING!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×