This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

incrument

hey dudes.
i'm new to this embedded stuff. it looks great. i gotta get a canbus and iic stuff talking. but i have a question.
what is the best way to incrument a variable. i mean what is the fastest most efficiant way to add 1 to couunter. is it ++couunter or couunter++ or couunter+=1 or couunter=couunter+1 or couunter+=ONE. you get my griff.
answers please.

Parents
  • "Fastest" is not always best!

    "Fastest" is not always necessary!

    If you spend your time trying to micro-manage the compiler like this, it'll take you so long to write the code that, by the time you're done, nobody will want it - so it will be irrelevant that it's "The Fastest in the department"!

    You have plenty of work to do to understand CAN and implement it - now is not the time to be worrying about minutiae like this!

    As the well-worn saying goes, "premature optimisation is a root of all kinds of evil"

    Book list: http://www.keil.com/books/

Reply
  • "Fastest" is not always best!

    "Fastest" is not always necessary!

    If you spend your time trying to micro-manage the compiler like this, it'll take you so long to write the code that, by the time you're done, nobody will want it - so it will be irrelevant that it's "The Fastest in the department"!

    You have plenty of work to do to understand CAN and implement it - now is not the time to be worrying about minutiae like this!

    As the well-worn saying goes, "premature optimisation is a root of all kinds of evil"

    Book list: http://www.keil.com/books/

Children
No data