Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

54
  • 7
    ... Continued... Several of your points I think are just plain wrong, i.e. the "everything is a file" argument. Files are sequential access, C strings are not. Length prefixing can also be done with minimal syntactic sugar. The only reasonable argument here is the trying to manage 32 bit prefixes on small (i.e. 8 bit) hardware; I think that could be simply solved by saying the size of the length is determined by the implementation. After all, that's what std::basic_string does. Commented Dec 12, 2010 at 4:26
  • 3
    @Billy ONeal: really there is two different parts in my answer. One is about what is part of the 'core C language', the other one is about what standard libraries should deliver. Regarding to string support, there is only one item from the core language: the meaning of a double quote enclosed bunch of bytes. I am not really happyer than you with C behavior. I feel magically adding that zero at end of every double closes enclosed bunch of bytes is bad enough. I would prefer and explicit \0 at the end when programmers wants that instead of the implicit one. Prepending length is much worse. Commented Dec 12, 2010 at 7:34
  • 3
    @Billy ONeal: that is just not true, the uses cares about what is core and what is libraries. The biggest point is when C is used to implement OS. At that level no libraries are available. C is also often used in embedded contexts or for programming devices where you often have the same kind of restrictions. In many cases Joes's should probably not use C at all nowaday: "OK, you want it on the console ? Do you have a console ? No ? Too bad..." Commented Dec 12, 2010 at 7:52
  • 8
    @Billy "Well, for the .01% of C programmers implementing operating systems, fine." The other programmers can take a hike. C was created to write an operating system. Commented Dec 13, 2010 at 11:06
  • 7
    Why? Because it says it is a general purpose language? Does it say what the people who wrote it was doing when it created? What was it used for for the first few years of its life? So, what is it that it says that disagrees with me? It is a general purpose language created to write an operating system. Does it deny it? Commented Dec 13, 2010 at 18:15