Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:Problems in C++ (Score 1) 386

The first problem is: there is no diamond problem. Everything works as designed. Using virtual inheritance means you have to walk back in old sources and find the first inheritance to the same class and make the virtual, too.
So: no real solution, as such sources usually are not under your control.
And in cases where you indeed want to inherit several times, without using 'virtual' you still have no option to 'access' the 'parts' you intentionally inherited multiple times.

The solution would be so simple:
class Derived : Base A, Base B {} and now you could write Derived::A and Derived::B to access the 'parts' if you needed to. No idea why the designers of C++ are against this solution.

So in our days the internet is full with advices not to use MI in C++, however there are plenty and elegant uses for it.

E.g. you know you have certain objects which you want to hold ALWAYS in at least two linked lists.

An easy way to do that is to have a LinkededList template that has as template argument an integer or an enum.

Now you let inherit your class twice from that List with two different arguments (constants like 'parent=0' and 'siblings=1'). Now every object has a linked list going up to the parent and one covering its siblings 'build in'.

I did not invent that 'idiom', Jiri Soukoup did.

Anyway, in combinations with templates MI is a killer feature. I'm really pissed that Java/C# has neither templates (and no, generics are something completely different) nor MI, just because some idiots spread the mantra "MI is bad" in the early 1990s ...

Comment Re:command line, finder (Score 1) 592

As I told you now 3 or 4 times: you are wrong.
The bash runs exactly the same regardless on what operation system you are using it.
It it is not working for you, .profile or .bashrc or any other config file is messing it up for you.
Bringing up random links which give you a +1 informative rating does not change: that you are wrong.

I use a bash on every system I work on. And: there is no difference at all between my Mac, or the Suns or IBMs machines! And the heck should there? Sorry, you live in a dream world and have some misconceptions about 'how stuff works'.

Comment Re:Problems in C++ (Score 1) 386

That is wrong.
Every class that uses a virtual method has a vtab (and in nearly every scenario where you use inheritance, you should have a virtual destructor).
Virtual inheritance is a a trick to avoid the so called 'diamond problem' if you happen to inherit via different pathes from the smae base class. However it is not the solution :)

Comment Re:Design failure (Score 1) 130

The Carnot efficiency is only helpful if you actually have a device able to harvest that energy.
Otherwise it is just a meaningless number.

Carnots laws simply say the efficiency in an 'heat engine' depends on the temperature difference between the max and the min temperature.

So if you had a turbine made from material that can sustain the max temperatures you mention and is operating in an environment that has the low/min temperatures we see, then the maximum possible efficiency is the number you have.

As we don't have that turbine we are stuck with RTG ... and the efficiency there is very low.

Why you link an article about hypothetical nano technology is bejond me :) But I will read it ... thanx for the link.

Comment Re: a better question (Score 1) 592

Ah, does not really make sense that it is the guest OS amd not the host OS, but thanx for the hint. I ebay one imediatly.
Yes, OS X starts to suck more and more from release to release.
My Mac book air (running 10.8) is unabke to do backups consistently to the time machine. Every few days it claims the back up sparse bundle was already 'in use'.
Regularily the Mail Rules don't work. I mean I het ten mails, which should be moved into a folder, 8 get moved, 2 not. After issuing 'apply all rules' manually the last 2 get moved, too.
There are so many bugs ... Apple software never was so bug ridden. And beifre they fix them, they have a new OS release with new bugs .... pft.
I guess windows is not that bad anymore, but as soon as I'm forced to use Office or more precisely Outlook I have to go to work with an empty stomach, otherwise I would vomit 6 of my 8 work hours.

Comment Re:Unanswered questions (Score 1) 65

There was an article on /. about that technology, but with a missleading title ofc. so we can not really google for it. (something like: new break through in PV makes nearly 100% efficiency possible)

A guy in a university is building such IR PV devices to harvest the heat energy combustion engines are radiating. The efficiency of them was very high, around 80% if I recall correctly.

Comment Re:Problems in C++ (Score 1) 386

pointer per object pointing to the class metadata like for RTTI. That pointer you have anyway, it is the ptr to the vtab. And RTTI is accessed via that vtab, in the same way can be any other meta data.
Also you forget: libraries used for dynamic linking already include all the meta informat, method names etc. they only lack a proper 'standard' API to interpret that meta data.
And that 'knowledge' in those libraries is kept in memory anway, which makes your '1k meta data per class is already to much argument' mood.

Comment Re:Problems in C++ (Score 1) 386

Java is static compileed, too.
The way how a language is compiled has nothing to do with reflection support.
Also claiming that 1k extra memory for the class meta data is a burden must be a joke.
With thousand classes this is just a mega byte.
And obviously: we talk about C++, if we had reflection and did not want it, we would just switch it off, as we do with RTTI, exceptions and any other thing we do not want.
Everyone who never had used reflection has any idea how powerfull it is.
E.g. by inspecting business objects with reflection you could build up GUIs at runtime without any manual written GUI code.
Simple design patterns or argument parsing for programms or simple forms of the interpreter pattern can easy be done in a few lines of code using reflection.
Everyone who never has used X is always wondering why anyone would want X ... so is your position towards reflection.

Comment Re:Problems in C++ (Score 1) 386

Reflection does not slow down anything, as long as you don't use it. C++ has RTTI, which already is a small subset of reflection.
Or in other words, programmatically querrying an object for its methods and then calling a specific one based on type of arguments or name is ofc slower than a 'normal call'.
But it costs you nothing to have this option in the language per se.

Comment Re:Problems in C++ (Score 2) 386

3. is nonsense. Nothing stops C++ from having all the benefits of reflection e.g Java offers.
4. is wrong
class A;

A* someVar.

That is a forward declaration and has absolutely nothing to do with linkage, it is mainly used to avoid circular dependecies in header files or simply to save compile time (by avoiding to include the header).

You mix up forward declerations with 'extern'al declerations.

Comment Can some one explain the efficiency claims? (Score 2) 65

IMHO it is impossible to even come close to the efficinecy of a wire.
With transformation losses and heat etc. the wire is still certainly above 85% efficiency.
On the other hand, creating light is already below or at 85% efficiency and transforming it back to current with the very best 'solar cells' is at 48%. So bottom line we are minimum below 42%. That is less than half of the efficiency of a wire, without counting any further losses after the solar panel.

Comment Re:command line, finder (Score 1) 592

Mac OS X has no 'default tab completion'. ROFL.
Either you are running a bash, or you are not running a bash.
The OS does not matter. As long as you don't understand this simple principle you should perhaps not even considering using a shell.
I guess on your 'Mac OS', you are complaining about, your terminal is running a tcsh ... and it speaks volumes that you have not figured that yet. Should have made all yours and yous bold, but on an iPad that is a pain ...

Slashdot Top Deals

Computers are useless. They can only give you answers. -- Pablo Picasso

Working...