-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
192 lines (139 loc) · 6.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="Immense.github.io : Immense Dev Guides" />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/github.css">
<script src="javascripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<title>Immense Networks | Web Dev</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/immense">View on GitHub</a>
<h1 id="project_title">Immense Networks</h1>
<h2 id="project_tagline">Dev Guides</h2>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<h1>Guidelines</h1>
<p> Always use descriptive variable names. Using acronyms for variable names is frowned upon in this establishment.
You have to realize other people aren't reading your files from top to bottom. They're following stack traces to
line numbers. The less we have to decipher, the better. Don't get uber verbose, that can be equally confusing.</p>
<p> Use newlines to seperate logical blocks of code. Newlines help guide your eyes. But don't abuse newlines! Too
many newlines and nothing stand out. Use your best judgement, but readability is always priority. </p>
<p> Learn to use inheritance. If you're copy/pasting templates, you're doing it wrong.</p>
<p> Comment the end of blocks (closing html tags, closing parens, closing brackets) to help signify it's end.</p>
<p> Learn git. Use git.</p>
<h1>Conventions</h1>
<p> Use spaces instead of tabs, and set your tab size to 4 spaces.</p>
<p> Classes in pretty much all languages are Pascal case.</p>
<!-- php Styles -->
<h2>php</h2>
<p>Use Camel case for class properties and methods. Use snake_case for normal variables and static method names.</p>
<p>Set tabs to always be spaces, and use 2 spaces per indent.</p>
<p>Use the Allman style for curly braces for class and function definitions. The curly brace should be on the next line by itself.</p>
<h4>Sample</h4>
<pre><code class="php">class TestThing
{
public $objectProperty;
public function methodName()
{
...
} // End methodName
public static function method_name()
{
...
} // End method_name
} // End TestThing
function function_name( $argument = null )
{
...
} // End function_name
$variable_name = new TestThing(); //Non-object and objects
</code></pre>
<!-- End php -->
<h2>symfony</h2>
<p> Projects should be broken into logical modules. Typically a main nav item and it's subnav items can be made into a module.
Module names should be camel cased. Pretty much everything can be containted in a single app (which by convention is named frontend).</p>
<h4>Sample</h4>
<pre><code class="symfony">// Put something here...</code></pre>
<!-- Ruby on Rails -->
<h2>Ruby on Rails</h2>
<pre><code class="ror"># Put something here...</code></pre>
<!-- End Ruby on Rails -->
<!-- CSS -->
<h2>CSS</h2>
<p>Use the minimalistic approach with stylesheets. Styles should be on one line, separated by spaces.
<ul>
<li>Do not specify a font family for body text. Instead, just use serif or sans-serif.</li>
<li>Use inline styles as never as possible.</li>
</ul>
<h4>Sample</h4>
<pre><code class="css">
body {font-family: sans-serif; background: #000;}
h2, h2, h2, h2 {font-weight: bold; text-transform: capitalize;}
h2 {font-size: 1.6em;}
</code></pre>
<!-- End CSS -->
<!-- Objective-C -->
<h2>Objective-C</h2>
<p>Typically custom classes (which aren't view controllers) and protocols begin with a <em>two</em> or <em>three</em> letter abbreviation of the organization to tip your hat to NeXTSTEP.</p>
<p>Use Pascal case for classes. Use Pascal case for constants and prefix with the a <em>two</em> or <em>three</em> letter abbreviation. Underscores for instance variables</p>
<p>Set tabs to always be spaces, and use 4 spaces per indent. (Xcode defaults)</p>
<pre>Note: Cocoapods recommends a three letter abbreviation to further prevent the collision of class names.</pre>
<h4>Sample</h4>
<h5>Header</h5>
<pre><code class="objective-c">
#import <Foundation/Foundation.h>
#define INTestThingDebug 1
@interface INTestThing : NSObject
@property (nonatomic, strong) NSArray *myArray;
+ (id)initWithTestThing:(NSString *)thing;
- (BOOL)doSomething;
@end
</code></pre>
<h5>Implementation</h5>
<pre><code class="objective-c">
#import "INTestThing.h"
@interface INTestThing()
@end
@implementation INTestThing
@synthesize myArray = _myArray;
+ (id)initWithTestThing:(NSString *)thing
{
// designated initializer
// for sample and correctness purposes return nil
return nil;
}
- (BOOL)doSomething
{
BOOL ret = NO;
// do something here
return ret;
}
@end
</code></pre>
<!-- End Objective-C -->
<!-- Git -->
<h2>Git</h2>
<p>Projects should have a prod (or master), dev, and staging branches at the minimum.</p>
<p>New branches should be created to add a specific feature/module or refactoring.
Submodules may be used to separate components of an application, for example, base actions, models, etc.
</p>
</section>
</div> <!-- /main_content_wrap -->
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</body>
</html>