News for hackers. Stuff that matters.
Re:A Modern C Development Environment by Aurornis on Thursday August 10, 2023 @06:19PM (#37082485)
> If they are not fine, then C is probably not the right language for the project.

This is called gatekeeping and it’s not helpful.

It’s fine to write C in vim/emacs/nano if you want.

It’s fine to write C in Visual Studio Code if you want.

It’s fine to write C in CLion if you want.

There is nothing wrong with any approach and no need to gatekeeper an entire programming language based on editor preference.

Re:A Modern C Development Environment by the-printer on Thursday August 10, 2023 @06:26PM (#37082536)
Is it really gatekeeping? Does this opinion (that was valid and useful to me) carry any preventive force that the term suggests?
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.
Re:A Modern C Development Environment by Aurornis on Thursday August 10, 2023 @06:45PM (#37082666)
The colloquial definition of "gatekeeping" doesn't require literal preventative force.

See https://www.urbandictionary.com/define.php?term=Gatekeeping

Re:A Modern C Development Environment by the-printer on Thursday August 10, 2023 @07:41PM (#37083163)
I get that, but even figuratively, it's a relatively harmless opinion that can only achieve as much by way of influence or control as readers are willing to allow the anonymous commenter to hold over them. There's more to learn if we confront the opinion by its premises (as shown by other responses to the comment) than by moral grounds.
Re:A Modern C Development Environment by sophacles on Thursday August 10, 2023 @06:51PM (#37082721)
The term has become common on the web to refer to enthusiasts trying to control how people enjoy/use a term or participate in an activity - for instance "real fans only like the stuff from before $album" or "only filthy casuals play the game that way" (or "you shouldn't use C if you want modern, good tooling"). This might be worth reading through:

https://www.urbandictionary.com/define.php?term=Gatekeeping

Re:A Modern C Development Environment by rfrey on Thursday August 10, 2023 @07:09PM (#37082901)
I did not read this as gatekeeping, rather I read it as an opinion on the suitability of C for kinds of project. If vim + make isn't enough, then C is probably not the appropriate language. Not that you shouldn't use C if you don't use vim + make.

We always talk about how good engineers "choose the right tool for the job". I don't think expressing an opinion on what the right kind of job is for a particular tool should be out of bounds. (Setting aside whether the opinion is correct or not.)

Re:A Modern C Development Environment by shortrounddev2 on Thursday August 10, 2023 @07:12PM (#37082928)
C is much easier to develop with using gdb
Re:A Modern C Development Environment by marmakoide on Thursday August 10, 2023 @08:47PM (#37083712)
For niche embedded devices, you often end-up with a half-baked C compiler and assembler, nothing else.
Re:A Modern C Development Environment by xigoi on Friday August 11, 2023 @04:18PM (#37093495)
You can still use a high-level language that compiles to C.
Re:A Modern C Development Environment by hot_gril on Thursday August 10, 2023 @08:32PM (#37083590)
You can write C however you want, doesn't mean it's the right language for the project. My team uses C++ a lot like Java, and turns out Java was the better tool for our use case.
Re:A Modern C Development Environment by stjohnswarts on Friday August 11, 2023 @01:50PM (#37091614)
I bet your customers enjoy the extra memory and performance though...
Re:A Modern C Development Environment by hot_gril on Friday August 11, 2023 @03:02PM (#37092526)
They don't, cause the speed at which we have to implement new features means cutting corners. We write backends, none of which are performance-critical. A lot of faster algos that would take too long to implement in C++ get skipped, so in the end it's slower than partner teams' Java code that does similar things, but again it doesn't matter as long as nobody notices the latency.
Re:A Modern C Development Environment by jonahx on Thursday August 10, 2023 @08:35PM (#37083619)
> This is called gatekeeping and it’s not helpful.

What a bad faith interpretation.

It's advice based on the poster's experience, stated with both qualification and good humor. You are free to ignore it. I appreciated it.

Re:A Modern C Development Environment by 95014_refugee on Thursday August 10, 2023 @08:46PM (#37083702)
It is gatekeeping. The poster was not offering advice, they were being actively discouraging. You can argue shades of grey, but at the end of the day this is an unsolicited discouragement, and an arbitrary out-grouping.

The fact that you don't see this as problematic, is problematic.

Re:A Modern C Development Environment by lcnPylGDnU4H9OF on Thursday August 10, 2023 @09:08PM (#37083903)
> a Makefile and vim (or emacs, or even nano, I'm not going to judge your kink)

The advice is common enough that it has a wikipedia page: https://en.wikipedia.org/wiki/KISS_principle.

There is no gatekeeping. There is a suggestion that C is best used for projects that have builds no more complex than a Makefile configuration. There is explicitly no ~judgement~ limit on what ~kink~ text editor one may use to edit the files.

Re:A Modern C Development Environment by kragen on Thursday August 10, 2023 @09:00PM (#37083848)
the fact that they don't see it as problematic means that they didn't misinterpret the comment the way you did, which is because they know things you don't

thus hegemonic institutions reinscribe the kyriarchy generation after generation by perpetuating a hierarchical opposition between "knowledge" and so-called "ignorance", which is socially constructed to be inferior, less than, but which serves the purpose of distinguishing the graduates of elite institutions (to which access is mediated by the financial privilege of the bourgeoisie) from the subaltern underclass; thus "knowledge" serves the interests of capitalism by reproducing oppressive class divisions, enabling the continued exploitation of the working class

what could be more problematic than that?

but if you're interested in learning something and not just playing word games to gain status by putting others down, i problematically mansplained what you're missing in https://news.ycombinator.com/item?id=37083233

Re:A Modern C Development Environment by flohofwoe on Friday August 11, 2023 @02:43AM (#37085808)
The proposed solution of a text editor and makefile is a lot easier to setup than the what's proposed in the blog post, I would call this the opposite of gatekeeping.
Re:A Modern C Development Environment by hot_gril on Friday August 11, 2023 @02:06PM (#37091833)
It's not gatekeeping. If you're so sensitive that a recommendation about editors and Docker discourages you from learning C, I'm sorry but it doesn't get much easier after here.
Re:A Modern C Development Environment by hot_gril on Friday August 11, 2023 @02:58PM (#37092481)
> The fact that you don't see this as problematic, is problematic.

I'm guilty as charged. If anyone is actually discouraged from learning C by that well-meaning advice, then they're going to have a pretty hard time in general.

Re:A Modern C Development Environment by ryan-c on Thursday August 10, 2023 @09:34PM (#37084042)
Editor preference was not intended to be the focus of my comment, it was more me being incredulous that someone would build something in C which necessitated Docker.

If someone wants to do that anyway, I am going to be perplexed that C was the language choice rather than golang or rust, and perhaps worried about C being a footgun WRT security, but whatever.

Re:A Modern C Development Environment by metabagel on Thursday August 10, 2023 @11:23PM (#37084773)
I think the point of Docker is a reproducible build environment.
Re:A Modern C Development Environment by hot_gril on Friday August 11, 2023 @01:58PM (#37091712)
Yeah, the Docker part makes sense. Don't want pointless differences between devs' setups to get in the way, especially when they're not all the same OS. I remember my first time finding out just how many differences there are between building C on Mac OS vs Linux.
Re:A Modern C Development Environment by aulin on Friday August 11, 2023 @05:37AM (#37086791)
How many times in your professional career you had the liberty to choose the language a project was developed on?
Re:A Modern C Development Environment by ryan-c on Monday August 14, 2023 @01:53AM (#37117915)
A supermajority of them, actually.
Re:A Modern C Development Environment by aulin on Tuesday August 15, 2023 @12:20PM (#37135833)
That's usually not the case. You work on existing code base and you want your editor to be able to explore it efficiently. Changing language is rarely an option unless you happen to enter a project at the very start.
Re:A Modern C Development Environment by thr_gt on Thursday August 10, 2023 @09:57PM (#37084211)
If you're using vsc then C is absolutely not the right language. If your code can't fit in your head when you're writing it then you have no hope of debugging it. Vsc very much encourages your code to grow as large as the machine you're wiring it in can handle.
Re:A Modern C Development Environment by crabbone on Friday August 11, 2023 @09:41AM (#37088587)
This is not a matter of taste. VSCode is an alien in the C world. It's clumsy, demanding and offers plenty of useless features, whereas the simple stuff is hard / impossible to get to work.

If you work on a C project, you need to be ready to have to edit source code, at least minimally, from an environment that doesn't have GUI. You will have to interact with pagers, man readers, readline a lot -- it's a lot more convenient if your editor works in the same way as those tool.

You are just creating unnecessary problems when you use VSCode or a similar editor. And I cannot think about a single benefit that would come from using it. Beside other things, it's just a crappy text editor... the only thing that's going on for it is that it's a Web browser application... which is kinda worthless when it comes to a typical C project.

Re:A Modern C Development Environment by pjmlp on Friday August 11, 2023 @10:17AM (#37088938)
As someone that has lived throught the glory days of UNIX development servers, I see VSCode as a modern version of using XEmacs via X Windows.

Seemed perfectly modern for the mid-90's using DG/UX.

Apparently plenty of people don't have a clue of many of those environments used to be.