Good points. I think I'll go back to sitting on the fence. =D

- Varlock

----- Original Message -----
From: "Dynerman David M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 16, 2001 1:36 PM
Subject: RE: [hlcoders] Binary (wtf?) (Updated)


Well even in the case you're describing,

If a person doesn't know how to translate decimals into binary, what are
the odds that he/she can properly generate a program from the provided
code? One mispaste will fuss everything up, and even though we know how
to fix 'Error - unknown identifier x', odds are this person doesn't. If
we're that apathetic that we just want to give charts instead of
explaining and teaching the mechanics behind a problem, then someone
should have compiled the program and posted it this list.

On the other hand, with some comments or perhaps a different
implementation, the code would have taught the person asking the
background behind the answer. That way after he reformats he doesn't
have to come here and ask again.

Example:
<Novice> Could someone show me the binary representation of the
alphabet?
<Us> Here's some code to do it for you, have fun kiddo.

How helpful will that be to someone with not a lot of programming
knowledge?

Example:
<Novice> Could someone show me the binary representation of the
alphabet?
<Us> Here's some code to do it for you, check out the comments for an
explanation.

whatever.cpp
//each 'place' in a binary number represents a power of 2 in the decimal
//system, starting with 2^0 at the far right, with powers increasing
//by one each place to the left
//the total value of a binary number is just the sum of all those powers
//of 2
//e.g. binary #      :  0   0   0   0   1   1   0   0
// decimal values: 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0

//if a place is 1, add that power of 2 to the sum, if its 0, don't add
//in the above example, 2^2 and 2^3 have values of one, so we just add
//those two numbers, 4 + 8 = 12, 0000 1100 = 12

We were all newbies at one point,

david

-----Original Message-----
From: Varlock [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 16, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Binary (wtf?) (Updated)

    Just to add my two cents to this discussion, think back to the
original
question. The original poster wanted a list of characters and their
binary
representation. Several solutions were presented, including a list on
the
web and using the Windows calculator. Someone posted a small app which
would
output that list to the screen.
    The poster was looking for a list, the program provided a list. He
was
not looking for a lesson on how to write a program to output characters
and
their binary values. Therefore, I think the rough code posted was
appropriate for the task. Yes, it WAS rough, and it should have been
better.
We should always practice good programming, but in this case I can let
it
pass because of the intention of the program.
    Just my thoughts.

- Varlock

----- Original Message -----
From: "Dynerman David M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 16, 2001 11:38 AM
Subject: RE: [hlcoders] Binary (wtf?) (Updated)


Well what you're saying defeats your own point.

If the code was intended as a teaching tool, shouldn't extra care be
taken to make sure its readable and implemented well?

david

-----Original Message-----
From: Florian Zschocke [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 16, 2001 5:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Binary (wtf?) (Updated)

Dynerman David M wrote:
>
> Not if you need to go back in 3 months and change something :)

 All he asked about was list of the binary representation of
characters. That list is pretty easy to come by with a small piece
of code. Since he didn't know how to do it I quickly wrote it up
for him and provided the list. I just added the code for it so he
could check it and see how the list was generated. That's all.
That code was in no way meant to be integrated into any other app
and has served it's purpose. As skyork said, one should actually
understand the number system before trying to manipulate things in
a real app.

Florian.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to