News for hackers. Stuff that matters.
Re:A Modern C Development Environment by bryancoxwell on Thursday August 10, 2023 @06:44PM (#37082661)
It dissuades people who aren’t comfortable with Makefiles and Vim from using C, so I’d agree it’s gatekeep-y.
Re:A Modern C Development Environment by kragen on Thursday August 10, 2023 @07:49PM (#37083233)
i think that's the opposite of the intent

he's saying that you don't need to be comfortable with ides and fancy debuggers and cmake and language servers and game development engines and ci pipelines and all kinds of complicated stuff to write c successfully

a bare-bones text editor and the most minimal build system are plenty

and if they aren't plenty, he's not saying that's a problem with you, but with c

i don't agree (ctags, valgrind, git, and gdb go a long way towards making c usable, and evidently c is the best language for a lot of things even ctags and gdb struggle with, like linux kernel drivers, and cmake evidently helps a lot if you care about ms-windows) but that's what he said, and you totally misunderstood him because you somehow got the idea that vim and make are some kind of super advanced tool

they're maybe a bit unprepossessing at first glance but mostly what they are is simple and primitive

think of using a hammer rather than a cam-driven turret lathe

you can go lower tech than make too now that cpus and c compilers are so fast

    while sleep 1; do  # ci pipeline
      gcc -Wall -funny -mtune=i69 *.c -lm -liberty -letmypeoplego -o proggie &&  # build system
      ./proggie --run-tests  # test runner
    done
c compiles fast enough that this scales to several thousand lines of code, c++ very much does not

of course you need a testing framework

    if (!strcmp(argv[1], "--run-tests")) return run_tests();
... three seconds latair ...

    int run_tests()
    {
        return test_ui() ||
               test_network() ||
               test_parsing();
    }
now i'm not saying you shouldn't write a test runner in unity and distribute your ci pipeline with zmq and mqtt and whatever the fuck. better ux is worth my weight in gold, and i have programmer gut

what i am saying is that the difference between no test runner and an infinite loop in bash is much bigger than the difference between the bash loop and circleci or gitlab pipelines. so don't be intimidated by articles like this which make it sound like you need a team of phds to set up a test runner

except for version control. a build script in shell is a serviceable alternative to make, but cp -a proggie/src snapshot.$(date +%Y-%m-%d) is not a serviceable alternative to git

Re:A Modern C Development Environment by ryan-c on Thursday August 10, 2023 @09:25PM (#37083998)
I'm not a he (some other folks used "they" which is fine), but this is otherwise a pretty good interpretation - it absolutely was a dig at C, not elitism.

If you're going to learn a bunch of modern tooling and start a green field project that justifies that complexity, C is generally a poor choice. Learn a modern language.

I use C somewhat regularly, including for kernel stuff, embedded, and legacy code.

Mostly, though, when I use C, it's because I'm doing a small thing that I need to be very fast, and I haven't yet bothered to get comfortable with Rust.

Re:A Modern C Development Environment by kragen on Thursday August 10, 2023 @09:36PM (#37084053)
oops, i'm sorry i misgendered you. i think i have fixed it now
Re:A Modern C Development Environment by ryan-c on Thursday August 10, 2023 @09:59PM (#37084221)
I'm sorry, I'm having trouble hearing over the sound of that poor load bearing "generally" creaking under the stress of the thread. ;-)

Yeah, the "C is the universal ABI" problem is... annoying. Hopefully something safer eventually replaces it in that niche.

Also, I think the main reason I use a lot of the tools I do is just "suck cost fallacy".

Re:A Modern C Development Environment by kragen on Friday August 11, 2023 @02:20PM (#37092010)
heh

what the fuck is it with these people that they flagged your comment upthread

Re:A Modern C Development Environment by seabird on Thursday August 10, 2023 @10:35PM (#37084425)
If vim and make are spooking somebody, they need to turn tail and run the fuck away from C. I love it to death, but it's a frustrating experience from another era. vim and make are the least of your worries when dealing with it.
Re:A Modern C Development Environment by flohofwoe on Friday August 11, 2023 @02:46AM (#37085831)
> but it's a frustrating experience from another era

Are you using C99 features? I find the "new" features extremely enjoyable, it feels like a different language compared to C89 or the common C/C++ subset.

Re:A Modern C Development Environment by seabird on Friday August 11, 2023 @08:32AM (#37087960)
I am, but C99 doesn't fix the various sharp corners and gotchas that are littered throughout language.

I don't say any of this as a dig at C, but at ~50 years old, it definitely shows its age.

Re:A Modern C Development Environment by vidarh on Friday August 11, 2023 @05:27AM (#37086733)
I've used C since the 1980's, and vim most certainly "spooks" me. C and make does not
Re:A Modern C Development Environment by pjmlp on Friday August 11, 2023 @10:20AM (#37088977)
Started coding in 1986, used my first UNIX (Xenix) in 1993, the only thing I care about vi, is knowing enough to rescue me when there isn't anything else installed to edit files.
Re:A Modern C Development Environment by stjohnswarts on Friday August 11, 2023 @01:48PM (#37091594)
Yep, plenty of really good windows/macos programmers have never touched vi or emacs. I'm not sure why users of those are so elitist. I tend to prefer vim editor keystrokes in my editors but that's just because I got used to it from college and terminal editing.