What is the gain of "inline"

I

Ian Collins

jacob said:
Nick Keighley a écrit :

Exactly. Complexity is not a good feature.

That is why I insist that C has a future: it has less features. The whole
science of engineering is getting the balance right between NECESSARY
features and easy of use.

C has a future because there are domains where it is still the most
appropriate tool.
With a certain complexity level, computer languages become unusable.

An given problem will require a certain level of complexity to solve.
The choice of programming language dictates how much of that complexity
has to be implemented by the programmer.
 
M

Michael Foukarakis

  size_t read_size = min(end - ptr, remaining);

remaining is unsigned, end - ptr is ptrdiff_t.

That snippet of code, as well as macro definitions of min()/max(), is
just an unfortunate hack. It's also a great what-not-to-do example:
Linux developers would've used long, Windows developers DWORD_PTR. At
least they'd know they were writing platform-specific code (or 32-bit
specific, for that matter). If you're going to try and write code like
that, at least do it right and use ptrdiff_t and size_t consistently,
which would've worked correctly with a template min() as well
(shocking, I know).

While templates have their own set of problems, they were never meant
to be the bane of macros. The fact that they can solve some of the
same problems is merely a coincidence.

PS. This thread has gone way overboard. Anyone care to change the
subject to "e-peen contest"?
 
G

gwowen

That is comic. In the company we were forced to rview
all the C++ code that used "max" since in C++ max
doesn't allow for ifferent arguments in its parameters
since it is a template

Only if you rely automatic template parameter deduction...

int main(void)
{
// Specify the template parameter
printf("%d\n",(int) std::max<double>(6.4,2));
}

Besides, is max(6.4, 7) an integer or a double?
It doesn't really matter in a simple assignment, but it matters with
operator overloading. If I have

foo(int n);

and

foo(double x);

which should I call if the code says
foo(std::max(6.4,7)); // which foo()?

Given that you've added operator/function overloading to C, I'd expect
you to have a grasp on these issues.

Alternatively, just define your own...
namespace jacob_navias_workplace
{
template <typename T, typename U>
const T& max(const T& l, const U& r){
return r > l ? T(r) : l;
}
}

And, if you define a non-const overload you keep have nice syntax like
double x = 3.0, y = 7.0;
// set larger value to zero
max(x,y) = 0.0;
 
M

Michael Foukarakis

Nick Keighley a écrit :





Exactly. Complexity is not a good feature.

That is why I insist that C has a future: it has less features. The whole
science of engineering is getting the balance right between NECESSARY
features and easy of use.

With a certain complexity level, computer languages become unusable.

jacob

More features don't add to the complexity perceived by the developers.

Not taking the time to understand what you're using, on the other
hand, does.
 
A

Antoninus Twink

jacob navia <[email protected]> writes:

Once again, Carmodey slips up. Interesting that someone who claims to
have killfiled Jacob should reply directly to him...

(Just in case anyone doubted it, fake killfiling is still rampant in
clc!)
And this demonstrates clearly how you remain so remarkably and
painfully ignorant

[remaining aggressive hate-filled shit snipped]

Narrative 1: Carmodey has killfiled Jacob and has such a low opinion of
him that he'll just ignore what he says.

Narrative 2: Carmodey is a nasty bully who claims he has killfiled
Jacob, but actually can't resist reading his posts to try to find an
excuse to spew out his venom.
 
J

jacob navia

Antoninus Twink a écrit :
Once again, Carmodey slips up. Interesting that someone who claims to
have killfiled Jacob should reply directly to him...

(Just in case anyone doubted it, fake killfiling is still rampant in
clc!)

I think he hasn't go enough technical know how to be able to
manage a killfile.

And this demonstrates clearly how you remain so remarkably and
painfully ignorant

[remaining aggressive hate-filled shit snipped]

Narrative 1: Carmodey has killfiled Jacob and has such a low opinion of
him that he'll just ignore what he says.

Apparently not :)

Narrative 2: Carmodey is a nasty bully who claims he has killfiled
Jacob, but actually can't resist reading his posts to try to find an
excuse to spew out his venom.

All the time. He is aggressive all the time. Impossible to discuss
something without putting some hate in his answer.
 
S

Squeamizh

And this demonstrates clearly how you remain so remarkably and
painfully ignorant about embedded programming, seemingly thinking
that the windows desktop you point and drool at is the be all and
end all of computing. I bet there are microcontrollers aplenty in
that car.

Hey, Fatty McFuckhead, do you remember writing this:
http://groups.google.com/group/comp.lang.c/msg/cf1725dfe578aafa

?

You announce to the world whom you've killfiled, and it's all a lie.
It can't get much more childish than that.
 
P

Phil Carmody

Beej Jorgensen said:
Hey, Fatty McFuckhead [... snip ...]
It can't get much more childish than that.

I'm sorry, but I'm afraid it can.

Heading up-thread...

Ah, someone's obviously confused by the concept that killfiles
may be set to simply mark messages already read, and if when the
group is refreshed there's only one new post, then, despite the
fact that it is marked already read, that message is shown to me,
as there are no other messages that can be shown to me instead.

As it was 1:50, I was probably just doing one last sweep, and I
caught a navia, but didn't let it go.

Phil
 
A

Antoninus Twink

Hey, Fatty McFuckhead [... snip ...]

Ah, someone's obviously confused

Mmmmm huh... keep going Philly...
by the concept that killfiles

Yeah, gee, I think someone is, y'know...

But carry on, Carmy-boy...
may be set to simply mark messages already read, and if when the
group is refreshed there's only one new post, then, despite the
fact that it is marked already read, that message is shown to me,
as there are no other messages that can be shown to me instead.

Yeahhhh.... losing yah there baby, losing yah.
As it was 1:50, I was probably just doing one last sweep, and I
caught a navia, but didn't let it go.

*chortle*

Suuurrre, Philly boy, suuurre.

We all believe you.

No, really.

We're all 100% convinced.

Don't you worry about that, Philly boy.

*chortle*
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top