Read + Write + Report
Home | Start a blog | About Orble | FAQ | Blogs | Writers | Paid | My Orble | Login

Right and Left Coding Styles

September 15th 2007 20:12
When writing software you can take different approaches to solving problems. Here is an example (I'll explain the code after the main article) of how a left winger and right winger may handle a simple everyday problem.

A Conservative Programmer Will Attempt to Solve The Problem in This Manner



Liberal Coder
A Liberal Programmer Will Attempt to Solve The Problem in This Manner


Before anyone goes at my throat, heres how I'd solve this problem:

My Coding Style
I Would Just Answer The Damned Question!


As for the solution I would be proposing? Well I can tell you for a fact that it would recquire much more coding than what is shown. It certainly won't be as simple as manipulating numbers and calling it a day.


Bool is a true false thing, the returns you see show what this function returns when called. So if someone calls PeaceEstablished() from anywhere in the code they get a return value of true or false depending on whats going on.

One '=' sign means your making something equal something, for instance bool x can be assigned a value of true as follows: x = true. On the other hand the '==' is a comparance, for instance 3 == 3 returns true because 3 does equal 3.

/= means 'divide by', so x /= 3 is the same as x divided by 3 and the result is stored in x. So if x is 1 then x /= 3 means x will be 1/3 now. *= is 'multiply by', so x *= 3 is the same as x * 3 and x *= 3 where x is 1 means x will have a value of 3.
45
Vote
Add To: del.icio.us Digg Furl Spurl.net StumbleUpon Yahoo


   
subscribe to this blog 


   

   


Comments
1 Comments. [ Add A Comment ]

Comment by yoda76

September 23rd 2007 00:29

Add A Comment

To create a fully formatted comment please click here.


CLICK HERE TO LOGIN | CLICK HERE TO REGISTER

Name or Orble Tag
Home Page (optional)
Comments
Bold Italic Underline Strikethrough Separator Left Center Right Separator Quote Insert Link Insert Email
Notify me of replies
Your Email Address
(optional)
(required for reply notification)
Submit
More Posts
1 Posts
1 Posts
1 Posts
522 Posts dating from September 2006
Email Subscription
Receive e-mail notifications of new posts on this blog:
0
Moderated by jkund17
Copyright © 2012 On Topic Media PTY LTD. All Rights Reserved. Design by Vimu.com.
On Topic Media ZPages: Sydney |  Melbourne |  Brisbane |  London |  Birmingham |  Leeds     [ Advertise ] [ Contact Us ] [ Privacy Policy ]