2
magis
8y

Calling C++ programmers, or probably any other language, is it bad practice for me to name a string "open_first_file" or should I camelCase it instead?

Comments
  • 1
    This is for a university assignment btw, so no style guide has been given
  • 2
    I would use camelCase, I think it's more readable/intuitive actually
  • 1
    @LMestre14 thanks man!
  • 0
    I go camel case for most languages. Python I use all_lower_with_underscores. Not sure on C++.
  • 3
    It can be project specific. I've been involved in a Perl software used by thousands of libraries and they switched to camelCase.

    Personal pref is camelCase since it's easier to write and read imo.
  • 0
    I prefer camel case but I think the pep8 style guide for python suggests using_this_style any pythonistas back me up?
  • 0
    @Nexion just did that @daarkfall ;)
  • 1
    Interested to see other people opinion.. I started using the most popular convention for CSS everywhere else. Variables likeThis, final variables LIKETHIS, and when a class inherits another one (works better in CSS) you do this: fatherClass_childName. Lastly, if the class is a variation (forgot the right name) from father class don't like: boxClass--blue.
  • 3
    I wouldn't call a variable "open first file" at all, as it's a verb (or an action) and sounds like a function 😉
  • 0
    @mito I would look into BEM (Block Element Modifier. Following that standard has made my stylesheets and markup so much cleaner.
  • 4
    Google's C/C++ coding style guide says to use underscores rather than camel case. But honestly, if your starting the project from scratch it's your call. Just make sure that when you touch other people's code, you respect the styles that they chose.
Add Comment