The Cellar  

Go Back   The Cellar > Main > Technology

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11-24-2010, 08:17 PM   #26
fo0hzy
Dirty cigarette-smoking lowlife
 
Join Date: Jul 2008
Location: Michigan
Posts: 85
Quote:
Originally Posted by Perry Winkle View Post
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.)
Nerds.
fo0hzy is offline   Reply With Quote
 


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

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 09:56 PM.


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