Results 1 to 4 of 4

Thread: Lowercase h/cpp file names

  1. #1
    Join Date
    Aug 2013
    Beans
    34

    Lowercase h/cpp file names

    Hi,
    Is there any other reason for storing all h/hpp/cpp file names lowercase besides the fear of windows (and Macs with a case insensitive HFS) users forgetting to respect case sensitivity?

  2. #2
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,588
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Lowercase h/cpp file names

    Both lowercase only and mixed case are perfectly valid and workable choices. The standard library and boost stick to lowercase, whereas Qt uses mixed case. Of course, the standard library and boost also opt for lowercase identifiers. My personal preference is to keep to lowercase, probably largely due to historical baggage and my begrudging use of mixed case identifiers.

    If you use mixed case for filenames, you may end up typing horrors like e.g.
    Code:
    grep foo *[Kk][Ee][Yy]*.[hH]*
    because
    Code:
    grep foo *key*.h*
    won't do.

    I have found this particularly irksome with sources brought from Windows. I have also been bitten by projects written for Windows that then don't build on Linux because, however well-intentioned the original author, mistakes with the case of filenames don't get picked up until after you move the source from Windows. I find "lowercase only" easier to get right.

  3. #3
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Lowercase h/cpp file names

    shopt -s nocaseglob FTW
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  4. #4
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Lowercase h/cpp file names

    and "grep -i"...
    Warning: unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.

Bookmarks

Posting Permissions

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