Created
April 16, 2012 16:02
-
-
Save jgranick/2399666 to your computer and use it in GitHub Desktop.
A quick contrast of code styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyCoolClass { | |
var message:String; | |
var total:Float; | |
public function new () { | |
var hello = combineText ("H", "ello"); | |
var world = combineText ("W", "orld"); | |
message = combineText (hello, world); | |
total = combineNumbers (100, 10.1); | |
} | |
function combineNumbers (first, second) { | |
return first + second; | |
} | |
function combineText (first, second) { | |
return first + second; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my.cool.package; | |
class MyCoolClass { | |
private var message:String; | |
private var total:Float; | |
public function new () { | |
var hello:String = combineText ("H", "ello"); | |
var world:String = combineText ("W", "orld"); | |
message = combineText (hello, world); | |
total = combineNumbers (100, 10.1); | |
} | |
private function combineNumbers (first:Float, second:Float):Float { | |
return first + second; | |
} | |
private function combineText (first:String, second:String):String { | |
return first + second; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment