The C Containers Library

N

Nick Keighley

If he worked for the government, he would have called $2000 pocket
change. :)

A private business for which $2000 is a major expense that threatens
it's liquidity isn't doing very well; the owner should seriously
consider liquidating the company and try doing something else to earn a
living.

companies I've worked for wouldn't consider $2000 a threat to
liquidity,
nevertheless it's not a sum they'd like to see squandered.

I remember it taking three signatures some of them from quite senior
people
in the company to buy a Borland C compiler. Don't even think about
hiring a
car!
 
R

Rui Maciel

Ansel said:
What *isn't* the problem with Unicode?! Like most one-size-fits-all
things, it's a severe compromise almost everywhere you use it.

Could you provide an example that points out any problem with unicode?

All kinds
of metaphors apply -- like using an 18-wheeler to run errands around town
and go grocery shopping. One thing you can definitely say about Unicode --
it's BIG!

Considering its purpose, it would be strange if it wasn't big.


Rui Maciel
 
Q

Quentin Pope

Le 02/08/12 13:00, James Kuyper a écrit :
If he worked for the government, he would have called $2000 pocket
change. :)

A private business for which $2000 is a major expense that threatens
it's liquidity isn't doing very well; the owner should seriously
consider liquidating the company and try doing something else to earn a
living.
The average wage in the U.S. is 39 959 US$/year, i.e around 3 329 US$ a
month.[1]

For people that earn much more, the effort that you must do to have US$
2000 to spare looks ridiculous, mainly because they have never been in a
situation where they have to think about money.

Look, this is an average wage. It's brought down by millions of Mexicans
cleaning fryers in taco shops. Very few IT professionals earn much below
$100k and many earn plenty more than that, especially those with
experience or specialist skills.

You work as a software developer, right? If your company is any good, it
would willingly sponsor you to travel to a conference run by a standards
body. If you're self-employed, just pay for yourself and it will be tax-
deductible.

Based on past experience, though, you seem to prefer getting free
advertising by spamming this group with messages about your compiler, so
you probably aren't so keen on spending actual money to promote your
products.

//QP
 
M

Malcolm McLean

בת×ריך ×™×•× ×—×ž×™×©×™, 2 ב×וגוסט 2012 12:00:49 UTC+1, מ×ת James Kuyper:
On 08/02/2012 03:48 AM, Nick Keighley wrote:

A private business for which $2000 is a major expense that threatens
it's liquidity isn't doing very well; the owner should seriously
consider liquidating the company and try doing something else to earn a
living.
Two thousand dollars is a reasonable month's salary. It might not be much in relation to what you can get as an employed programmer, but often it's more than it seems because you can claim a lot of expenses as tax deductible,then you often have fewer real expenses than people with regular employers.. Plus you choose your own hours and projects. And you always live in hope that the business will blossom into the next Apple. That won't happen with a salaried job.
 
M

Malcolm McLean

בת×ריך ×™×•× ×©×œ×™×©×™, 31 ביולי 2012 00:53:41 UTC+1, מ×ת Rui Maciel:
Malcolm said:
That [STL] was the point at whcih people
stopped switching from C to C++, and started moving from C++ to other
languages.

Is it a personal opinion or is there any basis for that assertion?
C++ is in decline. There are various metrics you can use to measure a language's popularity. They show that C++ has been in decline since about 2003. Microsoft did ship an STL implmentation with Visual Studio 6.0 in 1998, butit was poor quality and wasn't used much. 2003 more or less marks the start of the widespread use of STL when the .NET Visual Studios came out. So the widespread adotion of STL marks the beginning of the decline. Post hoc, ergo propter hoc.
 
A

Ansel

Ansel wrote: > What *isn't* the problem with Unicode?! Like most one-size-fits-all > things, it's a severe compromise almost everywhere you use it. Could you provide an example that points out any problem with unicode? > All kinds > of metaphors apply -- like using an 18-wheeler to run errands around town > and go grocery shopping. One thing you can definitely say about Unicode -- > it's BIG! Considering its purpose, it would be strange if it wasn't big. Rui Maciel

I could surely point out a dozen in fewer minutes than that, but I'm not going to -- exercise left for the reader.
 
R

Rui Maciel

Ansel said:
I could surely point out a dozen in fewer minutes than that, but I'm not
going to -- exercise left for the reader.

In other words, you can't.


Rui Maciel
 
R

Rui Maciel

Malcolm said:
C++ is in decline. There are various metrics you can use to measure a
language's popularity. They show that C++ has been in decline since about
2003.

I've noticed that you avoided providing any example where you try to show
that declaring an array and iterating through it is "too cumbersome".

Regarding your claim, can you point at least one of those metrics where
you've based your assertion?


2003 more or less
marks the start of the widespread use of STL when the .NET Visual Studios
came out. So the widespread adotion of STL marks the beginning of the
decline. Post hoc, ergo propter hoc.

