Skip to content

Coding style: Drop un-indented code in favor of // TODO: comments #2591

@hoffie

Description

@hoffie

What is the current behaviour and why should it be changed?

The current code selectively disables clang-format and deliberately un-indents code which is only kept for compatibility reasons.
The idea is obviously that this should make the code stand out.

This has downsides:

Describe possible approaches
It would be good to find an alternative approach here which keeps the regular indentation.
One possible idea from https://github.com/jamulussoftware/jamulus/pull/2587/files#r845895199 is using #defines.

global.h:

#define COMPAT_JAMULUS_BEFORE_3_6_1

somecode.cpp:

#ifdef COMPAT_JAMULUS_BEFORE_3_6_1
if (someConditionToCheckOnlyForOldJamulusVersions)
{
#endif

  someRegularCodeForAllVersions();

#ifdef COMPAT_JAMULUS_BEFORE_3_6_1
}
#endif

Another approach is a style using regular TODO comments (see below discussion for examples).

Has this feature been discussed and generally agreed?

No, needs agreement.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions