By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,955 Members | 1,477 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,955 IT Pros & Developers. It's quick & easy.

Writing portable code...

P: n/a
There are some people here (let's call them "regulars" for short)
that are always giving lessons to people about how easy is to
write portable code, etc. They always point fingers at you telling you
how bad you write code.

One of them (I would say the prototype of them) is Heathfield.

Here is an exchange that happened just a few hours ago, that
demonstrates my point:

WRITING CODE IS HARD. And regulars aren't better at it than everybody
else...

Ed Jensen wrote
There are very few regulars here in comp.lang.c that'll admit that
writing 100% portable C code is non-trivial.
Then, Heathfield answered:
I'm one of them, however.
I think it's easy to write *very* portable code, but difficult to write
100% portable code. Consider, for example, this simple program:
[code snipped]

Harald van Dijk answered:
>I can see one very obvious bug: you're using a file after closing it.
That's not the way you should be writing code even if it's not meant
to be portable.
And Heathfield had to acknowledge...
Oh, stupid stupid stupid (me, not you). You're right, of course. That
was unintentional, by the way!
>
Sep 2 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Sun, 02 Sep 2007 10:52:51 +0200, jacob navia wrote:
There are some people here (let's call them "regulars" for short)
that are always giving lessons to people about how easy is to
write portable code, etc. They always point fingers at you telling you
how bad you write code.

One of them (I would say the prototype of them) is Heathfield.

Here is an exchange that happened just a few hours ago, that
demonstrates my point:

WRITING CODE IS HARD. And regulars aren't better at it than everybody
else...
If you mean that regulars are human, they are, but your statement
with its verbatim meaning is only true for sufficiently small
values of "everybody else" <flame>(e.g. you shouldn't be included
in it)</flame>.
Ed Jensen wrote
There are very few regulars here in comp.lang.c that'll admit that
writing 100% portable C code is non-trivial.

Then, Heathfield answered:
I'm one of them, however.
I think it's easy to write *very* portable code, but difficult to write
100% portable code. Consider, for example, this simple program:

[code snipped]

Harald van Dijk answered:
>I can see one very obvious bug: you're using a file after closing it.
>That's not the way you should be writing code even if it's not meant
>to be portable.
>

And Heathfield had to acknowledge...
Oh, stupid stupid stupid (me, not you). You're right, of course. That
was unintentional, by the way!
>
If someone has anything to say about that, they'll answer on that
thread. And your question about C was?
--
Army1987 (Replace "NOSPAM" with "email")
No-one ever won a game by resigning. -- S. Tartakower

Sep 2 '07 #2

P: n/a

"Army1987" <ar******@NOSPAM.itwrote in message
news:pa****************************@NOSPAM.it...
On Sun, 02 Sep 2007 10:52:51 +0200, jacob navia wrote:
>WRITING CODE IS HARD. And regulars aren't better at it than
everybody else...

If you mean that regulars are human, they are, but your statement
with its verbatim meaning is only true for sufficiently small
values of "everybody else" <flame>(e.g. you shouldn't be included
in it)</flame>.
A C compiler is quite a difficult piece of software to write. I planned to
write one as a followup to MiniBasic, but shrank from the challenge.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Sep 2 '07 #3

P: n/a
jacob navia <ja***@jacob.remcomp.frwrites:
There are some people here (let's call them "regulars" for short)
that are always giving lessons to people about how easy is to
write portable code, etc. They always point fingers at you telling you
how bad you write code.

One of them (I would say the prototype of them) is Heathfield.

Here is an exchange that happened just a few hours ago, that
demonstrates my point:

WRITING CODE IS HARD. And regulars aren't better at it than everybody
else...

Ed Jensen wrote
>There are very few regulars here in comp.lang.c that'll admit that
writing 100% portable C code is non-trivial.

Then, Heathfield answered:
>I'm one of them, however.
I think it's easy to write *very* portable code, but difficult to write
100% portable code. Consider, for example, this simple program:

[code snipped]

Harald van Dijk answered:
>>I can see one very obvious bug: you're using a file after closing it.
That's not the way you should be writing code even if it's not meant
to be portable.

And Heathfield had to acknowledge...
>Oh, stupid stupid stupid (me, not you). You're right, of
course. That
was unintentional, by the way!
>>
Was it? Wow. If all of us neglected to make the unintentional mistakes I
fee sure the standards of our code would greatly improve.....

Sep 2 '07 #4

P: n/a
Malcolm McLean wrote:
>
"Army1987" <ar******@NOSPAM.itwrote in message
news:pa****************************@NOSPAM.it...
>On Sun, 02 Sep 2007 10:52:51 +0200, jacob navia wrote:
>>WRITING CODE IS HARD. And regulars aren't better at it than
everybody else...

If you mean that regulars are human, they are, but your statement
with its verbatim meaning is only true for sufficiently small
values of "everybody else" <flame>(e.g. you shouldn't be included
in it)</flame>.
A C compiler is quite a difficult piece of software to write. I planned to
write one as a followup to MiniBasic, but shrank from the challenge.
Indeed. However jacob has, to my knowledge, written only the machine code
generating and optimising portions of lcc-win32. The front-end is mostly
lcc. But I'm not deprecating his efforts.

Sep 2 '07 #5

P: n/a
jacob navia wrote:
There are some people here (let's call them "regulars" for short)
that are always giving lessons to people about how easy is to
write portable code, etc. They always point fingers at you telling you
how bad you write code.

One of them (I would say the prototype of them) is Heathfield.

If I post code, I like to get it corrected. Don't you?

Sometimes, the mistakes are rather uninteresting, typos that would be
detected by a compiler anyway, but in other cases the experts do teach
me something new.

Regulars that post solid code, are a great asset, "anybody" can post a
quote from the standard.
My PB for a clean compile in C, is ca a 1600 liner... that don't mean it
was bug-free.

--
Tor <torust [at] online [dot] no>
Sep 2 '07 #6

P: n/a
On Sep 2, 9:52 am, jacob navia <ja...@jacob.remcomp.frwrote:
There are some people here (let's call them "regulars" for short)
that are always giving lessons to people about how easy is to
write portable code, etc. They always point fingers at you telling you
how bad you write code.

One of them (I would say the prototype of them) is Heathfield.
I wuda used a word something like apotheosis.

Here is an exchange that happened just a few hours ago, that
demonstrates my point:

WRITING CODE IS HARD. And regulars aren't better at it than everybody
else...

It's piss easy really.

Still preaching about your own incompetence.

Martin

Sep 3 '07 #7

P: n/a
On Sun, 02 Sep 2007 19:12:34 +0530, santosh wrote:
Malcolm McLean wrote:
>>
"Army1987" <ar******@NOSPAM.itwrote in message
news:pa****************************@NOSPAM.it.. .
>>On Sun, 02 Sep 2007 10:52:51 +0200, jacob navia wrote:

WRITING CODE IS HARD. And regulars aren't better at it than
everybody else...

If you mean that regulars are human, they are, but your statement
with its verbatim meaning is only true for sufficiently small
values of "everybody else" <flame>(e.g. you shouldn't be included
in it)</flame>.
A C compiler is quite a difficult piece of software to write. I planned to
write one as a followup to MiniBasic, but shrank from the challenge.

Indeed. However jacob has, to my knowledge, written only the machine code
generating and optimising portions of lcc-win32. The front-end is mostly
lcc. But I'm not deprecating his efforts.
Frankly, if the generation and optimization portions are any good, that'd
be quite a feat in and of itself.
Sep 3 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.