Again, where do you base your assertion that C++ is in decline since 2003?
Do you actually base your assertion on any tangible evidence or did you made
that up?


Rui Maciel
 
J

jacob navia

Le 03/08/12 23:31, Rui Maciel a écrit :
Again, where do you base your assertion that C++ is in decline since 2003?
Do you actually base your assertion on any tangible evidence or did you made
that up?

I would not say that c++ is in "the decline" but there are some
developments that are noteworthy.

1) After several YEARS of work, the creator of the language declares
that he is unable to add a new feature to the language.

This means that C++ has become such a complex software construct that
it is impossible for its creator (Mr Bjarne Stroustrup) to fully
understand the consequences of a language enhancement. This shows
us the level of complexity reached by C++.

2) Undeterred by this fact, the new standard piles up yet another thick
software layer into the already brittle edifice. Lambdas, and other
esoteric constructs add more complexity as if increasing the
number of language constructs and their unforeseen interactions
was a good thing!

3) It is more or less impossible to parse C++ without the help
of a machine. For instance the specifications of the operator
overloading part goes into pages and pages of complex specifications
(if I remember correctly there were more than 5 full pages) and at the
end you had to do a topological sort of the classes defined at the
point of call to be able to see which overloaded operator would spring
into action at a given point.

Obviously the consequence is that instead of trying to understand by
reading, you have to follow the debugger and bring the program to the
point of the overloaded call to be sure it goes to where you think it
is going.

And you can be sure that somebody else, unaware of all this adds an
overloaded call, introducing a bug in a completely unrelated part of the
program.

Can you do that test for all overloaded calls you write?
Do you have the time?
Can you repeat that test each time somebody introduces a new overloaded
version of that function within your scope?

No. Then you just write it and suppose it is OK. And in most cases it
is. But then... well then you call the maintenance people that are used
to that kind of nightmares. At last, they are paid for doing that isn't
it?


4) All C++ programmers (besides Bjarne) use a portion of the huge
language since it is not possible to fit every detail of that into a
human brain.

This means that only the overlapping portions of the language can be
understood by all of them, and a proliferation of "C++ subsets" starts
that makes communication between programmers more difficult.

In all my life as a programmer I have tried to keep things SIMPLE.
That is why I like (and use) the C language. C is a language that
can be understood in full by a person.

Yes, I know. You will tell me that the complexity is in the language
instead of in every program that uses the language and that a complex
language simplifies programs. Yes, I do KNOW that.

But there is a point of diminishing returns where you add complexity to
the language trying to be all things to everyone and you end up with
being a complexity monster for everyone.

I know that you like C++ Rui, and I hope you do not feel personally
attacked since I am talking about a computer (machine) language.

We tend to get attached to languages because of other philosophical
reasons. For instance the fact that I like small and simple computer
languages comes from my beliefs that "small is beautiful" from my youth,
and many other things that are more or less completely irrelevant here.

Let's try to put all that baggage aside and discuss in a rational
manner.

jacob
 
A

Ansel

Ansel wrote: > I could surely point out a dozen in fewer minutes than that, but I'm not > going to -- exercise left for the reader. In other words, you can't. Rui Maciel

A lazy student wanting to get all the answers from the teacher instead of doing his homework? Try doing a web search and you will surely get loads of issues, problems, complaints about Unicode. If this was a NG about Unicode,or if there was one, I'd probably drop-in for a few discussions about it. As it is, this is the C NG (BTW, what happened to comp.lang.c.moderated?) and the topic is too far removed from C programming language issues.

So, next time, before you start making childish assertions, and playing childish goading games, you should do a little research on your own first so that you don't look so foolish and immature.

(Yeah, that's it... put that in your whack pipe and smoke it!)

:)
 
B

Ben Bacarisse

jacob navia said:
This means that C++ has become such a complex software construct that
it is impossible for its creator (Mr Bjarne Stroustrup) to fully
understand the consequences of a language enhancement.

In informal contexts like this I'd say it's perfectly acceptable to say
"Bjarne Stroustrup", but if you're going to give him a title, give him
the right one. He has a PhD from Cambridge, and holds the College of
Engineering Chair in Computer Science at Texas A&M University. Using
"Mr" could be misconstrued.

<snip>
 
8

88888 Dihedral

Rui Macielæ–¼ 2012å¹´7月31日星期二UTC+8上åˆ7時53分41秒寫é“:
Malcolm McLean wrote:


When STL first came out I thought that maybe it was the end of C. The STL
containers did provide runtime performance and encapsulation that you had
to handtune C to match. But actually the result was the reverse. I think
it was because STL made the syntax for just declaring an array and
stepping through it too cumbersome.



Could you provide an example where you demonstrate how declaring an array

and iterating through it is "too cumbersome"?




