Comments (4)
The current formatting style is quite consistent with itself. When in doubt, looking at the surrounding code and similar sections should help to clarify things. Although, having a format spec would ease code reviews, so I'll have a look.
What do you specifically find unreasonable regarding the current formatting style?
from belle.
Yes, you're right. The formatting is consistent with itself - sorry for the bad explanation/misleading topic.
My problem was that I HAVE TO look at the surrounding code to adapt a foreign code style instead of just write code and let a (formatting) tool do it's job.
Just as an example: When do you write spaces with curly braces initializions?
=> std::string index_file {"index.html"};
You've to find another place with this kind of initializion... some people write
std::string index_file { "index.html" }; or
std::string index_file{"index.html"}; or
std::string index_file{ "index.html" };
Thats annoying extra work with big chance of doing styling wrong.
I couldn't tell you which form of the above example I would write intuitively as I don't really care - I think thats the job of a formatting tool.
from belle.
I can see how a formatter would make things easier. I haven't had a chance to try out clang-format yet, but I still plan on checking it out.
Interestingly, the example you provided for how spaces are formatted with uniform initialization syntax, has the following surrounding lines:
// the public directory for serving static files
std::string public_dir {};
// default index filename for the public directory
std::string index_file {"index.html"};
// socket timeout
std::chrono::seconds timeout {10};
// serve static files from public directory
bool http_static {true};
// serve dynamic content
bool http_dynamic {true};
// upgrade http to websocket connection
bool websocket {true};
from belle.
It was just an proposal and the example was the first that passed through my mind.
"I couldn't tell you which form of the above example I would write intuitively".
from belle.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from belle.