Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are red flags in some of the function signatures that the author doesn't understand C.

For example functions that I guess are meant to be generic arrays that take int*. You could write volumes on how to approach generic arrays in C but this is certainly not one of them.

Also the use of "c standard library" is weird here. Any C programmer reading this phrase assumes a reasonably standard conformant libc. This is a bunch of interfaces the author made up.

Sorry for being negative but this doesn't pass a "production quality c code" at-a-distance sniff test.



The code isn't very well written either.

For example, the various array printing functions (which are at the top of the file, first thing I saw) call putchar/printf in a loop instead of allocating the entire string and printing it with one call. For a HUGE array that doesn't fit in memory this is the right approach, but for the other 99.9% of the time you're printing a smallish value (otherwise you probably wouldn't be printing to stdout in the first place?) this is going to be way slower than allocating the string and printing it once, because it's going to make way more system calls. Also most libc implementations guard stdio access with a mutex, so you're going to have to do a bunch of mutex acquires as well.

Plus why don't these functions take a FILE*? What happens if you want to print to a file or stderr?


printing typically goes to buffered streams, and array printing is not a system call.

If you want to print to stderr, you write to fd 2.


I spotted several red flags in the title alone and I'm not even counting "an usable" that probably resulted from HN censoring "actually". The word "actually" is only a yellow flag.


"an usable" is a common category of mistake from non native English speakers that I see frequently and I don't judge for it.

Often I find myself trying to politely explain the rule. The "n" appears when there is a phonetic vowel next, not necessarily a written one. The first letter of usable is a vowel in spelling but phonetically it starts with a consonant, the international phonetic alphabet for it is /ju/, starting with the consonant [j].

Similar things happen with abbreviations. You get prescribed "an SSRI" and not "a SSRI" because "S" there is pronounced "es", starting with a vowel.

Strangely enough I find when I over explain like this about this specific topic, people thank me. Maybe since I'm way off topic I'll get crap for it here.


Yeah, no thanks from me. If you read the actual page title, and reread my comment, you'll see why.


Oh, sorry. I guess I see this so much online from the English as a second language crowd that this is what I assumed it was.


who could live without concatenate_five_strings()?


For me the red flag is the proportional font on the screenshot


For me its dualing implementations of is_alpha & is_string_alpha (and other similar pairs) that do the same thing but one is a 'for', and the other a 'while' loop


I think is just a personal project, at least initially.


Yes, but it's phrased that "finally" there is a library that solves the author's problems, as if we've all been waiting for it in 50 years of C being a thing. When it's kind of a learning project for them. I don't fault them for putting their learning on GitHub. But it's phrased in a bit of a grandiose manner.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: