4 ms·
The greatest programmers in the world cannot write bug free C level threading code. It is a task beyond human capabilities.
by baggy_trough 7y ago
The greatest programmers in the world cannot write bug free C level threading code. It is a task beyond human capabilities.
- travisgriggs 7y agoI'm not sure I follow your terse comment. Are you inferring that because skilled programmers have bugs in code with threads, that threads are bad? Isn't that a bit non-sequitur? Skilled programmers have bugs in thread with no threads! Should we therefore infer that if only they added threads, they would be bug free? I am not arguing in favor (or against) threads. I am not contesting that they lead to more bugs or not. What I was contesting was the assertion was that "threads are not a natural fit." My point is that procedural programming (which nearly all programming is at least small level, minus languages like Prolog) is something human beings have been doing for thousands of years. Look at "recipe" for doing something, and you have procedural program. Look at any recipe for lots of people working together to do something, and you have a pool of cooperating procedures. It's something we get schooled in our whole lives.
- gameswithgo 7y agoYet sometimes a simpler abstraction can't do the job well enough. Sometimes you have to do the hard thing.
- pdimitar 7y agoIMO nobody is arguing about the sometimes part. Many programmers out there can't use Erlang/Elixir or Rust, or any other tech that makes writing parallel code much more deterministic and safe. I am aware of that and I have a deep respect for the programmers in the trenches who fight to produce bug-less parallel code in C. My argument at least is that, given the choice, there exist much more productive ways to make your employer money than to try and learn nuclear phys... I mean multithreaded programming. :-)
- lmm 7y agoCitation needed. I've yet to see a real business problem that couldn't be solved with a simpler, safer concurrency model and a bit of ingenuity.
- ringzero 7y agoI don’t follow - are you asserting that, by contrast, the greatest programmers in the world can write bug-free single-threaded code?
- pshc 7y agoI think the implication is to stop using C.
- pdimitar 7y agoI'd interpret it to stop using the pthreads model of the parallel coding, in general. Because the pthreads model exists and is used in many programming languages. But stopping to use C is a good start (for whoever has the choice)!
- nineteen999 7y agoMaybe the functional programming/managed code fans should step up to the plate and rewrite the operating systems, desktop environments, and hundreds of thousands of command line tools etc that have all been implemented in C or C++. Not as toy, proof-of-concepts. Fully fledged replacements for all that stuff that can be used in our our daily work. Build distros of the stuff so that we don't have to pick and choose this stuff and replace the bits of our systems in a piecemeal fashion. They could show us how it's done instead of talking endlessly about it in online forums. So let's face it, it's never going to happen.
- pdimitar 7y agoHm, where did I say anything about FP? As for managed code, it's being used with huge success in a lot of places (not in OS-es or drivers, yes) but that's quite the huge topic by itself.
- nineteen999 7y agoI never implied you did, they are merely one of the two major major groups of programmers I see consistently deriding C based infrastructure that presumably enables their paychecks to a large extent. I'm not defending C, I'm merely sneering at its noisy detractors who spend more time complaining about it than supplanting it.
- mypalmike 7y agoI'm not one of the greatest programmers in the world, but I don't find C threads to be particularly hard to deal with in a robust way. Threads in C are hard if you have a sloppy codebase with global variables everywhere and a general lack of structure and abstraction. Unfortunately, this describes many many C codebases.