CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 31

Threaded View

  1. #16
    Join Date
    Jan 2008
    Location
    California, USA
    Posts
    822

    Re: Is there any difference between using {} and not using them?

    I agree with monarch_dodra on going with what is accepted at the working environment.

    There's one thing that I can't quite decide which way to go, i.e.
    Code:
    // case 1
    template <typename Type>
    const T foo(const Type& arg1, const Type& arg2 /* and smoe more */)
    
    // case 2
    template <typename Type>
    const T foo(const Type& arg1,
                const Type& arg2
                /* and some more */)
    // case 3
    template <typename Type>
    const T foo(
                const Type& arg1,
                const type& arg2
                /* and some more */
                )
    The naming convention and the brackets, I can pretty much deal with because, well, it has been discussed to death, but the placement of the ending parenthesis has been not (well at least for me) Although I'm a big fan of having lots of small functions rather than a big one and design from the user's point of view, sometimes functions with many number of parameters are just ..there.

    This gets even worse when working with the templates because I agree with the notion that a good naming convention (and no, I don't favor the hungarain notation) can avoid writing a seperate document for it.

    I still can't make up my mind on this.

    EDIT:
    I forgot to mention the case where nesting functions...
    Last edited by potatoCode; September 24th, 2010 at 09:03 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured