Click here to Skip to main content
15,895,799 members

carbon_golem - Professional Profile



Summary

    Blog RSS
1,159
Authority
265
Debator
11
Enquirer
97
Organiser
353
Participant
0
Author
0
Editor
B.S.E. in Computer Engineering.
Currently doing hardware interfacing using C# over IO channels.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralKata for 12/12/2008 Member 4576884's Homework Pin
carbon_golem12-Dec-08 10:02
carbon_golem12-Dec-08 10:02 
GeneralRe: Kata for 12/12/2008 Member 4576884's Homework (Answer to #1) Pin
carbon_golem22-Dec-08 2:46
carbon_golem22-Dec-08 2:46 
GeneralNote to self.... Pin
carbon_golem30-Sep-08 8:25
carbon_golem30-Sep-08 8:25 
GeneralSmall code Pin
carbon_golem30-Sep-08 7:05
carbon_golem30-Sep-08 7:05 
From http://binstock.blogspot.com/2008/04/perfecting-oos-small-classes-and-short.html

In The ThoughtWorks Anthology a new book from the Pragmatic Programmers, there is a fascinating essay called “Object Calisthenics” by Jeff Bay. It’s a detailed exercise for perfecting the writing of the small routines that demonstrate characterize good OO implementations. If you have developers who need to improve their ability to write OO routines, I suggest you have a look-see at this essay. I will try to summarize Bay’s approach here.

He suggests writing a 1000-line program with the constraints listed below. These constraints are intended to be excessively restrictive, so as to force developers out of the procedural groove. I guarantee if you apply this technique, their code will move markedly towards object orientation. The restrictions (which should be mercilessly enforced in this exercise) are:

1. Use only one level of indentation per method. If you need more than one level, you need to create a second method and call it from the first. This is one of the most important constraints in the exercise.

2. Don’t use the ‘else’ keyword. Test for a condition with an if-statement and exit the routine if it’s not met. This prevents if-else chaining; and every routine does just one thing. You’re getting the idea.

3. Wrap all primitives and strings. This directly addresses “primitive obsession.” If you want to use an integer, you first have to create a class (even an inner class) to identify it’s true role. So zip codes are an object not an integer, for example. This makes for far clearer and more testable code.

4. Use only one dot per line. This step prevents you from reaching deeply into other objects to get at fields or methods, and thereby conceptually breaking encapsulation.

5. Don’t abbreviate names. This constraint avoids the procedural verbosity that is created by certain forms of redundancy—if you have to type the full name of a method or variable, you’re likely to spend more time thinking about its name. And you’ll avoid having objects called Order with methods entitled shipOrder(). Instead, your code will have more calls such as Order.ship().

6. Keep entities small. This means no more than 50 lines per class and no more than 10 classes per package. The 50 lines per class constraint is crucial. Not only does it force concision and keep classes focused, but it means most classes can fit on a single screen in any editor/IDE.

7. Don’t use any classes with more than two instance variables. This is perhaps the hardest constraint. Bay’s point is that with more than two instance variables, there is almost certainly a reason to subgroup some variables into a separate class.

8. Use first-class collections. In other words, any class that contains a collection should contain no other member variables. The idea is an extension of primitive obsession. If you need a class that’s a subsumes the collection, then write it that way.

9. Don’t use setters, getters, or properties. This is a radical approach to enforcing encapsulation. It also requires implementation of dependency injection approaches and adherence to the maxim “tell, don’t ask.”

Taken together, these rules impose a restrictive encapsulation on developers and force thinking along OO lines. I assert than anyone writing a 1000-line project without violating these rules will rapidly become much better at OO. They can then, if they want, relax the restrictions somewhat. But as Bay points out, there’s no reason to do so. His team has just finished a 100,000-line project within these strictures.

"Simplicity carried to the extreme becomes elegance."
-Jon Franklin

GeneralLOLCODE freakin hilarious Pin
carbon_golem18-Jul-08 4:04
carbon_golem18-Jul-08 4:04 
GeneralKata for 7/15/2008 Type Caching Pin
carbon_golem15-Jul-08 10:29
carbon_golem15-Jul-08 10:29 
GeneralRe: Kata for 7/15/2008 Type Caching Pin
carbon_golem17-Jul-08 3:54
carbon_golem17-Jul-08 3:54 
GeneralKata for 5/29/2008 Command Synchronization Pin
carbon_golem29-May-08 2:36
carbon_golem29-May-08 2:36 
GeneralRe: Kata for 5/29/2008 Command Synchronization Pin
carbon_golem29-May-08 3:37
carbon_golem29-May-08 3:37 
GeneralKata for 5/13/2008 CSV Writer Pin
carbon_golem13-May-08 2:53
carbon_golem13-May-08 2:53 
GeneralRe: Kata for 5/13/2008 CSV Writer Pin
carbon_golem29-May-08 3:37
carbon_golem29-May-08 3:37 
GeneralCode Kata for 5/7/2008 Pin
carbon_golem7-May-08 5:50
carbon_golem7-May-08 5:50 
GeneralRe: Code Kata for 5/7/2008 Pin
carbon_golem8-May-08 5:49
carbon_golem8-May-08 5:49 
GeneralRe: Code Kata for 5/7/2008 [modified] Pin
carbon_golem13-May-08 2:12
carbon_golem13-May-08 2:12 
GeneralKata for 5/2/2008 Pin
carbon_golem2-May-08 4:15
carbon_golem2-May-08 4:15 
GeneralRe: Kata for 5/2/2008 Pin
carbon_golem2-May-08 18:20
carbon_golem2-May-08 18:20 
GeneralCode Katas Pin
carbon_golem1-May-08 4:35
carbon_golem1-May-08 4:35 
GeneralBoilerplate code... [modified] Pin
carbon_golem30-Apr-08 8:34
carbon_golem30-Apr-08 8:34 
GeneralRe: Boilerplate code... Pin
carbon_golem11-Dec-08 5:41
carbon_golem11-Dec-08 5:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.