HackerN64 / HackerN64/HackerSM64

Experiment with Designated Initializers in the repo for readability

Open
#471 0 comments 0 reactions 1 assignee Claimed by @someone2639 View on GitHub
documentation help wanted low priority
Dominant language
C
Stars
529
Forks
209
Avg merge
1d 12h
Merged PRs (30d)
1

Description

referencing [this document](https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html#Designated-Inits)

On some tables/structs in the repo, having an explicit note of what the data corresponds to will be very beneficial to readability in my opinion.

Benefits:
- Allows out-of-order struct and array initialization
- No need to cross-reference struct/array definitions

Downsides:
- If this were to affect the entire repo, in some small cases it's more work than it's worth (the Linux kernel has a ton of examples where for the sake of `readability` they create an enum for a 3-element array that is never used anywhere else)
- New users might be confused on the syntax at first (even I was when I first saw it on an array in Linux)

Therefore I only envision this being useful in certain cases where readability takes a hit (looking at #467)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.