Coder Social home page Coder Social logo

File naming conventions about grid HOT 4 CLOSED

paboyle avatar paboyle commented on July 18, 2024
File naming conventions

from grid.

Comments (4)

coppolachan avatar coppolachan commented on July 18, 2024

In case you are renaming, do you agree in .h -> .hpp ?
Just because emacs like it for c++ styling... no stronger motivation, besides maybe separating eventual C files that could come in the future.

from grid.

paboyle avatar paboyle commented on July 18, 2024

I'm not so keen on .hpp -- it's more characters and less common; what are the features emacs enables that it does not for .h?

https://isocpp.org/wiki/faq/coding-standards#src-file-ext

"
If you already have a convention, use it. If not, and if you don’t need your editor to distinguish between C and C++ files, simply use .h. Otherwise use whatever the editor wants, such as .H, .hh, or .hpp.

We’ve tended to use either .h or .hpp for our C++ header files.
"

So, it doesn't seem to me that .h is in any way bad practice by any means, and it is certainly what I'm used to, and I'd need to understand an advantage in changing.

The web site has some really good links and some hilarious quotable paragraphs!

"
A word of warning: Nearly every software engineer has, at some point, been exploited by someone who used coding standards as a “power play.” Dogmatism over minutiae is the purview of the intellectually weak. Don’t be like them. These are those who can’t contribute in any meaningful way, who can’t actually improve the value of the software product, so instead of exposing their incompetence through silence, they blather with zeal about nits. They can’t add value in the substance of the software, so they argue over form. Just because “they” do that doesn’t mean coding standards are bad, however.

Another emotional reaction against coding standards is caused by coding standards set by individuals with obsolete skills. For example, someone might set today’s standards based on what programming was like N decades ago when the standards setter was writing code. Such impositions generate an attitude of mistrust for coding standards. As above, if you have been forced to endure an unfortunate experience like this, don’t let it sour you to the whole point and value of coding standards. It doesn’t take a very large organization to find there is value in having consistency, since different programmers can edit the same code without constantly reorganizing each others’ code in a tug-of-war over the “best” coding standard."

from grid.

coppolachan avatar coppolachan commented on July 18, 2024

i agree. The only thing that made me decide to move to .hpp for IroIro was the fact that the c++ syntax is automatically highlighted for .hpp while for .h I have to change manually (lazy to hack emacs for that, although I think it is simple). No more reason than that. I don't mind so much.

from grid.

paboyle avatar paboyle commented on July 18, 2024

Global edit complete...

from grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.