Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re2: Short Refactoring Tip: let the object do it for you

by dragonchild (Archbishop)
on May 20, 2003 at 14:34 UTC ( #259466=note: print w/ replies, xml ) Need Help??


in reply to Re: Short Refactoring Tip: let the object do it for you
in thread Short Refactoring Tip: let the object do it for you

Ah, but it isn't common sense. In old-time C, for example, you wouldn't write something like that. Instead, you would write something like:

#define STATUS1 (1 << 0) #define STATUS2 (1 << 1) #define STATUS3 (1 << 2) #define STATUS4 (1 << 3) ... typedef int Status; ... Status product_status = 0; ... if (product_status & (STATUS1 | STATUS2)) { // Do stuff here }
It's imperative programming, man! You gotta be in control or you lose your job! (Think about it - if you couldn't point to incomprehensible code, your PHB would find someone who could. I mean, if anyone could write code that works, then how do you justify your 6-figure consulting fee?)

Also, writing good class interfaces requires both time and understanding of the business domain. Maybe your world allows for these, but no application I've ever had the (mis)fortune to work on has ever been in that most blessed of states. (No, that isn't Texas, either.)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.


Comment on Re2: Short Refactoring Tip: let the object do it for you
Download Code
Re: Re2: Short Refactoring Tip: let the object do it for you
by castaway (Parson) on May 20, 2003 at 15:15 UTC
    I have no idea what common sense has to do with C.. (Or rather why something shouldn't be, just because someone did it in C differently).

    (For the record, I avoid C/C++ like the plague, or try to..)
    Not everyone *can* write code that works, much less code that is maintainable, usable etc. Obfuscating for the sake of it never appealed to me.
    We do take time here and define our interfaces (between products+components) - it saves lots of hassle later.

    C.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259466]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-09-18 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (113 votes), past polls