144
Someone
7y

When people say that C is no longer used.

Comments
  • 0
    @nik123 sharp develop may be cross platform. I can't remember though
  • 1
    Already struggle with C++ so I'd rather not get involved in it.
  • 0
    @nik123 jetbrains rider
  • 2
    @Marethyun because they're 13 and they know jack shit about computers (if they say that)
  • 6
    @nik123 not all FOSS software is automatically better than paid proprietary software..
  • 0
    Yeeees. So true.
  • 1
    @nik123 I wouldn't count on it. C# was developed by Microsoft for Microsoft and all their fan boys. I'd say learn another language, there's a lot out there
  • 1
    @Lasagna I want to write a small library that will work on every single architecture on earth. Performantly. What language should I choose?
  • 2
    Try Rust. You'll love it
  • 0
    @Lasagna y would u say that c is useless?
  • 0
    What's the Java's read on J A V A
  • 4
    @nik123 you cant use C# without Windows. C# is for Windows, just like Swift for Apple products.
  • 2
    I don't get why people hate C. The language is mature and well documented. I usually hate higher level languages that change all the time.
  • 3
    @afrometal you can use Mono on Linux, works really well. The control software for my 3d printer it's C# and runs perfectly fine on Linux.
  • 4
    Learning C after being a JS guy for a long time has been good for me, I think learning more methodologies sharpens our skills as programmers.
  • 3
    @afrometal Weird. I guess my Linux-servers and MacBook are secretly running Windows 🤔
  • 2
    @Marethyun Because programming students are exposed to constant abuse from comersial academies, courses and books commercially created to convert as many long people into brainless monkey coders and fulfil the primitive coding needs
  • 1
    @Lasagna well, C was designed to be relatively straightforward to implement, so the ubiquity of compilers is really a language feature.

    It is also a small language; the only other small languages I can think of are lisp-style or academic.

    The only widely-used language that was designed to compete with C is GO, and it's not really a competition since it's hardly a systems language.

    So, when someone says "C sucks" the question is "relative to what?". It's less expressive than, say, English; it's more prone to errors than Gallina - but both aren't meaningful comparisons, right?

    Take a C-based project, such as Linux, Chrome, etc. and tell me what language should it be written in. The candidates - C++, Rust, Go and friends - all have severe issues on their own right.

    Maybe WebAssembly will replace C one day. Maybe.
  • 0
    @Lasagna interestingly many studies have shown there are no productivity gains from using C++ over C.
  • 1
    @Lasagna what viable C alternatives exist?
  • 0
    @Lasagna the first is not something I claimed.

    The second is true - possibly with the exception of parsing. Please name an easier commonly-used language (managed/GCed languages are off the table by definition).
  • 0
    @Lasagna I meant "C is relatively small for a mainstream language, and languages that are _much, much smaller_ are generally LISP-like or academic. Lisp does not compete with C since it is not a systems language.

    I don't think that the size of the adddition required for turing completeness is important. Nor is undecidability IMO: type-checking Java or Scala is undecidable, but that doesn't seem to be a problem in practice.

    I read somewhere that writing a recursive-descent parser for C is easy, and the problem is with yacc/bison-like tools. I don't know if this is actually the case. But anyway, porting a compiler implementation to a new environment is basically porting the code generation, and this is the "mainly straightforward" part (no closures, no complex multithreading, etc.)
  • 4
    Also a C developer here. And C is not useless depending on the use case. Not all companies favor portability over the speed that C can provide. And if we're talking about code portability, we're really only talking about ANSI C and GNU C
  • 1
    I use C and C++... I really like both languages and these r the only 2 languages I like... so much that I probably won’t code at all if not in these languages... or maybe something else low level ( no not assembly please 😨 )
    I just find C and C++ so much fun 😍😍🤗🤗
  • 1
  • 0
  • 1
    @watzon possibly. It's certainly the only candidate I can think of. So we compare a recently-invented, complex, with a relatively simple 40-years old language.

    Linear logic (the theoretical basis of Rust's type system) was only discovered ~15 years after C was invented. And it is not completely understood to date. Rust uses some ad-hoc solutions that work in many cases, but not all. And when they break, the error messages are not easy to understand.

    I admit I am yet to use it successfully in a toy project - though I have written reasonable C programs (small games) a month after I began learning it, some 16 years ago. Oh, and programming languages are my profession and hobby. I can only guess that if you like Rust, you're probably a programming-language enthusiast and not the average programmer.

    Additionally, Rust is very far from being straightforward to implement, so its portability is basically the portability of its reference implementation - not competing with C AFAIK.
  • 2
    @elazar I can appreciate a well thought out response. I agree that rust isn't all there yet, but I've loved it so far. It's loads better than C/C++ when it comes to package management, helpful errors, and (in my opinion) syntax. I'll agree that it's not ready to replace C++ yet
  • 1
    @watzon better errors than C++, sure (maybe concepts in C++20 will help). But I think the error messages in C are pretty good.

    Note that the errors themselves are an implementation issue, but the language should lend itself to it
    C++ does not - but (AFAIK) neither does the static-analysis-dependent parts of rust. I'm sure you know better than me about this anyway.
  • 0
    BTW there is a new, real alternative to C: WebAssembly.

    It will take some time to happen though.
  • 1
    @elazar The most important feature besides convenience of languages like Rust and Go over C is safe/unsafe mode, imo.

    In C it's a lot easier to create mem leaks (possibly resulting in security breaches) for example.
  • 2
    @theCalcaholic this is well known and agreed. But for the security of the languages mentioned you pay the price of rigid type system.

    Personally I'm ok with that, as long as the abstractions suits me. There weren't any at the time C was invented (see the failure of Pascal), and they aren't perfect yet.
  • 1
    @elazar Was Pascal a failure? I've never worked with it and I'm too young to judge - but wasn't it quite popular at the time
  • 2
    @theCalcaholic it was popular, then failed - didn't scale well and was never a fit for systems programming.
  • 2
    And part of the reason is ridigity of the type system (ehm strings), inappropriate data structures ( strange sets) and lack of modularity.
  • 1
    @elazar I see. Thanks for explaining.
  • 1
    C will never be useless. C is 42
  • 1
    @Bitwise since .NET Core exists, C# and .NET are officially supported on Linux by Microsoft. .NET Core runs natively on Linux without missing features.
Add Comment