The Cellar  

Go Back   The Cellar > Main > Technology
FAQ Community Calendar Today's Posts Search

Technology Computing, programming, science, electronics, telecommunications, etc.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11-24-2010, 01:43 PM   #25
Perry Winkle
Esnohplad Semaj Ton
 
Join Date: Feb 2005
Location: A little south of sanity
Posts: 2,259
Quote:
Originally Posted by Flint View Post
I find it hard to argue with the fact that what I've done works. Because it works.
Your solution is perfectly acceptable for a classroom assignment. But you might get your ass kicked in a code review for settling for "it works."

In the real world, you want functions to have as few side-effects as possible. Ideally, a function would have no side-effect other than its return value. Some languages even ENFORCE this restriction.

Your solution depends on side effects. This makes it harder to reason about how and why it works. Happy Monkey's does not depend on side effects, and is easier to grok.

(I hope this post doesn't come off as critical. I'm just trying to add a little more to think about.)
Perry Winkle is offline   Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 03:34 PM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.