tsoding / musializer

Music Visualizer
MIT License
921 stars 97 forks source link

[nob] Minimize uses of defines for some multiline defines/functions #24

Closed mundusnine closed 1 year ago

mundusnine commented 1 year ago

General whinning

One of my biggest qualms(issue) with the original nobuild was the use of defines for code that is essentially a function.

Why ? Well in C, debuggability is a major plus in the language, and functions that are implemented as defines remove this feature from the language. Some defines make sense but not for all multiline code imo.

Maybe you have a logical reason for using a lot of defines(generally), sadly my ugabooga software developer brain doesn't know it or can't deduce it.

The offending funcs

The main functions that should be functions imho are

nob_da_append
nob_da_append_many

Reasoning

These functions are used in a bunch a defines so if at it least these functions would not be defines users could debug and find out how they shot themselves in the foot.

Thanks for your work on this btw. Really cool project !

rexim commented 1 year ago

Feel free to submit a pr that changes them into functions

brvtalcake commented 1 year ago

@mundusnine I opened a pull request, if you want to take a look

rexim commented 1 year ago

Resolved as per https://github.com/tsoding/musializer/pull/37#issuecomment-1758818735

mundusnine commented 10 months ago

For anyone wondering, the actual PR that was done was too complex. A simpler solution is talked about here