Live data from Hacker News

Pretty.c

github.com

121–130 of 227 posts

Re: Pretty.c

#121
post #15

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.

[deleted]

Re: Pretty.c

#122
post #15

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.

[deleted]

Re: Pretty.c

#124
post #31

Meta: 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.…

[deleted]

Re: Pretty.c

#125
For what it’s worth this makes the same mistake that Python 2 did: string and bytes are not the same type and shouldn’t be treated as such.

Re: Pretty.c

#126
post #118
post #108

Earlier 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.

or maybe popular proglangs were designed for writing on USAn press/office keyboards – remember that UNIX came to be as a typesetting appliance — disregarding anyone else.

Re: Pretty.c

#127

Reminds 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

Re: Pretty.c

#129
> The goals for Pretty C are:

> Provide so much syntactic sugar as to cause any C developer a diabetes-induced heart attack.

:-D

Re: Pretty.c

#130

Reminds 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

You might like https://aartaka.me/oop-c
Post reply on HN