We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How to limit line limit to 80 charactres. Do keil has any setting for this which gives an indication of max length on top, or it has to be done manually.
I presume you're asking about the uVision editor here?
Although really long source code lines are best avoided, and it's common for style guides to give some limit, I think 80 is a bit unnecessary these days?
80 comes from the days of teletypes when that was the physical width of the "screen"...
Actuaally while printing the code, sometimes due to larger line size, line seems to be odd. Right now I am using manual method by taking refer of commented line on top. But problem is when next page comes on the file I have to do it again.
So what, exactly, do you mean by that?
Could it be related to your use of TABs...?
YOU WANT HIM TO USE TABS. THEY ARE VERY BAD. NEVER USE TABS. NEVER. LOOK ON PAGE 10 OF THE BOOK AND YOU WILL SEE I AM RIGHT.
No - quite the opposite!
Page 10 is intentionally blank.
What on earth would you want to print out source code for?
If you use defines with speaking names for magic numbers, it's nigh impossible to keep every line within the 80 characters margin, without making the code look really bad.
So I compromise by keeping my comments within the 80 character margin and the code wherever that is sensibly possible.
An advantage of staying in that margin is that you can reasonably open the .h and the .c file side by side.
@m tas Your shouting is quite the eye sore. Please convey your opinion in a socially acceptable form.
By the way, in my opinion your statement is quite ridiculous. I have seen what happens to space indented code when many people work on it. And it's fit to give a man nightmares.
I have seen what happens to space indented code when many people work on it. And it's fit to give a man nightmares.
did you misspeak? your comment could have been mine re tab indented code.
Erik
YOU SAID ### By the way, in my opinion your statement is quite ridiculous. ###
BETY YOU WOULD NOT SAY THAT TO ANDREW NIEL. EVEN WHEN HE SAYS HE SAID THE SAME THING AS ME.
WHO IS ANDREW NIEL?
It seems we have opposite bad experiences.
I have seen 4 spaces turn into 3 and back to 4 and up to 5 with just an empty line in between. I've seen odd pieces of code with only 2 spaces ...
It went so far that I wrote a script that reformats the entire code to something sensible.
I will stick to whatever the convention is within a project, but if the decision is up to me, I prefer 8 character wide real tabs. You clearly see if you mess up and that you're nesting too many loops and conditions and would be better off reconsidering what you're doing.
but if the decision is up to me, I prefer 8 character wide real tabs. You clearly see if you mess up and that you're nesting too many loops and conditions and would be better off reconsidering what you're doing. tabbing 8 in C ??? you will get lines a mile long. Even with my 'rule' (rare exceptions allowed) of max 4 indentions you would start at pos 32 and a reasonable complex expression with descriptive names woukd run off the screen. The last 4 places I have worked has been tab 2 and tab 3.
anyhow, your statement is invalid since any sensible person would use the tab key and set the editor to "convert tabs to spaces" and thus, the "position precision" would be there.
Here is where your argument fails: any sensible person
OK, I'll correct: The 100+ people I have worked with have all used the tab key and set the editor to "convert tabs to spaces".
If, In your opinion. these were not "sensible persons" that will be your (faulty) judegment.