4 ms·
It is more irresponsible to make a comment like this. People should write software in a language that A) can do the job B) they're proficient in. For example, I
by ph33t 7y ago
It is more irresponsible to make a comment like this. People should write software in a language that A) can do the job B) they're proficient in. For example, I would much rather have a C program written by someone proficient in C than a C# program written by someone new to the language.
- sagichmal 7y agoThe point I’m making is that nobody is actually proficient in C; it’s not possible to write safe software in it.
- Too 7y agoYep, not to bash the author but just to show how easy it is to write unsafe C. First function i started reading i already found a memory leak within a minute: indexer calls dsplit which calls dcreatea which calls malloc, this value is never freed inside indexer or anywhere on the way down. It might be that the buffer gets shared with index so by coincidence it's eventually freed but the fact that i have to think so hard and juggle all those buffers in my head for such a simple function just makes my head hurt. dsplit(), an even simpler function also calls dcreate() which allocates memory into the variable called 'new' that never gets freed. This is schoolbook example of a memory leak, showing the guy didn't choose C because he's already proficient in it. Or even worse, if he is proficient and the language still allows such serious mistakes to slip through so easily. Edit: the code is actually completely full of memory leaks the more i read, stuff like else if(dequals(commands.values[0], dcreate(SEARCH))) where dcreate returns a buffer from malloc which would have to be freed.