c++0x ?

Hi, is it possible to activate this new standart in Arduino gcc? I believe that "auto a = 255" is much better than "int a = 255".

Define "better", please.

AWOL:
Define “better”, please.

Because typical Arduino sketch is much less than typical c++ project at all (I mean banking systems, rich user applications etc) and mostly supported by one human, not a team, many of the compiler limitations are useless and just waste time. If I’m the only developer, I will never need the strict type declarations, and… oh, just that simple thing will rapidly speed up the development.

father_gorry: oh, just that simple thing will rapidly speed up the development.

In the microcontroller world, everything comes at the expense of something... In this case, maybe code size or even execution speed.

just that simple thing will rapidly speed up the development.

No it won't. It makes you think what sort of variable you want to use and not leave it up to the compiler to choose. In this way you have control. Every byte on a machine limited to 2K of RAM is important. On large systems programmers get very sloppy with their variable allocations (I know as I have had to manage some of them) and just declare everything at the maximum resolution "just in case". It inevitably turns out to be the case, just in case I actually have to think.

Than what's with c++0x ?

father_gorry: If I'm the only developer, I will never need the strict type declarations, and.. oh, just that simple thing will rapidly speed up the development.

You want to type "auto a = 255" rather than "int a = 255"? On the face of it, you want to type 12 characters rather than 11. So your "improvement" actually will take 12/11 times the time to type, which is 1.090909 as slow.

Do you have an objection to typing "int" or "char" or "byte"?

Let's not forget Gammon's Law: The solution can't be simpler than the problem.

Isn't that the inverse of Occam's Razor?

Than what's with c++0x ?

The new and improved which btw the new and improved name is c++11 for 2011..... I don't know how I ever coded without it.

Does AVR Libc support it? http://www.nongnu.org/avr-libc/

It will get here when it gets here and somehow I'm sure a whole lot of the docs won't arrive with the changes.

AWOL: Isn't that the inverse of Occam's Razor?

Not certain about that.

The gist of my law is that if you try to reduce complexity, you often introduce it somewhere else. For example the original poster's idea of remove type definitions (I gather) is then replaced by the complexity of knowing the current type of a particular object, which often you need to know (eg. for transmitting data along a serial port).

However I am not at all opposed to reducing complexity to the minimum required. So for example, if the problem has 10 "degrees" of complexity, then the ideal solution would have 10 "degrees" of solution and not 11. (And a solution which had less than 10 "degrees" would not be able to solve the problem).

Of course, "degrees" in this context would be a slippery thing to define.

Just as an example, to cook a 3-course meal, presumably you need to do 3 things, and not just 2.

to cook a 3-course meal, presumably you need to do 3 things, and not just 2.

I only do one thing, answer my missus when she asks if I'm ready for dinner.

Rob's razor?


Rob

Rob's razor?

No. I have seen the picture of your beard and I know you haven't got a razor.

Let's not forget Gammon's Law:

I once knew a bloke called Cole who was trying to promulgate his own law, but it just made people think of cabbage and mayonnaise.

I have seen the picture of your beard and I know you haven't got a razor.

Hmm, good point, but "Rob's hair brush" doesn't have quite the same ring to it.

Coleslaw that's good :)


Rob