Feeds

back to article Bjarne Again: Hallelujah for C++

Now it has been scientifically demonstrated that we Delphi users are the happiest of all programmers, proper significance can at last be attached to the rare woes that occasionally break through our Stepford Coder personas. My test case: Warren Postma, a Delphi-head, was recently forced out of his comfort zone to repair a C++ …

COMMENTS

This topic is closed for new posts.

Page:

This post has been deleted by its author

Flame

The usual non-USA cost bias.

On amazon; $50 in the USA; £42 in the UK. After taking postal rates into account, I'll still be ordering from the USA.

Nobody's going to spin that there's an overt difference in marketing budgets or support costs in a book,. Or if they do, can somebody please shoot them?

4
0
Silver badge

Re: The usual non-USA cost bias.

I guess they must think words are worth less in the US of A.

Which may be true.

2
1
Silver badge

Re: The usual non-USA cost bias.

Funnily enough for most textbooks it's the opposite way around, they are $200 in the USA and £40 in the UK

Based on, if your are paying $50k in tuition you won't mind a few $100 on books

0
0

Re: The usual non-USA cost bias.

Its not that. we pay for our healthcare separately, rather than roll the cost into everything we buy and whatever money we make. how it works out is open for discussion.

1
2
Bronze badge
Coffee/keyboard

Re: The usual non-USA cost bias.

@quod50

You might be surprised to find that the US government spends more per capita on health at $4437 compared to $2919 for the UK. The USA in total spends 17.9% of GDP compared to 9.6% for the UK. This is, perhaps, the price that you pay for having one of the least efficient health systems in the world. You do however spend even more on military spending.

4
0
Silver badge

Re: The usual non-USA cost bias.

But it's currently selling for a third below its usual price on Amazon US and only 12% below its usual price on Amazon UK.

The US price is ordinarily $75, which is £47.98 at today's exchange rate. The normal UK price is £47.99. Once you add some tax, it ordinarily costs more in the US.

0
0
Anonymous Coward

Re: The usual non-USA cost bias.

So you're ordering a book from overseas in order to pay less?

That's STEALING!

0
0
Silver badge

If you want to get by with something smaller

choose something with a smaller problem space than computing.

1
2

£43? Really?

0
0
Silver badge

Yes, really

It's economics. How many are they going to sell, how much does it cost to do all the up-front work such as proofreading and such like, how much does the author get paid, what's the cost of the print run, distribution, etc.

For non-fiction books they don't expect to sell many, plus they're often big and heavy and so the material cost is higher, as is that for distribution.

0
0

STL algorithms

I never used these either - until Lambdas. Now that you can use and algorithm on a single line they have become very handy.

2
0
Bronze badge
Coat

Re "'The most awesome thing about Delphi is that it is not C++"

The nice thing about Borland C++ Builder, it was/(is?), able to quite happily compile Object Pascal as well as C++. Quite nice if you didn't want to rewrite something - probably a bit of a problem for someone not well versed though.

ps

Sorry for whoever had to take up my code :-)

3
0
Silver badge
Thumb Up

Re: Re "'The most awesome thing about Delphi is that it is not C++"

Yeah I liked Borland Builder. I was a member of TeamB (yes, that Andrue) for while but my employer got taken over and the new guys used Visual Studio so that was that.

What I miss most is the VCL. Okay so it wasn't totally standard C++ but it was a near joy to use. Suddenly I was plunged back into the unpleasant world of the resource editor and MFC's idiosyncratic class hierarchy. Eventually we got introduced to some C# projects and I was back in the friendly world of Anders Hejlsberg. C# is pretty good when you get used to it but you don't get that hand-crafted precision code feel that you do with C++. And dear Gawd give me RAII over Garbage Collection any time :(

But back to topic. I like C++. Written well with good use of templates, copy ctors and const it can be quick to write, easy to maintain and safe to execute. It's just unfortunate that most developers prefer to cut corners and churn out questionable code.,

2
0
Bronze badge

Re: "What I miss most is the VCL"

Indeed, it's not the language which is the issue in most circumstances, it's the libraries, and VCL was/(is?) tops. Trouble with current C# stuff is that you have totally laid back ex-Delphi bods mixing with MFC bods who have years of soggy chips on their shoulders. (IME). It was a simpler time back then :-)

2
0

Re: "most developers prefer..."

Have you ever seen what Cobol programmers do when allowed a C compiler? </shudder>

3
1
Bronze badge
Happy

@ AndrueC -- Re: Re "'The most awesome thing about Delphi is that it is not C++"

First: Andrue...nice to finally meet you!

Second: I, too, miss VCL. However, I've found the Qt makes an ample and reasonable replacement.

2
0
Silver badge

"The most awesome thing about Delphi is that it is not C++"

Surely the most awesome thing about Delphi was that it wasn't classic Pascal and conceded you might want applications that talk to the messy outside world and run at decent speeds... all things missing from the language when I was forced to learn it at university ;(

6
0
Bronze badge

Re: "The most awesome thing about Delphi is that it is not C++"

Nowt wrong with Pro-Pascal either, (just needed a bit of assembler to fill in the blanks). Still love the language - a bit like a dog going back to and old piece of spew.

1
0
Anonymous Coward

Re: "The most awesome thing about Delphi is that it is not C++"

And Paul, ObjectPascal laid the foundation for that. I still have a copy of that somewhere...

;-)

1
0
Anonymous Coward

Re: "The most awesome thing about Delphi is that it is not C++"

It was being told not to program in Delphi any more, by a former beloved employer, that put me off programming for life. My Delphi days were happy days, and going back to C, Informix and VB (ugh) made me utmost grumpy.

I can't say I'm unhappy with the outcome though.

1
0

Re: "The most awesome thing about Delphi is that it is not C++"

Pro-pascal - now there's a compiler with bugs in!

0
0
Flame

About The Awe For Templates

Using the C++ template language like a full programming language is very much like using the BrainFuck language:

http://de.wikipedia.org/wiki/Brainfuck

You can do it, but there are usually much, much better ways of doing compile-time code generation:

A) Use a proper macro language such as M4. I venture to say that in 99% of cases that is all you need. Expand the code onto disk and have proper error messages that can be used by your IDE to jump right to the faulty parametric code. Massive, successful and well-performing systems like CATIA use this approach instead of templates.

B) Use a plain C++ program to generate some other C++ code. Call that generator from a make file like you call the m4 macro processor. That spares you to dive into Brainfuck/teamplate language.

Generic code and code generation are not mystical things, they are actually quite straighforward as soon as you remove the C++ Brainfuck variant from the whole story. There is absolutely no need for weird and difficult-to-decipher error messages of you use the approach from above.

But hell yeah, you need to question the holy gods (who are as jealous as that other jealous middle east god) of the C++ standards committee.

4
5
Silver badge

Re: About The Awe For Templates

God Lord ! Whatever C++ faults (and there are many), M4 is not the answer... although to para-phrase "The most awesome thing about M4 is that it's not autoconf".

*shudder*

6
1
Anonymous Coward

Re: About The Awe For Templates

"Use a proper macro language such as M4."

I thought you were contrasting to Brainfuck?

IMHO, I don't find M4 to be a very pleasant entity to work with - I think the syntax is fairly ugly, and I really wish somebody would come up with a cleaner macro expansion system.

But I will agree, compared to template meta-programming, M4 is a breeze - but then, almost anything will come out better in that comparison.

I really wish the C++ standards bearers would provide a cleaner way to do what SFINAE and boost::enable-if did - concepts would have been nice, but event they get fugly in the implementation.

0
0
Bronze badge

Re: About The Awe For Templates

I don't know enough to compare it with templates[*], but Yay for M4! It even works in other language, astonishingly! (I've used with jscript). It's an all-round handy tool.

There are good reasons for folding a (subset of a) preprocessors capabilities into the language - basically you can be assured of a parseable syntax and determinable semantics - but preprocessors have gone out of fashion and it's a shame. They have their place.

@David D. Hagood

What's wrong with the M4 syntax in your view? Other than not having named params, I agree, but one could probably fix that within M4 with a bit of effort.

[*] been a long time since I tried to follow the ever mutating standard, and I'm damned if I'm going back to that dog's breakfast of a language now.

0
0
Anonymous Coward

Re: About The Awe For Templates

It's been a while since I've worked with M4, mostly in the context of autoconf, but trying to remember when things would be expanded, when they would be recursively expanded, and conditionals were all lots of no fun in making a reasonable autoconf work.

0
0
Stop

Actually

I have been lying a bit about CATIA. They use plain C macros for their container classes. That works well enough but it would work even better if they used m4.

0
0
Bronze badge
WTF?

Hmmm. Verity's gone a bit technical, what?

0
0
Silver badge

Multiple inheritance

Are there readers out there who own great farms of mixin classes, yapping and baying from within their barbed wire enclosures?

Multiple inheritance is reasonably common and painless in Python and gets used where it's appropriate. I'm personally not a great fan of "mixins", which I would define as classes that have no standalone instances, per se but they have their uses. At the end of the day you have to be able to understand your object hierarchy and delegation patterns in order to be able to debug it. And if you can remember that you might be debugging somebody else's code then you might be tempted to write more verbose but clearer code, including class genealogy.

0
1
Silver badge

C++

The triumph of syntax over clarity.

A bad language from a bad language designer.

10
13
Silver badge

Re: C++

Counterexample to back up your assertion, please...

2
0

Re: C++

Bjarne Stroustrup: "There are only two kinds of languages: the ones people complain about and the ones nobody uses."

One day there will be a worthy successor to C++. We would have one already if this industry wasn't so keen on naval gazing. It will not include garbage collection (gosh, imagine that!)

13
1
Bronze badge

Re: C++

Counterexample? Smalltalk from Alan Kay et. al.

Java, for all its sins in the class library, is still a more elegant programming language than C++.

6
4
Silver badge

Re: C++

"A bad language from a bad language designer."

..if not a bad language designer, i'd certainly go for 'bad language user' - I present as proof the 3rd edition of his tome in which he uses the English language in a manner which is a very long way away from it's normal role of passing information from one person to another. Horrific book - the absolute antithesis of "The C Programming Language" by K&R (some might suggest this may also stretch a little further to the languages themselves - I couldn't possibly comment).

5
2
Silver badge
Trollface

Re: C++

Elegant if you define elegant to mean bureaucratic, because someone at Sun thought you can't drag a variable's value through too many type conversion methods so each one can have its go at rubber stamping it.

4
0
Bronze badge

Re: C++

@Dan 55 - Sounds like you're doing it wrong then. The type erasure in Java's generics may be a crap implementation, but at the syntax level it removes the need to cast. Looking at the last large Java code base I worked on, the static analysis checker indicates that the only place casting is necessary is in some reflection code used at application startup and in the caching layer. Autoboxing may also be less than ideal for efficiency, but it still leads to cleaner syntax - compared to C++ where copying is rife in the idiomatic use of STL even for objects.

2
4
Flame

Re: C++

Comparing Java and C++ is like comparing an Oxcart and an A380. Driving oxcarts is much easier and less dangerous, you know.

4
2

Re: C++

The problem with elegant languages is that they mostly meant to be displayed, not to be used :-)

5
1
Bronze badge

Re: C++

C++ is more like a Nimrod - it may still be able to fly, but so many bits have been tacked on over the years and it's still a crappy old Comet underneath.

3
4
Stop

Re: C++

Even Nimrods can do much more than oxcarts.

3
0
Anonymous Coward

Re: C++

> A bad language from a bad language designer.

Says who, please?

0
2
Anonymous Coward

Re: C++

" if this industry wasn't so keen on naval gazing "

What does shipspotting have to do with this?

3
0
Silver badge
Thumb Down

Re: C++

> It will not include garbage collection

Enjoy you pointer shit and manual deallocation errors.

1
3
Silver badge

Re: C++

RAII and the appropriate smart pointers make it damn near impossible to forget to deallocate - the data is gone the moment the last reference drops out of scope.

RAII predictable, while garbage collection is anathema to predictable timing. If repeatable performance doesn't matter for your project that's fine, but not everybody is doing that kind of stuff.

TBH I find it hard to come up with a valid reason to prefer GC over RAII - why would you want the object to get erased some random period after you don't want it anymore? Why not kill it now?

Aside from all that, you still get memory leaks in garbage-collected languages, it's just a case of holding onto references you don't actually need anymore, or otherwise confusing the GC into thinking you might still want it.

You can shoot yourself in the foot in any language.

3
1

Re: C++

Smalltalk is wonderful. And wonderfully successful.

Java is

a) tedious and verbose to the extreme

b) ugly and less expressive than C++

c) not a systems programming language in the same sense that C++ is.

IMHO. YMMV, etc pp.

0
0

Re: C++

I haven't read the 3rd edition recently, but I've always found Bjarne an exceptionally good writer. Absolutely loved "Design and Evolution of C++" - IMHO one of the best and clearest programming books ever.

Also: How's your written Danish?

0
0
Silver badge

Re: C++

"I present as proof the 3rd edition of his tome in which he uses the English language in a manner which is a very long way away from it's normal role of passing information from one person to another. Horrific book"

Yeah; easily the most badly written computer book I ever bought. The man's a menace to languages of all sorts.

0
0

Re: C++

"One day there will be a worthy successor to C++"

That's how I feel about C :)

0
0
Bronze badge

Woah. I still stick with my opinion that C99 does everything I could ever want to do, with poking by myself or others, and still is quite obviously readable is written correctly.

All that junk in the article (and &&? Really? Why not choose something not already overloaded to confusion?) to do simple things? It might be more efficient and keep the CS guys happy, but honestly it's just a mess.

And when messing with shared memory, I'd much prefer to know exactly what the hell is going on or pass off to a library that knows. Not the middle ground of "here's something you can use, but be careful with it".

"200 lines of angle-bracketed, colon-riddled gibberish."

Pretty much sums up my feelings about C++.

11
5

Page:

This topic is closed for new posts.