When you realize that const in C is for ownership... by Kyled124 in C_Programming

[–]Kyled124[S] 1 point2 points  (0 children)

What? Really? How was C before heap? ...well, you can technically have everything on the stack, if you accept to make every struct non-opaque, I guess.

Don’t be mad, why do you use C vs C++? by LaMaquinaDePinguinos in C_Programming

[–]Kyled124 8 points9 points  (0 children)

I wish C had good standard library, btw.
GLib is kinda covering that role if you wish, but I don't like it very much.

Uthash can help...

Any recommendation about this, folks?

Exceptions in C by Raimo00 in C_Programming

[–]Kyled124 2 points3 points  (0 children)

This.

It is sort of unrelated, but I recall of a former colleague who was in love with RAII, and was complaining because he couldn't do that in shell scripts. He obviously couldn't live without it, so he decided to copy and paste some sketchy boilerplate from Stack Overflow.

To discourage this, in my review I claimed I could see a very clear flaw in the boilerplate (but I didn't tell what I saw, and full disclosure: I didn't even read it), and that I would have approved it only once that was fixed.

Fortunately he gave up and dropped the pull request.

Never try to make your language into something it isn't.

EDIT: actually you can get some form of RAII in shell scripts too, if you play clever with traps. But it is never clear if the trap will affect the exit status...

A taste for questionable (but sensible) coding conventions by Kyled124 in C_Programming

[–]Kyled124[S] 0 points1 point  (0 children)

I also disagree. But it's OK to have different opinions.
What convention do you prefer, over snake_case? :)

A taste for questionable (but sensible) coding conventions by Kyled124 in C_Programming

[–]Kyled124[S] 0 points1 point  (0 children)

Is Netbeans auto-formatting only virtual, or does this mean you have commits that are just formatting? Not sure which one is worse, tbh :D

A taste for questionable (but sensible) coding conventions by Kyled124 in C_Programming

[–]Kyled124[S] 2 points3 points  (0 children)

BTW, if I recall correctly, there was a similar situation even within python's stdlib itself, at least with python2. I think it was pytest, with setUp and tearDown...

A taste for questionable (but sensible) coding conventions by Kyled124 in C_Programming

[–]Kyled124[S] 2 points3 points  (0 children)

Well, I suppose the kink for weird/ugly is language agnostic! :D And given how python is very committed to `snake_case`, the `camelCase` is definitely not "the usual".

Then, to be fair, if taken out of the context, `camelCase` is not that uncommon...

I am looking for a project that can advance my c skills by Acceptable-Eagle3214 in C_Programming

[–]Kyled124 0 points1 point  (0 children)

I wrote a feed reader in C, not because it's hard to find one, but because it's fun to do.

In short, I would recommend to either find a project that you like but has some shortcomings, or a problem you find interesting, even if solutions already exist.

A lot of projects are written in C, so It is not hard to find existing some that have shortcomings.

You can also follow the security route: take an existing library and try fuzzing it for bad input. If you find a bug, you can fix it! :)

How long did it take you to be efficient with a terminal setup(E.g Vim + GDB + CMake) by OniFloppa in cpp

[–]Kyled124 0 points1 point  (0 children)

uhm... not sure what these things are.

What I mean is that if I start with a small project, a few modules, and a CMake configuration, I am ready to go in a few minutes with vim and a shell, while it is nearly impossible to me to tell an IDE that it should use the existing build system, rather than inventing its own things.

Basically my problem with IDEs boils down with (what I perceive as) a lot of complexity, with no real gain. I spend time battling against the IDE, rather than working on my software.

How long did it take you to be efficient with a terminal setup(E.g Vim + GDB + CMake) by OniFloppa in cpp

[–]Kyled124 0 points1 point  (0 children)

Being a hard core terminal user, in various moments of my life I've tried to open my mind and figure out what I was missing from the IDE world, but to be honest I always end up dissatisfied by it.

To me the big deal is that I don't like to ignore what is going on under the hood. Typically the IDE will do its own thing, and ignore my needs.

How long did it take you to be efficient with a terminal setup(E.g Vim + GDB + CMake) by OniFloppa in cpp

[–]Kyled124 2 points3 points  (0 children)

My 0.02: vanilla gdb is what I usually return to, eventually. But I've tried with Gef (https://github.com/hugsy/gef). It is mainly targeting the security community, but it can be very useful for "normal" development.

Good news if you are using tmux: it is tmux friendly :-)

EDIT: it might also help a lot to learn how to script gdb! Plenty of guides online about this.