 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I, for one, find it much easier to read C++ code which is braced like this:
if(somecondition == 0)
{
// do some stuff
}
else
{
// do something else
}
As opposed to
if(somecondition == 0) {
// do some stuff
}
else {
// do something else
}
Why doesn't the rest of the world understand that?
--
H²
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert <hal### [at] gmail com> wrote:
> Why doesn't the rest of the world understand that?
Because Brian Kernighan and Dennis Ritchie used the latter style in their
famous book, and because they are God, every C (and consequently C++) coder
must obey the same standard.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert wrote:
> I, for one, find it much easier to read C++ code which is braced like this:
> Why doesn't the rest of the world understand that?
Different languages encourage different indentation schemes, based on
the details of syntax. I use different indenting for C and Pascal, for
example.
I tend to prefer indenting where the things in one column are
sequentially executed. So if I have an if, an assignment, and a while
loop, I'll tend to want to indent things so there are only three lines
in that column, rather than including all the noise words. E.g.,
void codestuff() {
int i;
if (i == j) {
do this thing;
do that thing;
}
j += 1;
while (j < 23) {
do another;
}
}
void morecode() {
}
Having things like switch (especially with fallthrus) and else sometimes
messes up the patterns, depending on just how you manage it. I figure
the fewer rules you need to learn to indent, the easier it is to learn it.
if (i == j) {
stuff;
morestuff;
} else if (yadda) {
another stuff
extra stuff;
} else {
thing one
thing two
}
That looks kind of ugly, but it also stands out as matching "my" rules
in many ways. Doing it as
if (i == j) {
stuff
}
else if (j == 3) {
stuff
}
else {
thing
}
looks nicer, and also kind of works out with the "things in the same
column should be executed sequentially" rule. It also looks nicer when
you have "begin" and "end" instead of { and } :-)
--
Darren New / San Diego, CA, USA (PST)
Helpful housekeeping hints:
Check your feather pillows for holes
before putting them in the washing machine.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Halbert" <hal### [at] gmail com> wrote in message
news:4863dbb4$1@news.povray.org...
> I, for one, find it much easier to read C++ code which is braced like
this:
>
> if(somecondition == 0)
> {
> if(somecondition == 0) {
> // do some stuff
Whereas I find the first far too spread out to be able to read easily and
use the second as my standard code layout in C-like languages
> Why doesn't the rest of the world understand that?
>
Because the rest of the world doesn't necessarily agree with you?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw <initialsurname@sentech sa dot com> wrote:
> Whereas I find the first far too spread out to be able to read easily
Compactness does not imply readability. On the contrary.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message
news:4863e7ae@news.povray.org...
> Gail Shaw <initialsurname@sentech sa dot com> wrote:
> > Whereas I find the first far too spread out to be able to read easily
>
> Compactness does not imply readability. On the contrary.
I never said it did.
I said that I find the first too spread out to read easily and that I prefer
the second as *I* personally find it easier to read.
If you prefer the former, more power to you. Just don't expect me to code
the same way.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
It's true that its only a preferance I personally have. The rest of the
world doesn't have to agree with me. I just like the way the braces all line
up and make visually clear the beginning and end of each code block. Its
easier for me to see than matching of the ending brace with the associated
expression at the top of the block.
I have been quietly living with that gripe in the back of my mind for the
last 18 or 19 years. Now that it's out in the open, I feel much better.
--
H²
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Halbert" <hal### [at] gmail com> wrote in message
news:4863edeb$1@news.povray.org...
> It's true that its only a preferance I personally have. The rest of the
> world doesn't have to agree with me.
Everyone's entitled to their prefered way of doing things. Life would be
boring if we all agreed on everything
> I have been quietly living with that gripe in the back of my mind for the
> last 18 or 19 years. Now that it's out in the open, I feel much better.
Good.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw <initialsurname@sentech sa dot com> wrote:
> Life would be boring if we all agreed on everything
I disagree.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert wrote:
> I, for one, find it much easier to read C++ code which is braced like this:
>
> if(somecondition == 0)
> {
> // do some stuff
> }
> else
> {
> // do something else
> }
I, for more than one, do not.
> As opposed to
>
> if(somecondition == 0) {
> // do some stuff
> }
> else {
> // do something else
> }
To me, the latter method is much more like POV-Ray than the first
method. I learned POV first, so I guess that's why I do it.
Since most of the code I write is never seen by another poor soul, you
won't find me bending backwards to tailor it for the "posh" crowd.
> Why doesn't the rest of the world understand that?
I kinda feel bad for the one guy who had to see my C++ code. At least it
was relatively short :)
Sam
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Gail Shaw <initialsurname@sentech sa dot com> wrote:
>> Whereas I find the first far too spread out to be able to read easily
>
> Compactness does not imply readability. On the contrary.
>
Case in point:
n=(i<12&&j>=i)?(sqrt(z)*y+j):(y+j*i);
vs
if( i < 12 && j >= i )
{
n = sqrt(z) * y + j;
}
else
{
n = y + j * i;
}
;)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
stbenge wrote:
> Halbert wrote:
>> I, for one, find it much easier to read C++ code which is braced like
>> this:
>>
>> if(somecondition == 0)
>> {
>> // do some stuff
>> }
>> else
>> {
>> // do something else
>> }
>
> I, for more than one, do not.
>
>> As opposed to
>>
>> if(somecondition == 0) {
>> // do some stuff
>> }
>> else {
>> // do something else
>> }
>
> To me, the latter method is much more like POV-Ray than the first
> method. I learned POV first, so I guess that's why I do it.
>
I learned POV first, too. But for C/C++ code, the second example seems
foreign. I much prefer the first example.
But it's kind of like saying you prefer a room painted hunter green,
while I'd prefer forest green.
The only thing I'll say is that if there are coding standards in place,
follow the standard your organization uses.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford <mra### [at] hotmail com> wrote:
> Case in point:
> n=(i<12&&j>=i)?(sqrt(z)*y+j):(y+j*i);
Of course spaces could help readability a bit. Like:
n = (i < 12 && j >= i) ? (sqrt(z)*y + j) : (y + j*i);
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert wrote:
> I, for one, find it much easier to read C++ code which is braced like this:
> Why doesn't the rest of the world understand that?
No idea.
Annoying, isn't it??
The other thing that annoys me is Java's insistance on using camal case
but with a lowercase first letter.
lower_case_with_underscores is just fine.
CamalCaseWithoutUnderscores is also fine.
thisIsJustUnspeakablyHorrid!!
EIFFEL_IS_WORSE_IN_THIS_REGARD...
Annoyingly, Haskell copies Java's incorrect use of camal case...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
How about Microsoft's engineers starting the whole Hungarian Notation
convention with Windows programing. (like lpstrFilePath or iRecursion, etc.)
There seems to be no set standard to it. While the intention is good, a
beginner may have wonder why some variables have names like lpszDemung or
lpfnCBack.
--
H²
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
> The only thing I'll say is that if there are coding standards in place,
> follow the standard your organization uses.
If I worked for an organization, I would definitely change my style. Of
course if I were programming for a living, I would probably go to school
where they would teach me how to write code that people could decipher :)
Sam
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
stbenge wrote:
> Of
> course if I were programming for a living, I would probably go to school
> where they would teach me how to write code that people could decipher :)
Don't count on it! ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert wrote:
> How about Microsoft's engineers starting the whole Hungarian Notation
> convention with Windows programing.
Actually, this makes a lot of sense for C *when done right*.
The point was not to repeat in the variable name the types that you
declared to the compiler. The point was to repeat in the variable name
the types you CANNOT declare to the compiler.
If you have
int line_width;
int line_height;
int page_height;
int line_count;
int pixel_count
the expressions
page_height = line_count * line_height
and
page_height = line_count * line_width
and
pixel_count = page_height * line_width
and
pixel_count = page_height * page_height
are equally type-correct as far as C is concerned, but two are nonsense.
So you declare
int wLineWidth;
int hLineHeight;
int hPageHeight;
int hwPixelCount;
int lineCount;
Then you can write
hPageHeight = hLineHeight * lineCount;
hPageHeight = wLineWidth * lineCount; // Obvious nonsense!
hwPixelCount = hLineHeight * wLineWidth; // Looks good
hwPixelCount = hLineHeight * hPageHeight; // Nonsense!
Even picking nonsense variable names other than the notation will tell
you that it's nonsense. If you see
hSize = count * hQuantity; // Probably OK
wSize = hQuantity * count; // Probably bogus
That was the idea of "Hungarian notation". Not that you should replicate
what the compiler already knows, but distinguish types that the compiler
can't, because you're using a language whose compiler was designed to
fit into a PDP-11's memory.
--
Darren New / San Diego, CA, USA (PST)
Helpful housekeeping hints:
Check your feather pillows for holes
before putting them in the washing machine.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert wrote:
> How about Microsoft's engineers starting the whole Hungarian Notation
> convention with Windows programing. (like lpstrFilePath or iRecursion, etc.)
> There seems to be no set standard to it. While the intention is good, a
> beginner may have wonder why some variables have names like lpszDemung or
> lpfnCBack.
>
> --
> H²
>
>
I do camel case with lowercase leading letters in my code. It's just how
I name functions. Classes, objects, templates, etc get a leading capital
letter, so do most instances of objects in C++.
Last group project class I was in, one teammate complained about it. He
liked code written his way only, and since I was the debugger of the
group he really didn't like my edits. He told me I could use any other
convention I liked, but I was not to state with a leading lowercase
without a reason. I offered to start with lowercase letters for
Hungarian Notation. Very quickly, my normal method of naming was allowed
to remain untouched.
It was sad that I had to explain why I was laughing and he was panicking
to the third member of our group.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> I disagree.
>
Good, 'cause you're wrong.
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Orchid XP v8 wrote:
> stbenge wrote:
>
>> Of course if I were programming for a living, I would probably go to
>> school where they would teach me how to write code that people could
>> decipher :)
>
> Don't count on it! ;-)
I should take *some* C++ courses, considering my near-total confusion
when trying to use Irrlicht recently... I'm pretty much clueless when it
comes to classes and such.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Fri, 27 Jun 2008 01:26:58 +0300, Eero Ahonen
<aer### [at] removethis zbxt net invalid> wrote:
>Warp wrote:
>>
>> I disagree.
>>
>
>Good, 'cause you're wrong.
I can't help but agree with you.
--
Regards
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Thu, 26 Jun 2008 21:56:40 +0100, Orchid XP v8 <voi### [at] dev null>
wrote:
What happened to you? I thought that you were coming for a drink
tonight?
--
Regards
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert wrote:
>
> Why doesn't the rest of the world understand that?
>
But they do understand. Each in his own way.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I'm a rebel I use both ways and other ways.
If the 'if' condition is short I put it all line.
if it's a little longer maybe the line below
Readable is minor compared to the total lack of documentation people use
in their C and c++ programs.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> I, for one, find it much easier to read C++ code which is braced like
> this:
Me too, that's how I code and how I code in POV too. I think it looks much
nicer spaced out like that, I think of the braces as a way to force a line
of white-space (apart from the brace character, obviously) above and below
blocks of code.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Stephen wrote:
> What happened to you? I thought that you were coming for a drink
> tonight?
Oh.
I thought I said I'd check whether I'm available and get back to you?
[Which admittedly I never did...]
Turns out I had to move furnature around instead. Sorry about that...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Fri, 27 Jun 2008 10:06:14 +0100, Invisible <voi### [at] dev null> wrote:
>Stephen wrote:
>
>> What happened to you? I thought that you were coming for a drink
>> tonight?
>
>Oh.
>
>I thought I said I'd check whether I'm available and get back to you?
>[Which admittedly I never did...]
>
>Turns out I had to move furnature around instead. Sorry about that...
Good job we waited in the pub ;)
--
Regards
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> Oh.
>>
>> I thought I said I'd check whether I'm available and get back to you?
>> [Which admittedly I never did...]
>>
>> Turns out I had to move furnature around instead. Sorry about that...
>
> Good job we waited in the pub ;)
Oh well - I hope you lot enjoyed yourselves even if I didn't. Heh. ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw wrote:
[...]
> Whereas I find the first far too spread out to be able to read easily and
> use the second as my standard code layout in C-like languages
Heh, that reminds me... Some guy actually wrote code like this:
if (DoNot == 0)
{
DoThis = true;
} else {
DoThis = false;
}
This was a few years back and on old university monitors, so he didn't
actually have much more than 10 commands TOTAL on screen at any given
time. How you keep an overview over the entire algorithm in that manner
is lost on me, and obviously on him, too: he didn't get his code working
in three weeks.
Regards,
Tim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tim Nikias wrote:
>
> Heh, that reminds me... Some guy actually wrote code like this:
>
Somehow those variables remind me of what I've decided I'll do at work
some day, when I'll have a place where it fits:
if (!successful) {
try_harder();
}
> Regards,
> Tim
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp <war### [at] tag povray org> wrote:
> Gail Shaw <initialsurname@sentech sa dot com> wrote:
> > Whereas I find the first far too spread out to be able to read easily
>
> Compactness does not imply readability. On the contrary.
>
> --
> - Warp
IBELIEV
ETHATIN
THISCAS
EIAMCOM
PELLEDT
OAGREEW
ITHYOU!
BEST
REGA
RDSM
IKEC
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Compactness does not imply readability. On the contrary.
I'd say that there is only a fairly weak correlation (positive or
negative) between compactness and readability.
x = 2*y*y*y - 3*a*b
is much more readable than
t1 = y*y
t2 = y*t1
t3 = 2*t2
t4 = a*b
t5 = 3*t4
t6 = t3-t5
despite being much more compact. Counter-examples in the opposite
direction are not hard to find either.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> is much more readable than
>
> t1 = y*y
> t2 = y*t1
> t3 = 2*t2
> t4 = a*b
> t5 = 3*t4
> t6 = t3-t5
>
> despite being much more compact. Counter-examples in the opposite
> direction are not hard to find either.
Hey ... that looks familiar.
... I think someone here used to write code exactly like that! 0.o
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Stephen wrote:
> On Fri, 27 Jun 2008 01:26:58 +0300, Eero Ahonen
> <aer### [at] removethis zbxt net invalid> wrote:
>
>> Warp wrote:
>>> I disagree.
>>>
>> Good, 'cause you're wrong.
>
> I can't help but agree with you.
I disagree.
Everyone's wrong!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Eero Ahonen wrote:
> Tim Nikias wrote:
>>
>> Heh, that reminds me... Some guy actually wrote code like this:
>>
>
> Somehow those variables remind me of what I've decided I'll do at work
> some day, when I'll have a place where it fits:
>
> if (!successful) {
> try_harder();
> }
>
>> Regards,
>> Tim
>
>
try
{
AcheiveYourGoals();
}
catch(DidntSucceedException ex)
{
TryAgain();
}
:p
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
stbenge wrote:
> If I worked for an organization, I would definitely change my style. Of
> course if I were programming for a living, I would probably go to school
> where they would teach me how to write code that people could decipher :)
Write code that others can decipher? Why would you do a thing like that? ;)
Everyone knows that if you code for a living, you code for job
security... you wouldn't want the janitor to take your job, would you? :D
(Of course, I'm joking .... it doesn't work well in a team environment
to code for job security)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Halbert wrote:
> How about Microsoft's engineers starting the whole Hungarian Notation
> convention with Windows programing. (like lpstrFilePath or iRecursion, etc.)
> There seems to be no set standard to it. While the intention is good, a
> beginner may have wonder why some variables have names like lpszDemung or
> lpfnCBack.
There seems to be two standards, one which describes type: lpszString
and one that defines function (sort of): instead of iOptions, it's fOptions.
You don't know how many times I've looked at a function signature, and
seen fSomething on something that should receive bits and wondered why
the hell they want a float, only to look a bit to the left and see that
it is indeed an integer.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
> try
> {
> AcheiveYourGoals();
> }
> catch(DidntSucceedException ex)
> {
> TryAgain();
> }
try
{
AchieveYourGoals();
}
catch (Failure e)
{
CallAirStrike();
}
// With appologies for Murphy...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
>
> try
> {
> AcheiveYourGoals();
> }
> catch(DidntSucceedException ex)
> {
> TryAgain();
> }
>
> :p
Would be great, too :). The thing about my code is that at work we have
this department-wide habit that if someone says "this doesn't work" or
"I can't do this" oslt, the first answer is usually "try harder".
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> wrote:
> I'd say that there is only a fairly weak correlation (positive or
> negative) between compactness and readability.
> x = 2*y*y*y - 3*a*b
The context was really a multilined program source code, not a
mathematical formula, which your line really is.
Mathematical formulae can often be written compactly because they
a) aren't really program code, and b) there's an established syntax
to write it compactly.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> The context was really a multilined program source code, not a
> mathematical formula, which your line really is.
>
> Mathematical formulae can often be written compactly because they
> a) aren't really program code, and b) there's an established syntax
> to write it compactly.
Perhaps you forget, the very word "computer" means "device for
performing mathematical calculations". ;-)
Having programmed with Haskell for a while now, I would contest the
"programs aren't mathematics" assertion. Having played with mathematics
for even longer, I would contest the "established syntax" assertion too!
[Rather, there are several incompatible and variously ambiguous syntaxes
for writing any particular mathematical construct...]
Regardless, I would assert that how "readable" something is depends on
how well it maps to your underlying mental processes - which is rather
independant of the compactness or otherwise of the code. ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
> Hey ... that looks familiar.
>
> ... I think someone here used to write code exactly like that! 0.o
It's certainly what the compiler transforms your code into - this is
what machines derived from the design of Turing expect. But it is not
necessarily how humans think. ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Eero Ahonen" <aer### [at] removethis zbxt net invalid> wrote in message
news:4864edce$1@news.povray.org...
> Tim Nikias wrote:
> >
> > Heh, that reminds me... Some guy actually wrote code like this:
> >
>
> Somehow those variables remind me of what I've decided I'll do at work
> some day, when I'll have a place where it fits:
>
> if (!successful) {
> try_harder();
> }
My honours project at university had a line of code in it
while (!hellFrozenOver) {
...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
> stbenge wrote:
>
>> If I worked for an organization, I would definitely change my style.
>> Of course if I were programming for a living, I would probably go to
>> school where they would teach me how to write code that people could
>> decipher :)
>
> Write code that others can decipher? Why would you do a thing like that? ;)
>
> Everyone knows that if you code for a living, you code for job
> security... you wouldn't want the janitor to take your job, would you? :D
Around here it is highly unlikely that a janitor would know how to
program a computer, let alone operate one. This isn't to say people
around here are stupid or anything. They are just generally
computer-illiterate.
> (Of course, I'm joking .... it doesn't work well in a team environment
> to code for job security)
A bit off-topic, but this reminds me of a guy I worked with at the
travel nurse agency. The man worked in the 'computer engineering'
section, along with the manager. His job, as far as I could tell, was to
keep the computers running smoothly, and to archive lists of available
or potentially available nurses. Now maybe I'm missing something here,
but do you really need your own server for that kind of work? Can't you
do those things with conventional computers and storage? Why did we even
need a server when there were only about zero or three people making
travel reservations at any given time? I wonder things these because the
'computer engineer' seemed very self-important, an active preserver of
personal job security. He even cast a contentious look one time when I
helped a lady with her computer's resolution! Odd situation at any rate.
Sam
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw wrote:
> My honours project at university had a line of code in it
>
> while (!hellFrozenOver) {
> ...
...you realise that when hell freezes over, your program is going to
fail in an undefined way, right? (YHF bug?)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Orchid XP v8" <voi### [at] dev null> wrote in message
news:48652fca$1@news.povray.org...
>
> ...you realise that when hell freezes over, your program is going to
> fail in an undefined way, right? (YHF bug?)
>
In the case of that piece of code, it would just not do anything on that
fateful day
The loop in question was the program's main activity loop (Distributed VR
system)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike Raiford wrote:
> Warp wrote:
>> Gail Shaw <initialsurname@sentech sa dot com> wrote:
>>> Whereas I find the first far too spread out to be able to read easily
>>
>> Compactness does not imply readability. On the contrary.
>>
>
> Case in point:
>
> n=(i<12&&j>=i)?(sqrt(z)*y+j):(y+j*i);
>
> vs
>
> if( i < 12 && j >= i )
> {
> n = sqrt(z) * y + j;
> }
> else
> {
> n = y + j * i;
> }
>
> ;)
I'd like to see the specification that gave rise to that snipped of code. ;)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> Perhaps you forget, the very word "computer" means "device for
> performing mathematical calculations". ;-)
Actually, it means "person whose job it is to do the arithmetic." Only
after they automated it did it refer to a machine. :-)
--
Darren New / San Diego, CA, USA (PST)
Helpful housekeeping hints:
Check your feather pillows for holes
before putting them in the washing machine.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Gail Shaw wrote:
> "Eero Ahonen" <aer### [at] removethis zbxt net invalid> wrote in message
> news:4864edce$1@news.povray.org...
>> Tim Nikias wrote:
>>> Heh, that reminds me... Some guy actually wrote code like this:
>>>
>> Somehow those variables remind me of what I've decided I'll do at work
>> some day, when I'll have a place where it fits:
>>
>> if (!successful) {
>> try_harder();
>> }
>
> My honours project at university had a line of code in it
>
> while (!hellFrozenOver) {
> ...
>
>
was that before or after Lordi won?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |