IT SOLUTIONS
Your TECHNOLOGY partner! 
-Collapse +Expand
C++
Search C++ Group:

Advanced
-Collapse +Expand C++ Group Home
-Collapse +Expand Message Board
-Collapse +Expand C++ KB
-Collapse +Expand C++ To/From
To/FromCODEGuides
-Collapse +Expand C++ Study Test
PRESTWOODCERTIFIED
-Collapse +Expand C++ Store
PRESTWOODSTORE
-Collapse +Expand Members Only

Prestwood eMagazine

May Edition
Subscribe now! It's Free!
Enter your email:

   ► KB ►► ProgrammingC++   All Groups   Print This   

C++ Latest KB Comments

Ordered newest to oldest.

To view comments to your KB Articles, go to your My Knowledge Base page. To view user contributions to your blogs, go to your My Blog page.


Mike Prestwood
Read +Add Comment
Good catch. Thanks. I'm in the process of reviewing the other posts now. I just got lazy. Although to be honest I'm not a stickler for indentation style. My company, Prestwood Software, is a general development company and we see so many different styles (and use of a non-standard style) that indentation is more of a luxury than a necessity. I just tell my developers to fit in as best they can which is easier, of course, when K&R, Berkeley, or any of the others are in use. For new projects we have more influence but even then many of our clients have coding standards for us to follow. Going forward I will strive for consistency online. In general I try to stick with the default coding style of the development tool I'm using and/or what I've seen most. Based on my experience, that means Berkley/Allman indent style for C++, Java, JavaScript, and PHP and a K&R indent style for C# (and Object Pascal but for Object Pascal it's rare to see the Berkeley inde...
Posted 51 months ago
Regarding...
C++ If Statement (if..else if..else)

C++ If Statement

Same as standard C.

Phil Harbison
Read +Add Comment
What happened to the indentation in your example?Coding style is almost a religious issue with most developers. A common point of contention is the location of the braces. The most popular styles are K&R style and Berkley style. K&R style is named after Kernighan and Ritchie, authors of "The C Programming Language", and is sometimes called kernel style. K&R style locates the opening brace at the end of the if/else/for/while line. Berkley style moves the opening brace to the next line and aligned with the if/else/for/while keyword. I am tolerant of either style; however, there is one significant advantage to K&R style. Suppose you have the following example in Berkley style.    if ( expression )    {        statement1;    }Now suppose another developer adds a statement to the if statement but fails to notice the braces so the result looks like this.    if ( expression ) &n...
Posted 51 months ago
Regarding...
C++ If Statement (if..else if..else)

C++ If Statement

Same as standard C.

Phil Harbison
Read +Add Comment
I usually inline all simple accessor (get/set) methods in C++. If you are concerned about performance, this is a much better approach than making members (instance variables) public. By inlining an accessor, you get the performance of direct access to public members but retain the benefits of encapsulation. Should your simple accessor method grow in complexity, you can easily change your strategy in one place rather than having to find and modify every reference to a public member.
Posted 51 months ago
Regarding...
C++ Inlining (inline)
{Too Long}

Mike Prestwood
Read +Add Comment
Great thread going on in our message boards about this topic...
  • CodeGear has a new home! 
  • Posted 5 years ago
    Regarding...
    C++Builder Acquired by Embarcadero Technologies
    CodeGear, Borland's development tools division is being acquired by Embarcadero Technologies.
    -
      Load Time=less than 1 second.
     
    Print This
    -
     
    Have a question? Need our services? Contact us now.
    --Mike Prestwood

    Call: 916-726-5675

    email: info@prestwood.com


    881 People Online Now!!  
    Online Now: Sign In to see who's online now!  Not a member? Join now. It's free!
    Show More...


    ©1995-2013 PrestwoodBoards  [Security & Privacy]
    Professional IT Services: Coding | Websites | Computer Tech