Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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.

Replies are listed 'Best First'.
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.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2022-08-09 23:18 GMT
Find Nodes?
    Voting Booth?

    No recent polls found