3 ms·
C is a Wasteland
- angusgr 15y agoI'm not super familiar with Go, but the author's ideal C replacement sounds pretty much like my understanding of Go.
- edsrzf 15y agoIt's close. The only thing the author lists that it doesn't provide is manual memory management. It's technically possible, but the language/libraries don't provide it. Type safety and lack of generics make it difficult to provide a reasonable interface for it.
- digamber_kamat 15y agoThe manual memory management and lack of standard libraries make C programming language the only useful language when it comes to safety critical domain. (Exception is Ada). Java or Python are super cool, there is no doubt about it. But when you have to program a metro rail or Eurofighter jet controls, one has to give hard deadline to the tasks. Unfortunately no high level language can be used in such cases. Garbage collection adds undeterminism to the temporal properties of the executing tasks and hence can not be user in real time safety critical domains.
- killbot5000 15y agoThere are new techniques wrt to garbage collected languages and hard deadlines (eg, every period has a dedicated amount of time to garbage collection, whether it needs it or not).
- jethroalias97 15y agoSo it's possible my airplane might fall out of the sky because there is not enough memory because not enough time was devoted to garbage collection? That doesn't sound like a great solution. Not to say that C is necessarily the ideal solution. The main reason the author hasn't seen competitors to C is because the author didn't look for one. Vala is decent and there are many others, they're just not sufficiently better than C to result in people switching.
- jasonzemos 15y agoThe most puzzling aspect of C’s dominance, to me, though, is that C has had no competition in its problem domain. Nobody has really said “I’m going to create a better C.” Pretty sure Bjarne Stroustrup said just that.
- Detrus 15y agoCould Go switch between manual memory management and garbage collection after some modification? Or are some choices in the language preventing this?
- edsrzf 15y agoIt wouldn't be difficult to add new built-in functions for allocating and freeing memory manually. If you wanted to remove garbage collection, it would require a more significant language change. There are several constructs in the language that implicitly allocate memory. If Go adds support for generics, manual memory management could be provided by a third party package.
- jat850 15y agoArticles like this make me grind my teeth. I know I should have more self restraint, and I can forgive/concede a few points made in this article. Generally though it's just a major rehash of old news. I was not surprised to find that the author is a relatively inexperienced college student. Glib eliminates a good chunk of the complaints outlined here. Some of it is simply coder responsibility. (Array bounds checking, memory management - should be problems handled with good code review and maybe the help of some 3rd party tools.) But the last line of the article was what just pushed me over the edge. "Ruby/Python inspired syntax." So really, the author would just prefer to code in Ruby or Python.
- jamesmiller5 15y agoSo true, the real issue I think the author is trying to bring up, is that C might not be the right tool for every job. I agree, but personally C is the most fun to use.
- whackedspinach 15y agoSuggesting that a cleaner/simpler syntax should be used doesn't mean he wants to code in Ruby/Python. They have plenty of their own flaws. He just admires their syntax since it is very readable.
- zeteo 15y ago>When C was created, it’s main competitor was assembly language C was created at a time of great effervescence in programming language design. FORTRAN and COBOL were well-entrenched, and it also had to compete against the likes of Algol, Lisp and Pascal. (Also, the correct spelling, in this context, is "its".) >C, however, has it’s flaws, foremost among them: [...] a woefully inadequate standard library Sure, you can't do that much with the standard library alone, but C probably has more libraries overall than any other language in existence. Some of them have rather clunky APIs, but on the other hand they're usually very fast and very well tested.
- pnathan 15y agoNo. Learn your history and your computer science. * At the time of C's creation, there was (among others): Fortrans, Cobol, BCPL, and a set of Algols. A cursory check of a programming languages book or Wikipedia will verify the error. * There are a ton of C libraries. You know, if you want to go and look for them instead of expecting them to be handed to you. * Concurrency at the C layer is provided by OS/HW primitives. pthreads ain't bad, for all the whinging. * Manual memory management is very needed in systems programming (embedded programming). * A need for array bounds checking reflects slower code and lazier coder. Look at Pascal strings for the grief that can cause. * Better support for splitting- what? I can not perceive the confusion of mind that could generate this statement * "It's got curly braces, wah". Of all the complaints I have heard, this asinine complaint about (curly braces/parens) is perhaps the most empty. --- If you want a powerful systems language that isn't C or C++, try Ada. I haven't found a need for it personally, but has one zillion features. Other languages that might play in this space are Rust and D. Possibly some of the functional languages that compile out to binaries. (OCaml perhaps?) C is designed for building operating systems with, on fairly marginal resources. It is so excellent at working at that layer that no one has come up with a truly viable surviving competitor in thirty-five years. And, like any other tool, it doesn't really fit in places it wasn't designed to fit.
- jinushaun 15y agoSounds like it was written by a young kid who learned to program with Java or Ruby.(Checks about page) Yup, 19 year old college student who probably thinks that computer science started with HTML and JavaScript.
- wglb 15y agoNot well informed. Go is a better C, albeit with garbage collection. C++ was designed to be a better C. D was designed to be a better C.