That was the point at whcih people
stopped switching from C to C++, and started moving from C++ to other
languages.



Is it a personal opinion or is there any basis for that assertion?




C++ had a huge user base behind it and is still a popular
language. But ever since STL it's been in decline.



The only time I ever heard of any real world complain regarding the STL was

from people involved in game programming, whose complaints were somewhere

between worries that some STL implementations might have efficiency issues

and ignorance on the programmer's behalf.[1] Other than this, I believe you

will be hard-pressed to find a C++ programmer who doesn't employ the STl in

his code.

I think the vector module in C++ is good for beginners.


It is a list of objects that can be expanded or shrinked automatically.
( How this feature is implemented is another question.)

But I have to point out that if the length of the list is changed
in nontrival loops or a loop of a loop, then it's the programmar's
job to be sure that no bad side effects will happen.
 
A

Anders Wegge Keller

Ansel said:
So, next time, before you start making childish assertions, and
playing childish goading games, you should do a little research on
your own first so that you don't look so foolish and immature.

So actually, you cannot point out a single place where the unicode
specification is ambigous (which is what you implied in the start of
this subthread). Another thing I noted, is that you play the offtopic
card, only after you have been unable to play the childish defence of
"Find the answer yourself".
 
N

Nick Keighley

 So actually, you cannot point out a single place where the unicode
specification is ambigous (which is what you implied in the start of
this subthread). Another thing I noted, is that you play the offtopic
card, only after you have been unable to play the childish defence of
"Find the answer yourself".

he's probably unhappy they didn't accept the proposal to add Klingon.
I'm with you I think he's just randomly moaning and can't actually
point out any serious problem.
 
S

SG

Am Sonntag, 8. Juli 2012 21:53:07 UTC+2 schrieb jacob navia:
[...]
"The C Containers Library"
[...]

I just skimmed the PDF and noticed this on page 42:

int function(void)
{
char listSpace[iList.Sizeof(NULL)];
iList.Init(listSpace);
}

I think this qualifies as an alignment issue.
 
J

jacob navia

Le 04/08/12 13:52, SG a écrit :
Am Sonntag, 8. Juli 2012 21:53:07 UTC+2 schrieb jacob navia:
[...]
"The C Containers Library"
[...]

I just skimmed the PDF and noticed this on page 42:

int function(void)
{
char listSpace[iList.Sizeof(NULL)];
iList.Init(listSpace);
}

I think this qualifies as an alignment issue.

Yes. I have added a paragraph after that code:

Problems with the above construct could arise because of the alignment
requirements of the platform
where the library is running. Instead of a char as the type
of the buffer, it is better to use a slightly more complicated
expression to ensure correct alignment. For instance:

size_t s = (sizeof(void *)+iList.Sizeof(NULL))/sizeof(void *);
void *listSpace;
 
I

Ike Naar

Le 04/08/12 13:52, SG a ?crit :
Am Sonntag, 8. Juli 2012 21:53:07 UTC+2 schrieb jacob navia:
[...]
"The C Containers Library"
[...]

I just skimmed the PDF and noticed this on page 42:

int function(void)
{
char listSpace[iList.Sizeof(NULL)];
iList.Init(listSpace);
}

I think this qualifies as an alignment issue.

Yes. I have added a paragraph after that code:

Problems with the above construct could arise because of the alignment
requirements of the platform
where the library is running. Instead of a char as the type
of the buffer, it is better to use a slightly more complicated
expression to ensure correct alignment. For instance:

size_t s = (sizeof(void *)+iList.Sizeof(NULL))/sizeof(void *);
void *listSpace;


It looks like the formula

(sizeof(void *)+iList.Sizeof(NULL)) / sizeof(void *);

wastes sizeof(void*) bytes if iList.Sizeof(NULL) is a multiple of
sizeof(void*). I think the intention of the formula is to compute
iList.Sizeof(NULL) rounded upward to the next multiple of sizeof(void*),
and if that is the case,

(sizeof(void*) - 1 + iList.Sizeof(NULL)) / sizeof(void*);

would suffice.

A slightly more serious issue is that this only fixes the alignment
problem if it is guaranteed that the alignment requirements for a
header structure are not stricter than the alignment requirements
of a void*.

If the type of the header structure were known to the program,
there would be a simpler solution:

/* assuming the type of header structure is HEADER_STRUCTURE_TYPE */
HEADER_STRUCTURE_TYPE headerspace;
iList.Init(headerspace);

which would have the additional advantage that it doesn't use a
variable length array, so it would work with a pre-C99 compiler.
 
I

Ike Naar

If the type of the header structure were known to the program,
there would be a simpler solution:

/* assuming the type of header structure is HEADER_STRUCTURE_TYPE */
HEADER_STRUCTURE_TYPE headerspace;
iList.Init(headerspace);

Sorry, that should probably be

iList.Init(&headerspace);
 

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
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top