Originally posted by theed
I don't know of any modern OSes written in Pascal, since our poor dear OS 9 has departed, which still had pascal stubs till its last day. As for assembler, someone wrote one a little while ago for x86 architecture that was noted on slashdot, had really impressive file sizes like Be did originally, OS, Nic driver and web browser all on a floppy, etc.
This is kind of what I was talking about. The fact that there are Pascal
stubs or even full functions (stub to me means non-working function, btw) does not an operating system make. I don't think Pascal is powerful enough to make an operating system. I only have passing acquaintance with Pascal, but I've never heard of the low level abilities of C within Pascal. Assembly definitely has the power, but I don't think it has the maintainability to compete with a higher level language like C in the operating system market.
And when I say C I tend to refer to the family of C, C with classes, and C++. And as such, structs and classes are the same in C++, especially if you explicitly state what's public and private. Structs can contain functions, but it's convention not to, as that's not their intended purpose. Both contain data members, but structs default public, classes default private.
Almost every post in this thread has mentioned ANSI C as the language in question. C++ is a mutated beast that I really think should belong to another class of language (hybrid bastard child to be more precise, but I digress
). I have never seen a struct with functions, nor have I ever heard that it is possible. I'll take you at your word, however, and stand (or sit) corrected.
As for my other comments bringing make, precompilers, and unix into question, the original was about why it's so hard to learn from C code. This is definitely part of it. When you're not sure what is what, it looks like C has 4 different forms of syntax.
Again I'll concede the point. I never learned C from examining Unix source code, so when I did examine Unix source code I already knew what was what. I made the classic pair of mistakes: Not reading the original post thoroughly enough and not putting myself into the new user's shoes. I will not, however, agree that you can count the man pages in with that new learning. Every single programming language has a help system of some sort, be it Windows help files (shudder!), man pages, perldoc, or the web. Since the help files all have the common problem of not being the same as the source code (syntactically speaking), I think it should be ruled out of the equation. Common denominators, if you will. Hey, it's a small point, but I need to make a stand somewhere...
I hated learning programming under C, as I spent more time learning C than learning to program. I had already programmed under Pascal, and never got used to C's terse syntax.
The comparison to Perl was made because at least Perl lives within itself, you don't also have to learn Make for instance. But it's butt ugly all the same.
I find this interesting -- you never got used to C's terse syntax, but can use Perl even though it's "butt ugly"? I can make beautiful C source code, and cryptic Perl code, it all depends on me. Don't blame the language for my style (or lack thereof).
As I mentioned, I only have a passing acquaintance with Pascal -- what about it is so wonderful? If you're talking BEGIN and END vs { and } I'll make a note to myself that you're a lunatic.
And if you already knew Pascal, why did you need to learn to program when you learned C? Programming is programming -- the syntax varies, but the concepts stay the same.
I also don't agree that you
have to learn makefiles to learn C. If you're examining pre-existing code, yes. But I don't make makefiles for most of my programs -- they're almost always self contained, just like Perl.
Nkuvu, you have some valid points, and I respect your opinions, but I will continue to hate C in general, and you seemed to be going a little farther than I thought was valid, so I played devil's advocate. You called my bluff, err, exaggeration, and here we are. Not really trying to offend, but not really trying not to either.
I never tried to convince you otherwise. I just wanted
someone to specify why they hate C so much, and be prepared to explain themselves. You hate C, I don't like C (truly!), we can all hate VB together.
I swear, it took a lot of prodding to get
any response from someone who wanted to discuss this. So don't be confused -- I was trying to get a reaction, so may have poked a little harder than necessary.