A collection of articles and tutorials designed to help C and C variant programmers 
in their programming work. C Programming Tutorials and advice CProgrammingTrends News Archives About Us Feedback
Contact | About
July 01, 2010
C Style Coding
By Bryan Young
My very first computer science teacher in college taught me C++. Starting with "Hello World" and going through structs, classes, and pointers, she showed me how to make computers dance with a few simple commands. Imagine my surprise when I turned in a program, only to find I had lost points for using the conditional operator.

When I asked her about it, she told me that I shouldn't use C style code, and it was a bad habit. I got the same speech for using a switch in another assignment, and again for using continue to cycle a loop.

Now, out of college and with more free time to ponder such things, I have come to a conclusion for the reason she disliked this so called C style of coding. When using a switch or continue, or in a lesser case, the conditional statement, you are basically issuing a goto command, which can easily go awry. The goto command is fairly controversial in that it can be misused easily, and can almost always be avoided by other means.

Continue Reading
Interested in contributing to the Cprogramming community?
Can you write expert tutorials and articles addressing the issues affecting Programming in C Environments? If so, we are looking for you. Contact techwriters@ientry.com.



Today's Top Videos:
Social Media Benefits for Search
As the interest in social media continues to grow, it's fascinating to see how it intersects with search. WebProNews recently spoke...
How Testing Results in Smart Decisions
Most people understand that testing is important, but as Conrad Saam of Avvo tells WebProNews, properly testing is...
Online Attribution: Give Credit Where Credit Is Due
According to Richard Zwicky of Eightfold Logic, formerly Enquisite, marketers are not effectively monitorin...
Recent Articles:
MySQL In C
Many languages include the ability to connect to a database and utilize the information stored within. For those that don't have these abilities automatically, there are different varieties of MySQL connectors available for installation. The version for C is the connector/C. Once the connector/C is installed (instructions on how to do this can be found here), you can add a connection to a mysql database to any C program with ease.

Below I will outline a simple program to connect to the "databasename" database. This database has one table "user" with three columns, "id", "name" and "department".
Read More...

GCC Allowing C++ Code
For years, we have been using the gcc compiler to build our source code into executable programs, so you're probably asking yourselves what the big deal is. The big deal is that for the first time ever, C++ code will be used to /write/ the gcc compiler, which has always been written...
Read More...
Dissecting Duff's Device
One of the most confusing pieces of code I have ever had a chance to look at is Duff's Device. At first glance, it seems that your compiler would laugh at you for attempting such a feat. For those of you who haven't yet been introduced to this programming marvel...
Read More...
To Switch, Or Not To Switch
When it comes to making selections in C programming, the obvious first choice of most programmers is the if,else combination. This can become a hassle when there are multiple choices with different or similar outcomes. A simple example of...
Read More...
Other iEntry Business Resources:
- WebProNews.com
- Jayde.com
- MarketingNewz.com
- SalesNewz.com
- CareerNewz.com
- InvestNewz.com
- eCommNewz.com
- WebsiteNotes.com
- AdvertisingDay.com
iEntry
 
-- CProgrammingTrends is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2010 iEntry, Inc. All Rights Reserved Privacy Policy Legal