B
Brian
Keith said:Brian said:Eric Sosman wrote: [...]- What is the type of `1'?
I would assume it would be "coerced" to the type of n, yes? [...]
The type of 1 is int.
No matter what the type of n is?
Keith said:Brian said:Eric Sosman wrote: [...]- What is the type of `1'?
I would assume it would be "coerced" to the type of n, yes? [...]
The type of 1 is int.
Just because you can't doesn't mean that anyone else can't.
Don't worry,
you can continue to program in C. No one is going to make you change your
religion.
Ian said:Can't what?
OK, I thought it was a C++ thing and that's where I got the idea. I just
extended it and use my own header as I try to avoid standard headers as
much as possible and stick with the language proper.- Hide quoted text -
Fix C/C++ especially if having used it for years.
That would not be a
good sign: a programmer without a highly evolved toolbox (not just source
code either) after a few years, say 5, but surely after 10, of
programming in a language.
The only thing worse would be a programmer
that has no idea what is even wrong with the languages.
you want to *avoid* standard headers?! Why for deity's sake?
Nick said:you want to *avoid* standard headers?! Why for deity's sake?
Ian said:There no such thing as C/C++. The languages are distinct, each with
its own set of foibles.
What does that have to do with fixing a language? If you wish to fix
a language, get involved with the standardisation process.
One thing worse is a programmer who demonstrates that they don't
understand how to use the languages they want to fix.
Nick said:On 16 Sep, 06:25, "Brian" <BWeird!@internet.> wrote:[...] I
just extended it and use my own header as I try to avoid standard
headers as much as possible and stick with the language proper.you want to *avoid* standard headers?! Why for deity's sake?
Well that sounds like something for a separate thread on another day. I'm
sure some of you guys will like those thoughts as much as my macros. I
don't usually post code because it's all really "top secret"
but this
stuff is not and I had a feeling some of you could do better with the
bit-level than me (the correctness, not the naming) as I haven't
traditionally found the very low-level "design" to be interesting enough
but am getting more of an appreciation for it,
but I think it should be
fixed once and then used "forever" rather than dealt with at every line
of code for that is a waste of human effort and money.
I don't even need one of those full time on
a software project and maybe not even at all.
What's the benefit of these macros? How is
setbit(x, n)
easier to read or to write than
x |= 1 << n;
Use if you wish. It's not like I invented anything other than short
names. Doing it once and wrappering it is loads better than being at the
lowest level all the time. That indeed is what programming is all about.
Just because standard C is fixed in stone doesn't mean anyone has to be
limited by that.
Nick said:Nick said:On 16 Sep, 06:25, "Brian" <BWeird!@internet.> wrote:[...] I
just extended it and use my own header as I try to avoid standard
headers as much as possible and stick with the language proper.you want to *avoid* standard headers?! Why for deity's sake?
Well that sounds like something for a separate thread on another
day. I'm sure some of you guys will like those thoughts as much as
my macros. I don't usually post code because it's all really "top
secret"
you program missiles?!
but this
stuff is not and I had a feeling some of you could do better with the
bit-level than me (the correctness, not the naming) as I haven't
traditionally found the very low-level "design" to be interesting
enough but am getting more of an appreciation for it,
but I think it should be
fixed once and then used "forever" rather than dealt with at every
line of code for that is a waste of human effort and money.
yes, this is correct. A set of bit handling abstractions *is* a good
idea if your code is doing a lot of bit manipulation. Where did you
get the idea that anyone was disagreeing. Where we part company is if
your macros are powerful (they aren't, they are trivial),
useful (not
very),
correct (maybe not with the off-by-one errors)
and standards
based
(you seem to avoid standard headers and hide C behind obscure
macros).
So are these the best set of bitset macros in world?
Ian said:I thought you had demonstrated through your narcissistic approach and
disregard for standards that you weren't part of software team?
Well that you feel the need to resort to insult is too bad. Good luck
with that attitude.
luserXtrog said:Yes, but there's a distinction between abstracting and obfuscating.
I'm all for idiosyncracy and even cleverness; but it's useless if
not tempered by pragmatism. Unless you're directly invoking
fundamental archetypes, the right brain needs lots and lots of
context to deliver informed intuitions. Uninformed intuitions
are worse that poor logic because the error is so much more difficult
to extract.
Besides 'and' is 3 characters while '&&' is only 2.
That's a 33.3% savings in both time and space.
And one fewer dimensional layer means an infinite
difference towards simplicity.
Once you analyse the intended purpose of the dogma,
it no longer rules you, you rule it. Then you may apply it or not
as the situation demands.
Ian said:No insults, just an honest appraisal.
On 09/16/10 09:09 PM, Brian wrote:
"I have found both the C and C++ standards to be suboptimal (not very
good actually). I mean, if you're stuck in having to use it is one
thing, but it's really easy to do much better for almost any given
project than the standard stuff."
You just proved me right.
No insults, just an honest appraisal.
On 09/16/10 09:09 PM, Brian wrote:
"I have found both the C and C++ standards to be suboptimal (not very
good actually). I mean, if you're stuck in having to use it is one
thing, but it's really easy to do much better for almost any given
project than the standard stuff."
You just proved me right.
Nick said:On 16 Sep, 09:16, "Brian" <BWeird!@internet.> wrote:[...] I don't usually post code because it's all really "top
secret"you program missiles?!but I think it [bit manipulation] should be
fixed once and then used "forever" rather than dealt with at every
line of code for that is a waste of human effort and money.yes, this is correct. A set of bit handling abstractions *is* a good
idea if your code is doing a lot of bit manipulation. Where did you
get the idea that anyone was disagreeing. Where we part company is if
your macros are powerful (they aren't, they are trivial),
It's just bit twiddling. How "powerful" can they be?!
I find them very useful. They make my GUI library a bit more elegant.
Well forget that part because it's part of the "top secret" stuff.
I have found both the C and C++ standards to be suboptimal (not very good
actually). I mean, if you're stuck in having to use it is one thing, but
it's really easy to do much better for almost any given project than the
standard stuff.
What you don't seem to want to recognize is that C is obscure and the
macros fix a teeny tiny bit of that obscurity,
and I'm totally fine with
that as I am not trying to convince anyone to use my code,
but why all of
you in 3 part harmony want to sell me on "the standard way of doing
things" when you don't have one ioda of an idea of what I am working on,
escapes me.
Fine. Point me to some better ones then. I will use them if I find them
better than the ones I have.
Brian said:Surely you are joking! Give each to a student in programming 101 without
any instruction and see the results. You don't need to have the car
engine exposed to drive the car. Low-level cryptics are not important,
productivity is. Abstraction rules (else use machine language directly).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.