uint_8 or such like

I have seen in some code snipets, the use of short hand terms , something like

uint_8t in place of unsigned int,

Do we have a list of these some where, and where they are picked up from ?

uint_8t in place of unsigned int,

No, that would normally be in place of an unsigned char.

Ok,

but where is the definition of what we have pre defined, I could define my own set of abbreviations, in a .h file.

but as we have them somewhere, where are the definitions please ?

how about putting them into the reference area !

http://www.nongnu.org/avr-libc/user-manual/group__avr__stdint.html

thank you

easy when you know where

how do we get this info put in the arduino reference so we can all use it ?

Personally, I think the reference pages should be kept for Arduino specific information, which this isn't.

easy when you know where

I didn't know where, so I typed 'uint_8t' into Google. Anyone could do that.

It’s a standard C programming thing that goes WAY beyond just Arduino and AVR:

(It’s scary that Arduino and avr-libc pages show up first in google results!)

so your suggesting:

that we don’t document unless its arduino specific,
what about the style guide ?

And as for use google,
well, thats like saying to my kids when they ask me how to spell a word, look it up in the dictionary.
I knew from my past that arduino would have a set of abbreviations for unsigned long etc,
and I wondered what they were,
why not have it documented in arduino world.

well, thats like saying to my kids when they ask me how to spell a word, look it up in the dictionary.

What's wrong with that? I was often told that. It increased my vocabulary quite significantly, as I never just looked at the word I wanted to spell, but others around it too. I find it often works the same with Google.

I knew from my past that arduino would have a set of abbreviations for unsigned long etc, and I wondered what they were, why not have it documented in arduino world.

It's not 'Arduino' that has a set of abbreviations (although that's not really the right word), it's C. I think it's perfectly reasonable to not have all of C/C++ documented on the Arduino site, when that documentation is so easy to find elsewhere.

dis agree on a fundamental basis.

Arduino is aimed at artists etc, not programmers. or so the aims say on the front page.

hence we should make learning as easy as possible , that I guess is why the guide says dont use pointers.

things like uint_8, they are a short cut , but I have seen many different ways of writting them over the decades,

so having and documenting a standard that we'd like Arduino code to follow, to me is a good thing.

hence we should make learning as easy as possible

Sometimes, that means not telling someone something, or simplifying.

Remember learning the solar system model of the atom at school, and then, a couple of years later being told it really isn't like that at all?

things like uint_8, they are a short cut

No, they're not - shortcuts are short, and "uint8_t" is longer than "byte". ;)

dis agree on a fundamental basis.

Nothing wrong with that. We are both entitled to opinions.

I do think that a link to http://cplusplus.com/, or some other appropriate site, should be prominently displayed on the reference page.

re byte , interesting you have to include arduino.h to get byte, or include a library that itself points to said.

re c++, interesting that you point to C++, Arduino examples are all c based,

OK, YES I know C is a subset of C++. but C++ is a different mind set to C is it not ?

( Hay I was around programming when B was the language, and this C thing was an idea.. )

interesting that you point to C++, Arduino examples are all c based,

I only suggested http://cplusplus.com/because I knew the address. That's why I added 'or some other appropriate site'. Perhaps http://www.cprogramming.com/ would be better.

Well, I generally avoid byte and word since I don't know what size or sign they are. OTOH uint8_t does what it says on the tin - it's an unsigned 8-bit value. Same with uint16_t and uint32_t - I'm not sure any further documentation is needed.

Will

If you know the abbreviations exist, then that is the documentation

but we don't document anywhere on the arduino site that such abbreviations are around, and are in fact IMHO normal coding standard,

do we want to doc here what we have

unit_8t => byte, or is that char equivalent unit_16t => Unsigned int int_8t => byte , or is that char ? int_16t => int

might save some typing for some one , and some more understanding,

might save some typing for some one

It only saves typing if it is shorter than the Arduino equivalent, and spelled correctly. ;)

could it be longer than

unsigned long

?

drjiohnsmith: Arduino examples are all c based,

87 out of 125 of the IDE's examples include the class Serial. Every one of the IDE's built-in libraries is a class. All of the external libraries I have downloaded are a class.

How are they based on c if they use classes -- the most important C++ feature?

source:

~/arduino-unstable/examples$ grep -rl 'Serial\.' * | wc -l
87
~/arduino-unstable/examples$ find -iname *.ino | wc -l
125

ok

lets call this quits shall we,

I think that we should support new coders by including in the start documents that they can use standard abbreviations such as we have been discussing.

thanks for your time, its been an insight into the Arduino world.