|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New wrote:
>> It seems to be that, regardless of which programming language you use,
>> figuring out the best way to divide the problem into abstractions is
>> absolutely *critical* to writing clean, efficient, maintainable code.
>> And it's often not very obvious which way *is* the best until you try
>> to actually "do it".
>
> Yep. That's where the experience comes in. And the natural ability to
> recognise the abstractions in things.
Experience.
It's like Chess or Go - the rules is simple, but the tactics and
strategy to play well come only with practice and experience.
>> This seems like it's only common sense.
>
> You would be surprised. I've had people do things like pass the number
> of columns wide that the printer report should be in index zero of a
> floating point array indexed by customer age, just so they wouldn't have
> to spend 20 minutes to recompile other parts of the program when they
> changed what variables are shared between programs.
GAAAAAH! >_< IT BURNS! IT BURNS ME!! MAKE IT STOP!!!! GAH, I WANT TO
CLAW OUT MY OWN EYEBALLS!!1!!eleven
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v8 wrote:
> GAAAAAH! >_< IT BURNS! IT BURNS ME!! MAKE IT STOP!!!!
The stupid is leaping up off the page and burrowing into my brain!</Dilbert>
--
Darren New / San Diego, CA, USA (PST)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New <dne### [at] sanrrcom> wrote:
> You would be surprised. I've had people do things like pass the number
> of columns wide that the printer report should be in index zero of a
> floating point array indexed by customer age, just so they wouldn't have
> to spend 20 minutes to recompile other parts of the program when they
> changed what variables are shared between programs.
Sounds familiar. The job came down to a lot of signal processing, and I had a
coworker who needed to improve his programming ability, so he decided to write
a Sudoku solver on his own time. Of course you need to keep track of which
numbers are possible, so in each square for 1-9 a '1' represented a possible
number while a '0' mean that possibility was ruled out. Why not? Makes sense.
But we need to store that data, so lets have '1' correspond to a 1, '10'
correspond to a 2, '100' to 3, and so on up to 10^8. Just add 'em up. (so
1100 == 3 and 4 possible.) Oh, and let's just store that as a real number
since we'll be doing all those log10's anyway. I was unable to convince him
otherwise, which probably reflects more badly upon me than him, but at least no
one else ever had to see it, and at least I think he used double precision...
- Ricky
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
triple_r wrote:
> Sounds familiar. The job came down to a lot of signal processing, and I had a
> coworker who needed to improve his programming ability, so he decided to write
> a Sudoku solver on his own time. Of course you need to keep track of which
> numbers are possible, so in each square for 1-9 a '1' represented a possible
> number while a '0' mean that possibility was ruled out. Why not? Makes sense.
> But we need to store that data, so lets have '1' correspond to a 1, '10'
> correspond to a 2, '100' to 3, and so on up to 10^8. Just add 'em up. (so
> 1100 == 3 and 4 possible.) Oh, and let's just store that as a real number
> since we'll be doing all those log10's anyway. I was unable to convince him
> otherwise, which probably reflects more badly upon me than him, but at least no
> one else ever had to see it, and at least I think he used double precision...
Wait... are you saying that he implemented a bitmap, but in decimal, and
stored it as a float?
Gah!!!
...Chambers
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Chambers <ben### [at] pacificwebguycom> wrote:
> Wait... are you saying that he implemented a bitmap, but in decimal, and
> stored it as a float?
>
> Gah!!!
On reading that back, it really wasn't as clear as it was in my head--I should
work on that--but you got it! Gah is right. 1100 (base 2) => 1100 (base 10)
=> 1100.0. To get the information back out, you just do a log10, subtract the
largest power of ten, and repeat until you have all the information! Not to
say I haven't done some dumb things in my day, but *that*...
- Ricky
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|