C is a better language than any language you care to name.
-
With visual basic, actually most languages deal with strings better then C...
Better than Pascal I think you meant.
You'll never get very far if all you do is follow instructions.
-
Better than Pascal I think you meant.
You'll never get very far if all you do is follow instructions.
No I mean it's a waste of time. When you look at home long at takes to get a result and maintain that result visual basic wins every time.
-
OK, now use with to copy values between two instances.
You'll never get very far if all you do is follow instructions.
You can't think outside the box can you. Usually I would do something like this to copy a class Public function copy(byval ojbectName as objectType) as objectType Return objectName end function There are many ways of getting values from one structure to another, not just with the use of methods. Lastly this points out that you should be utilizing different methods of programming to get a result instead of manually coding each line out.
-
You can't think outside the box can you. Usually I would do something like this to copy a class Public function copy(byval ojbectName as objectType) as objectType Return objectName end function There are many ways of getting values from one structure to another, not just with the use of methods. Lastly this points out that you should be utilizing different methods of programming to get a result instead of manually coding each line out.
Colborne_Greg wrote:
to copy a class
Not copying everything; just some values.
You'll never get very far if all you do is follow instructions.
-
Colborne_Greg wrote:
to copy a class
Not copying everything; just some values.
You'll never get very far if all you do is follow instructions.
If you only want a few of the values use visual basic reflection.
-
printf("Why is that then?");
// No comment!
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
Funny, I thought the language to-go was Fortran?[^] :doh: Now I'm waiting on a corresponding article about COBOL ;P
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
-
Visual basic 2013. It can utilize every C, C++, and C# library. Plus it looks pretty. For example the "with" operator is in Visual basic but is not in C.
Have you read the article?
Colborne_Greg wrote:
It can utilize every C, C++, and C# library.
C can be plugged into any application in any language. The author is aware that C itself lacks libraries and he does mention it. So what was your point again?
Colborne_Greg wrote:
Plus it looks pretty.
Ah that. :doh: Ok, seriously. If you meant it has a better readability, that was mentioned by the author, too. So, again the question, what was your point?
Colborne_Greg wrote:
For example the "with" operator is in Visual basic but is not in C.
And it's in Pascal. So what? Again, the author made a point that other languages offer more (and often more complex) language elements - but that doesn't deterr him from listing a number of advantages of the language C that you failed to address entirely. Disclaimer: I don't actually agree with the article. I just wanted to point out that the article already pointed out or implied everything you said, and you did nothing to argue against it. (if that was your purpose)
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
-
If you only want a few of the values use visual basic reflection.
reflection ???!!! :confused: :omg:
You'll never get very far if all you do is follow instructions.
-
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?
Michael Kingsford Gray wrote:
several 100 trillion dollars
everyone can make up numbers. Just to get an idea of how ridiculous a claim yours is, check this out: http://xkcd.com/980/huge/#x=-11116&y=-7100&z=4[^] Even if the number you posted were accurate it means nothing at all without context, and you cannot provide that context either: You have to put it into relation to the amount of code written, and then compare to equivalent numbers for different languages. Anyway, the vast majority of really severe and costly bugs are not related to any specific language feature at all, and could have happened in many different programming languages. For instance the Y2K bug was born at a time when C didn't even exist yet: it was a conceptual decision to save memory. Something that at the time made sense for any program, and was kept that way, until people started to realize that it would lead to a problem! That[^] was a costly bug!
Michael Kingsford Gray wrote:
[1] Designed for punch-card use [...]
As all other languages at the time. And the punch card limits are no longer an issue in the modern C language (or other languages that survived: see Modern Fortran, Modern Cobol, etc.).
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
-
Michael Kingsford Gray wrote:
the monumentally bone-headed notion that CASE statements should cascade through without a BREAK
:thumbsup: Hear! Hear! That is (in my opinion) the very worst mistake in C.
You'll never get very far if all you do is follow instructions.
Maybe, but at least it's consistent with the
goto
/label syntax.GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
-
Maybe, but at least it's consistent with the
goto
/label syntax.GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
Maybe, but
break
doesn't affect agoto
. And I have never used agoto
in C.You'll never get very far if all you do is follow instructions.
-
Have you read the article?
Colborne_Greg wrote:
It can utilize every C, C++, and C# library.
C can be plugged into any application in any language. The author is aware that C itself lacks libraries and he does mention it. So what was your point again?
Colborne_Greg wrote:
Plus it looks pretty.
Ah that. :doh: Ok, seriously. If you meant it has a better readability, that was mentioned by the author, too. So, again the question, what was your point?
Colborne_Greg wrote:
For example the "with" operator is in Visual basic but is not in C.
And it's in Pascal. So what? Again, the author made a point that other languages offer more (and often more complex) language elements - but that doesn't deterr him from listing a number of advantages of the language C that you failed to address entirely. Disclaimer: I don't actually agree with the article. I just wanted to point out that the article already pointed out or implied everything you said, and you did nothing to argue against it. (if that was your purpose)
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
Your signature has a line about GOTO The goto fail example is a major fail in general for the C language. The goto is the first thing every programmer should avoid, but in this example the GOTO's are used correctly, but its a limitation of the C language (one of the dumbest things in history I might add) Visual basic .net is C with English words and no bracket issue, the GOTO fail would never had been an issue in VB.
-
reflection ???!!! :confused: :omg:
You'll never get very far if all you do is follow instructions.
Interesting that your signature is "You'll never get very far if all you do is follow the instructions" fitting for this tread isn't it
-
You are arguing against something I never said. Specifically, nowhere did I say that the precompiler isn't part of the language. More generally, my point is that the information about the size of the array is known only by the scope of the array declaration at compile time; it is not contained in the array itself and available at runtime. In C, an array and a pointer are, for all intents and purposes, synonymous (with the exception of this very narrow edge case.) So, the [partial] function declarations
a(const char* p)
andb(const char d[])
mean the same thing. Doing asizeof(d)
for the latter doesn't tell you anything meaningful about the original array. This also means that you can take an arbitrary pointer and use array syntax on it. i.e.p[3]
. This gives C an enormous power and flexibility found in few other languages. Attaching any other information to a pointer (or array) changes the very nature of what a pointer is and adds overhead that is often not desired nor wanted (and if desired, you can easily create a struct (or class in C++) with that information contained in it. This very flexibility means that arguing that arrays are problematic in C is a strawman argument.) -
jschell wrote:
Rather certain that the precompiler is in fact part of the language
Yes, and as he said in his response, he didn't say otherwise. Some points I'd like to make are: A language is defined by its compiler (not the other way around). DMR probably could have made C without a pre-processor; I see no reason that C has to have a pre-processor other than that it does have a pre-processor. The existence of D and C# may support this view. I have seen (I don't remember where) at least one argument that the C pre-processor acts on a different language than the C compiler does; and I am in about 90% agreement with that point of view. I like the C pre-processor; it's really just a text processing utility -- it can be used for purposes other than its primary usage. (I even use it with C# -- Implanting Common Code in Unrelated Classes[^]) Unfortunately, it also has some functions (e.g. sizeof) that are tightly bound to C. :sigh:
jschell wrote:
limiting oneself to just the "language" then C is in fact useless, since one cannot in any practical way do anything useful with the "language"
You may be arguing that the language is pretty limited without libraries, and that is quite true, very little can be accomplished without at least printf -- I have written a simple program that calculates a value and returns it from main, simply to demonstrate that something, no matter how pointless, can be done without linking in any libraries. However, I think the article was also pointing out the ease with which a developer can leverage a multitude of libraries with C. Just the other week I was playing with ODBC, and linking in only the ODBC libraries and not the "standard C libraries". Of course, doing so still requires the pre-processor, as the Creator intended.
jschell wrote:
I am going to take their word for it
Soooo... if Microsoft says that VB is the World's Greatest Language.... ? :suss:
PIEBALDconsult wrote:
A language is defined by its compiler (not the other way around).
No. Compiler theory is a very complete area of study in computer science and most perhaps all successful languages build upon that. And within compiler theory the compiler is an implementation, nothing more. And in terms of C, although perhaps not specifically this discussion, there are many ambiguities which the compiler is allowed to define but others which it is not.
PIEBALDconsult wrote:
I like the C pre-processor; it's really just a text processing utility -- it can be used for purposes other than its primary usage
With something like 20 years of C/C++ experience I am pretty comfortable with what the language is and isn't.
PIEBALDconsult wrote:
and that is quite true,
As I said.
PIEBALDconsult wrote:
Soooo... if Microsoft says that VB is the World's Greatest Language....
Well first I was noting a technical point not a subjective one. Second K&R when it was written was written in a different style than VB, so even if the author(s) of VB made a technical point then I would be less inclined to accept it (which is true of C# and Java as well.)
-
Discuss. I've just read The Unreasonable Effectiveness of C[^] and decided to outsource my ranting response to it
cheers Chris Maunder
-
Your signature has a line about GOTO The goto fail example is a major fail in general for the C language. The goto is the first thing every programmer should avoid, but in this example the GOTO's are used correctly, but its a limitation of the C language (one of the dumbest things in history I might add) Visual basic .net is C with English words and no bracket issue, the GOTO fail would never had been an issue in VB.
You've completely missed my point. My sig should have made it obvious I abhor the use of goto. I merely pointed out a possible reason why
case
may have been specified the way it is. Not that I wouldn't like to bangoto
from the language entirely. And not that I would miss theswitch
statement for that matter (not much anyway). It was just a statement about the consistency of the language as a whole. As for your love of Basic - to each their own. It certainly has it's use for certain kind of applications. Me, I've been working on processing-intensive applications for decades, and no Basic dialect whatsoever, not even the compiled ones, would ever have served the purpose. That said, I'll remove the link from my sig: as you've pointed out, the main reason for the problem isn't so much the use of goto - it is the fact that braces (or other block markers) are only optional after control statements, combined with an unlucky duplicate line of code - that this line contains agoto
command is just happenstance, many other commands would have caused havoc as well. On a sidenote:Colborne_Greg wrote:
Visual basic .net is C with English words and no bracket issue, the GOTO fail would never had been an issue in VB.
Which part of
go to
isn't english? Just wondering...GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]
-
Maybe, but
break
doesn't affect agoto
. And I have never used agoto
in C.You'll never get very far if all you do is follow instructions.
My point was that a series of
case
statements resembles a series ofgoto
jump labels, and therefore there is an expectation for the flow of execution to continue, even past the next 'label'. Thebreak
command isn't associated to thecase
statement, it is associated to theswitch
block.GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
-
My point was that a series of
case
statements resembles a series ofgoto
jump labels, and therefore there is an expectation for the flow of execution to continue, even past the next 'label'. Thebreak
command isn't associated to thecase
statement, it is associated to theswitch
block.GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
Stefan_Lang wrote:
resembles a series goto
Not to me it doesn't.
You'll never get very far if all you do is follow instructions.