C is a better language than any language you care to name.
-
Joe Woodbury wrote:
Arrays are pointers
Joe Woodbury wrote:
the information which gives the extent of the array - the array dimension." THEY NEVER HAD IT
char *p = "hello"; //pointer - no information about the dimension
char q[] = "hello"; // array - contains information about the dimensionprintf("%zu\n", sizeof(p)); // => size of pointer to char -- 4 on x86, 8 on x86-64
printf("%zu\n", sizeof(q)); // => size of char array in memory -- 6 on bothNemanja Trifunovic wrote:
char *p = "hello"; //pointer - no information about the dimension char q[] = "hello"; // array - contains information about the dimension
No the ARRAY does not. The declaration does and thus the precompiler) and sizeof(), but not the array itself. To illustrate, the function:
void _function(const char r[])
{
printf("%u\n", sizeof(r));
}Will print 4 or 8, depending on the size of a pointer, when you call
_function(q);
. Added: Moreover, an optimizing compiler will likely pool both strings and use the same pointer for both operations (especially since it's clear they are both const.) Again, the sizeof() is handled by the precompiler, not at runtime. -
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
It may be fast, but not as fast as MASM. Just look at some of the created code in the .cod listing. Many, many, pipeline stalls in code initialization where a push and pop of ebx would free that reg to share loading eax, then ebx, then saving eax, then saving ebx, and this was in optimized code in a high use function in JKDEFRAG. I'll stick with MASM. Dave.
-
What's on second, I Don't Know is on third... hang on! Haven't we had this discussion before?
- I would love to change the world, but they won’t give me the source code.
:laugh: yeah. You had. And it makes me laugh even for the second time. Told you, I have weird humor. ;)
Don't mind those people who say you're not HOT. At least you know you're COOL. I'm not afraid of falling, I'm afraid of the sudden stop at the end of the fall! - Richard Andrew x64
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
Ahm, how about this language[^]? :)
Don't mind those people who say you're not HOT. At least you know you're COOL. I'm not afraid of falling, I'm afraid of the sudden stop at the end of the fall! - Richard Andrew x64
-
Isn't that "bettor"? /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
I'm not sure, but I'll ask my Grammar when she's done baking cookies.
Will Rogers never met me.
-
I'm not sure, but I'll ask my Grammar when she's done baking cookies.
Will Rogers never met me.
Baking cookies? I usually just add them to a response. ;P /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
'C' was its grade as a a programming language. C++ got a grade of C-- ;P
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
I agree. Granted that may be because I don't care to name any others.
You'll never get very far if all you do is follow instructions.
-
Everything you said is nonsense and gibberish and yet I perfectly understood you. :) :thumbsup:
There are only 10 types of people in the world, those who understand binary and those who don't.
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
Chris, I am afraid you have the wrong information. C is not a language, it's an alphabet.
Remind Me This - Manage, Collaborate and Execute your Project in the Cloud
-
Chris, I am afraid you have the wrong information. C is not a language, it's an alphabet.
Remind Me This - Manage, Collaborate and Execute your Project in the Cloud
Rutvik Dave wrote:
C is not a language, it's an alphabet.
Actually, it is just one element in a set called an "alphabet." We also have a 'D' and 24 other members in the set.
Will Rogers never met me.
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
The vast majority of the software out there is written in C. The vast majority of software out there has crippling flaws, are out of budget and abandoned after tried to use. QED ;P
-
Chris Maunder wrote:
C is a better language than any language you care to name
No, I think I would much rather talk to someone using English. :rolleyes:
printf("Why is that then?");
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
OK, I'll "bite". "C" is quite the most disastrous so-called "language"[1] ever to become popular. Why? It's total lack of marshalling over record boundaries in memory have cost the globe at least several 100 trillion dollars in viruses, damages, fornicate-ups, interminable repairs/patches, Trojans, injuries, deaths, et cetera. That alone is enough to relegate this incurable abortion of a syntactical nightmare to the bit-bucket, if not Spandau prison. Have at it, you "C" devils. ___________________________ [1] Designed for punch-card use, brevity & conservation of card-space were essential. It thereby became an impenetrably terse & line-break free mess. All calculated to save IBM punched cards. And the syntax is dangerously ambiguous, all over the shop. Don't get me started on the monumentally bone-headed notion that CASE statements should cascade through without a BREAK clause! I mean. What total idiot "thought" that this would be a great idea?
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
-
Garbage collection is a flaw, not a feature. It not only sucks resources, it creates a huge unknown. Some of the most difficult problems I've dealt with were with garbage collection (in one recent case, we never did solve the problem--some the most brilliant engineers I know also failed to solve it. Around the same time, we tracked things back to a lesser known bug in the .NET 4.0 garbage collector.)
Well no, it's a feature. GCd environments eliminate a large group of common bugs, free the developer to think about higher level stuff and not litter their code with memory management cruft, and are in general a Good Thing. It's just that it's a feature that, in certain particular circumstances (particularly when resource usage is tight), isn't helpful.
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
I don't care so much about the language as everything else. When Java first came out, I finally had a system to write graphical desktop applications on different systems without a ton of BS. Sure people joked about AWT being "write once, debug everywhere", but compared to everything else it was light years ahead. I had libraries that actually worked - on average, I could not compile a C library, so who knows if it did what I wanted or not. I had really simple database access, network access, all the stuff I had wanted and couldn't seem to get. I was like a kid in a candy store. This is the problem with C - not the language, but the lack of something akin to the JSR process, where standard libraries for all sorts of useful things are created. I'd be the first guy to say that Java programmers love to go overboard and make a Rube Goldberg library for everything with 59 layers of abstraction, whereas C programmers tend towards minimal libraries that do just what's needed and no more. But then those C programmers love macros and other things that make the code hard to understand, and they need systems like autoconf and ports trees to actually get their libraries to even compile on different platforms. Six of one, half dozen of the other. So I still love Java for all it provides. The language is overly complicated, and generics are by far the singular worst - and completely unnecessary - feature. When I saw all these new script languages cropping up, I thought, well what about the library for database access, for generating spreadsheets, PDFs, reports, images, etc? I failed to see why I'd want to switch to something shiny and new that is clearly less capable just because the language was simpler. Years later, I see people moving back to Java because they had scalability problems, or problems like this author described with something fundamentally wrong buried deep in the guts of the system. And I still don't see much in the way of database libraries and other things. I have a chuckle when I read about such things. The more things change, the more they stay the same. I'm sure there are other languages that have a great set of libraries for useful stuff, I'm sure .Net can likely do a lot of the things I need. But would I be any better off with another language? I don't think so. And I can use other languages through the ScriptManager anyway, while retaining access to all the libraries Java offers.
-
Rutvik Dave wrote:
C is not a language, it's an alphabet.
Actually, it is just one element in a set called an "alphabet." We also have a 'D' and 24 other members in the set.
Will Rogers never met me.
... and the English language has killed my joke, again! :-D
Remind Me This - Manage, Collaborate and Execute your Project in the Cloud