Earlier quoted context omitted.
it uses absolute difference epsilon equality ('close enough to be considered equal'): static int pretty_float_equal (float a, float b) { return fabsf(a - b)
This is wrong code. It only works somewhat correctly when a and b around 1.
Pretty.c
121–130 of 227 posts
Re: Pretty.c
#122Re: Pretty.c
#123Re: Pretty.c
#124Meta: the naming is ... strange. The actual name of the repo is "pretty.c", but the name used for the language/dialect/result/horrorshow[*] is "Pretty C". The actual code file you include is called "pretty.h", which makes sense since it's a header, of course. Confusing! Edit: escapes. [*] Yes, I'm a C programmer, currently hunting for black-marked insulin to combat the rapid-onset diabetic attack from all that sugar.…
Re: Pretty.c
#125Re: Pretty.c
#126Earlier quoted context omitted.
There’s so many assumptions here about a person who’s starting to learn programming. For starters, that they’re on Linux, they feel comfortable running complex CLI commands, they can memorize the U.S. layout just like that, and that they can type without looking at the physical keys (because changing the virtual mapping means keys produce something else than what the label says). In reality, the learner’s first expos…
On the long term, using the native keyboard hinders yourself a lot. I tried to do so with the Spanish (es) layout, it's pretty much unergonomical. It's looks like being deliberately designed for press/office usage and not for proper programming.
Re: Pretty.c
#127Reminds me of a C++ codebase I once had to inspect that was entirely written as if it were written in Java. With camelcase naming for everything, getters and setters for every class variable, interfaces everywhere.
Re: Pretty.c
#128It claims to be a scripting language but you still have to compile the programs. Boo! Add CINT ( https://root.cern.ch/root/html534/guides/users-guide/CINT.ht... ) and you can have instantaneous execution and even a REPL!
Re: Pretty.c
#129> Provide so much syntactic sugar as to cause any C developer a diabetes-induced heart attack.
:-D
Re: Pretty.c
#130Reminds me of a C++ codebase I once had to inspect that was entirely written as if it were written in Java. With camelcase naming for everything, getters and setters for every class variable, interfaces everywhere.
I think that's just OOP