datasheets.com EBN.com EDN.com EETimes.com Embedded.com PlanetAnalog.com TechOnline.com  
Events
UBM Tech
UBM Tech

A Simple Style for C Programming

Authored on: May 31, 2010 by Meetul Kinariwala

Technical Paper

1 28
More InfoLess Info
C is a beautiful programming language, one that is close to the system and at the same modular, no wonder it lies at the heart of most embedded systems. Like most other languages it provides freedom in style of coding. This does not help when programs and number of programmers grow large. Therefore for ease of reading, understanding and sharing C programs among several team members, Mansi Research uses this simple style of C programming, which, in our opinion, is a good balance between simplicity and purpose.
28 comments
write a comment

No Avatar

wsch1 Posted Jul 3, 2013

I would use the MISRA standard instead, adopted to omit rules your organization does not think are valuable. -Its been subject to peer review and commentary for a long period of time, and has probably been subject to more criticism than the opinions of the elders (or whoever is writing the coding guide) in your department. -There are tools to detect MISRA violations; without measuring and enforcing compliance economically, nothing will be gained.

reply

No Avatar

barheine Posted Jul 12, 2013

I have the same opinion. But many developers seem still to believe that the MISRA rules are only interesting for the automotive industry, That's not the case. Since many years, I use MISRA-C and C++ for many applications like control units of machines in the mechanical industry in order to improve the software quality and its reliability.

reply

No Avatar

john17nider Posted Apr 7, 2014

Research uses this simple style of C programming, which, in our opinion, is a good balance between simplicity and purpose. best anti aging serum

reply

No Avatar

piyush_ Posted Jul 11, 2013

This paper is at a very basic level on the topic it is covering, it is surprising why it has made it to this site. The author is advised to read some books like Code Complete 2. There is a dangerous suggestion in this paper "Type conversion warnings must be suppressed in full knowledge of them, using casts." Warnings should not be suppressed by resorting to casting, it is an escape route. Every need for casting should be questioned fundamentally to see why there is a need in the first place, because casting indiscriminately can mask design and coding errors.

reply

No Avatar

mkinarivala Posted Aug 27, 2013

Thank you all for your valuable comments. As a embedded systems design firm, most of our engineers juggle around a dozen odd coding styles, each of which is generally a proprietary requirement by a different customer. However, when not mandated by a customer, the idea was to use a style which was just simple and concise and which simply addressed our key readability concerns over the years. There is no denying that casting must be used carefully and only as a last resort. We've had a number of occasions however where casting has been indispensable, especially in several battery powered embedded systems where complex floating point computations are coded in integer arithmetic (for a lean CPU awake duty-cycle). Casting becomes very useful when a few short lines of floating point calculations are inserted in between integer arithmetic, especially after all other tricks such as look-up tables have been exhausted. The paper recommends a full knowledge while using casts (successfully) and suppression of related warnings. To conclude, we would certainly look at addressing our needs using a MISRA subset.

reply

No Avatar

jon_yein Posted Sep 10, 2013

Though I rarely comment on this kind of stuff, this article in particular caught my attention. The paper seems to focus on important visual rules. It looks as if it has been authored with certain goals in mind. Nevertheless, I won't be surprised if the paper comes under critique by style zealots who care to spend a lifetime around styles and rules promoting their own to be better and complete. IMHO and from my 27 years of industry experience, the styles proposed in the paper have taste and readability.

reply

No Avatar

owais khan Posted Apr 23, 2014

I had not encountered such a step like this. Your good knowledge and kindness in playing Luxury African Safari Vacations

reply

No Avatar

owais khan Posted Apr 13, 2014

If a programmers or a web growth company offers with the PHP terminology for creating sites and web programs in PHP terminology, so it offers with PHP web growth resources. used car las vegas

reply

No Avatar

owais khan Posted Apr 13, 2014

Im thankful for the post.Really looking forward to read more. Fantastic. Link Building Wiki

reply

No Avatar

owais khan Posted Apr 13, 2014

I was curious if you ever considered changing the layout of your site? Its very well written; I love what youve got to say. Thanks. DJ Sheboygan WI

reply

No Avatar

owais khan Posted Apr 13, 2014

You have raised an important issue..Thanks for sharing..I would like to read more current affairs from this blog..keep posting.. Skinny Fiber Ingredients

reply

No Avatar

owais khan Posted Apr 13, 2014

mostly found in the club scenes, as the immediate effect drug abuse leads to boundless vitality and a sense of invincibility which is attractive, until the addiction or craving begins, after the first use. Gold IRA News

reply

No Avatar

owais khan Posted Apr 23, 2014

I’m glad toasd find so many useful and informative data on your website. African Plains Game Hunting Packages

reply

No Avatar

owais khan Posted Apr 13, 2014

The blonde reaches into her purse, hands the lawyer $5, and goes back to sleep. buy gold and silver

reply

No Avatar

owais khan Posted Apr 13, 2014

More popular outside the US, foreign binary options are offered by individual brokers, rather than through an exchange. adonis golden ratio

reply

No Avatar

owais khan Posted Apr 13, 2014

More popular outside the US, foreign binary options are offered by individual brokers, rather than through an exchange. adonis golden ratio

reply

No Avatar

owais khan Posted Apr 13, 2014

Then back to Ohrid where we had dinner at the National Restaurant Belvedere where we were entertained by dancers in national costume and regional music. A great time was had by all. iphone 6 rumors

reply

No Avatar

owais khan Posted Apr 13, 2014

These factors can be infinite, but in my opinion there are 6 main factors or observations law enforcement will consider in determining whether to place an individual under arrest for DUI. http://www.getrealigfollowers.com/buy-instagram-likes

reply

No Avatar

owais khan Posted Apr 13, 2014

NARROSTRAP� holds cargo firmly during transit and is ideal for securing heavy or uneven loads. For maximum efficiency and durability. South Africa Hunting Packages

reply

No Avatar

Cool_hand Posted Apr 15, 2014

I always enjoy reading intelligent articles by an individual who is obviously knowledgeable on their chosen subject. I'll be following this post with much interest. Keep up the great work, till next time voyance carte

reply

No Avatar

owais khan Posted Apr 16, 2014

It's a great pleasure reading your post.It's full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work!look at this now

reply

No Avatar

owais khan Posted Apr 17, 2014

Brilliant masterpiece being written here, made me pretty delighted while reading throughout those and made me enlighted with logice completely.. spot gold

reply

No Avatar

owais khan Posted Apr 17, 2014

I am completely agreed with the fact that portable batteries play a vital role in battlefield applications. from this source

reply

No Avatar

owais khan Posted Apr 17, 2014

I love the humor your post has offered. I enjoyed this site a lot. Keep posting article like this. It is fun. Nice photography too! http://www.semiz.com.tr/

reply

No Avatar

Cool_hand Posted Apr 18, 2014

I really appreciate your hardwork for making this article so much informative and help ful. Now I am able to complete my college project very quickly. Thanks alot. red kiwi elektronik sigara

reply

No Avatar

Cool_hand Posted Apr 18, 2014

In here, I found the route that I needed... but the stops weren't clearly labeled and there was no information about transit times. red kiwi elektronik sigara

reply

No Avatar

owais khan Posted Apr 23, 2014

I’m glad toasd find so many useful and informative data on your website. African Plains Game Hunting Packages

reply

No Avatar

owais khan Posted Apr 23, 2014

Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site. Luxury African Safari Vacations

reply

Please Login

You will be redirected to the login page

×

Please Login

You will be redirected to the login page

×

Please Login

You will be redirected to the login page