[Codestyle] Use of spaces around operators

Open
#7 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

The issue names no files, tests, formatter, or project-wide style configuration to inspect. First review the repository's existing C++ formatting conventions and determine whether the proposal has maintainer agreement; done would require an agreed scope and documented or applied operator-spacing changes.

Written by the indexing model from the issue text.

Description

I know codestyle is highly subjective, but I'd like to make a suggestion:

Would you mind adopting a codestyle with spaces around operators?
Without those it looks like a token soup that is hard to parse visually for me.

E.g.:

  • for(std::size_t i=0;i<k/8;++i){
  • x?1+constexpr_bit_width(x>>1):0;
  • x|=Block(1)<<(h&mask);

could be:

  • for(std::size_t i = 0; i < k / 8; ++i){
  • x ? 1 + constexpr_bit_width(x >> 1) : 0;
  • x |= Block(1) << (h&mask);

Or at least for "delimiters"

  • for(std::size_t i=0; i<k/8; ++i){
  • x ? 1+constexpr_bit_width(x>>1) : 0;
  • x |= Block(1)<<(h&mask);

To me this makes it much easier to see which parts belong together and not miss e.g. the "?", "|" or ";"

Dominant language
C++
Stars
37
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.