Posted: Mon Dec 24, 2007 9:32 am
$ also requires AltGr, +4 this time.MessiahAndrw wrote:You can use $( and $) instead of { and }.Craze Frog wrote:I don't use C.
- C is unreadable
Compare { vs. begin
- C is untypable
{ requires AltGr+7, which means stretching or moving the hands a lot
I know, I just said it was illogical.If you wanted them to both be pointers use:
int unsigned *ptr, *noptr;
Yes, and I've heard of about 8 other C compilers as well. Unfortunately I wasn't able to compile pcc for linux. But most C projects use GCC because it generates the fastest code of the free C compilers.GCC isn't the only C compiler. Have you heard about TCC and TCCBOOT (a bootloader that compiles and runs Linux in 10 seconds).
I know why, it's still inconsistent.I know. I guess it's because:
int *ptr = 5;
wouldn't make much sense if ptr wasn't pointing to anything.
It is my personal opinion that if C was designed to be low-level they failed. It's too high-level.MessiahAndrw wrote:C is designed to be low-level. It's suppose to be "minimal" whereby things such as strings, which aren't a feature of the CPU aren't included in the language definition, but rather the implementation - this way a string could be variable length based around chars, wchar_ts, ints, etc. C++ solved a lot of this difficulty by having a STL string class.Craze Frog wrote:- C is too low-level for serious application programming
It doesn't even have a string datatype. Writing even simple programs takes a lot of time if you want them reasonably bullet-proof.
And what if it's suddenly compiled by a 32-bit compiler that uses 8-bit ints. Oups there your page tables are all messed up. Of course, there are solutions to this mess, but introducing the problem in the first place was a bad idea.I don't know where you're getting this from but the only bit of non C/C++ code in my kernel (other than the odd inline assembly) is the code that sets me up to call my C++ main() function, and my interrupt stubblets (which then calls C++ code). All my device drivers are done using C++, passing C-style structs when I need be (which can have individual bits aligned).
I'm not listing reasons why C is bad, but why I'm not using it. By using fasm macros my asm code is much shorter than the similar C code. I simply don't like typing the same thing over and over. If you like it, fine, but if I have to do that when using C, then I won't use C.MessiahAndrw wrote:How so? I don't think it's perfect, but adding any more features would make the preprocessor more of a compiler-scripting language that preprocessing.Craze Frog wrote:- C's preprocessor features are very basic and too error-prone compared to the things you can do with it
That's what I called "similar". If you use Visual Studio it's a makefile-like thing going on under the hood as well.MessiahAndrw wrote:No it doesn't. I use a bash shell script that loops through *.c and *.cpp.Craze Frog wrote:- C requires makefiles or similar
Lots of typing and thinking for what can easily be done automatically by the compiler
No. When I type "C:\hello\world\returns" it's interpreted as "C:\hello\world" then a carriage return and then "eturns" concatenated.MessiahAndrw wrote:What? When you input a string from the keyboard that has a \ in it, it gets recognised as the character \. Also, you can use \\ or @"[string here]".Craze Frog wrote:- C uses escape characters in character strings, thus molesting path names in some operating systems
You can say it's no big deal as C is for UNIX, but on the other hand, they made the type system unusable under the cover of cross platform-ness, so why did they suddenly stop caring?
I know I can use \\, but introduce this problem in the first place?
Again, I know why, but I still don't like it. 1+1 should never be 5.MessiahAndrw wrote:That's because you're increasing the pointer. You're pointing to the next int in memory after a. You should use *a += 1;. *a means "the value being pointed to by a", a means "the value of a".Craze Frog wrote:- C doesn't know basic math
If a has the value 6385921 and you do "a += 1;" then a may well have the value 6385925 if a was declared as int *.
^ is the bitwise XOR operator, something completely different.MessiahAndrw wrote:Erm.. what do you think ^ is?Craze Frog wrote:- C doesn't know basic logic
There is no non-bitwise XOR operator in C.
I'd say one of the first things you should learn about a language is its operators.MessiahAndrw wrote:You shouldn't judge a language before you know it.
If by "my second to last question" the you mean the pointer calculations, then that wasn't a question and it wasn't incorrect either. The same applies to the last statement.Sure it's not perfect, but you're making a lot of incorrect assumptions here that just make you look foolish (especially your second to last question).
Why is most of the industry/open source software/etc so prone to crashing?MessiahAndrw wrote:I could say the same about Pascal or BASIC if I never used them before and assumed the same. Besides, if C was really that unreadable and illogical, why is most of the industry/open source software/etc focused on C and C++?
I know what it is, and I'm saying I don't like it!It's the implicit contexts.
Not really. C is pretty good at balancing multiple qualities that you'd want in a programming language. Not I.As an aside, I have not seen a language that offers that fine mix of portability, flexibility, readability and power as well as C does. I'm not saying C is particularly great at any one thing, but it is pretty good at balancing multiple qualities that you'd want in a programming language.
I think some people thought I pointed out bad things about C. I wasn't this time. I was pointing out things that I don't like about C, which is "why I don't use C" (the original question). I can perfectly understand why some people want 1+1 to be 9 (not 5 this time!), but personally I prefer it to be 2.
Also, I'm not saying that a perfect replacement for C exists. In fact, I'd say about the only reason it's used so much.