Are there reasons for beginner programmers to learn C ?
-
I'm always flabbergasted when I ask basic questions about using an object that implements IDisposable to developers with many years of C# experience and they are completely clueless, let alone the caveats about implementing it correctly. It's even rarer for developers to know about the using statement. I often wonder how their apps don't leak database connections all over the place. I worked with one system that completely threw me for a loop. Every object was created in a using block in a factory method and returned to the caller. Each object was auto generated with a sql connection as a property which was opened in the constructor. Calling dispose closed the connection so it could be returned to the "business logic" layer. :sigh: :doh:
Curvature of the Mind now with 3D
What you are describing there has nothing to do with having C# as a first language... Actually it has nothing to do with programming! It sounds more like these people were baking an apple pie and somehow ended up in an office with a computer where someone mistook them for programmers.
Andy Brummer wrote:
Every object was created in a using block in a factory method and returned to the caller.
I can't imagine how that would've been... Employee: "There's a bug in Visual Studio that throws ObjectDisposedExceptions at random!" Boss: "We better turn off the 'Break when a common language runtime exception is thrown'-option then!" Third person: "Perhaps there really IS something wrong in your software?" Employee: "Hell no! I'm even using the 'using' keyword with some Objects that can, for no appearent reason, be used with it. Microsoft recommends it!" Boss: "Good job, now we should send Microsoft a report on that Visual Studio bug..." Third person: "By the way, I'm out of apples, anyone here has some?" Employee: "Sure, if I can have an ounce of flour." ... :laugh:
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
Language feature should make our lives easier to make portability as transparent as possible. Using standard C++ libraries (streams, collections, algorithms, memory management, ...) ), I can write portable code that runs on major OS without the need to think about it.
Watched code never compiles.
Maximilien wrote:
I can write portable code that runs on major OS without the need to think about it.
If you're writing generic algorithms, of course. Writing a high performance server or something comparable and it's a different situation. The standard C++ libraries make up a miniscule fraction of the code base I'm working on (and some of that is still tricky, such as the differences in UNICODE. A few days ago, I had a small class where the entire class is different between Win32 and Linux. Another class has huge differences between Win32 and CE; I haven't even looked at what the Linux version will be like. :) )
-
PIEBALDconsult wrote:
Not as a first language
How about assembly?
Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile
No, but I had that before I learned C.
-
I somewhat agree, but I would chose those languages only for lower level of education.If it's for college than I am for C all the way. What the heck, C should be in secondary schools as well.
Oshtri Deka wrote:
for lower level of education
Exactly.
Oshtri Deka wrote:
for college than I am for C all the way.
Yes, after they have the fundamentals and before they're released on the world.
-
No, but I had that before I learned C.
PIEBALDconsult wrote:
No, but I had that before I learned C
I guess you learned a thing or two that you still find useful ...
Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile
-
killabyte wrote:
C is very important and a great way to learn exactly how a computer works
That's debatable. I'm taking a class that brings you from NAND gates and D Flip Flops all the way up to the operating system (so far I've built a computer (CPU + RAM) from only NAND and DFFs and an assembler), and I don't see much relation to C. Admittedly it's a better model than a higher level language like C# or Java, but it's still pretty far abstracted.
lewax00 wrote:
That's debatable. I'm taking a class that brings you from NAND gates and D Flip Flops all the way up to the operating system (so far I've built a computer (CPU + RAM) from only NAND and DFFs and an assembler),
I call that an FPGA course. I was more talking about Microcontroller "computers" from the ground up with C. using the chipset data sheet to write a HAL from register addresses etc etc etc.
-
lewax00 wrote:
That's debatable. I'm taking a class that brings you from NAND gates and D Flip Flops all the way up to the operating system (so far I've built a computer (CPU + RAM) from only NAND and DFFs and an assembler),
I call that an FPGA course. I was more talking about Microcontroller "computers" from the ground up with C. using the chipset data sheet to write a HAL from register addresses etc etc etc.
-
Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:
Watched code never compiles.
Life is too short to code in C/C++. Go with C#.
Everything makes sense in someone's mind
-
It may produce a spiritual awaking. C was deliberately written to be unrestricted (to port the Unix O/S). It does what it's told to do, no questions asked. That means you have to pay attention to what you're doing. That is a good habit to learn. I'd even go so far as to suggest you dabble with the in-line assembler.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010
I have found that that you have to pay attention to what you do in any language, otherwise you get into spagetti. It is understanding the concepts of OOD, events, design patterns, architecture that is difficult because you have to wrap your mind arround them. Basic programming should be a one semester course, and then move on to real issues in application programming.
-
Well, I don't care (one example of many) how std::string internally manages the string, I just want to do
std::string s("hello world");
. it is safe, it is efficient.Watched code never compiles.
Maximilien wrote:
it is efficient.
std::string
is not efficient if you're not using it properly and according how it manages string internally,Maximilien wrote:
it is safe
and
std::shared_ptr
is not safe if you're using it incorrectly (circular references). So if you really want safe and efficient code you need to know how those high-level concept works on a low-level. -
Life is too short to code in C/C++. Go with C#.
Everything makes sense in someone's mind
And life is too short to use application written in C#.
-
Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:
Watched code never compiles.
In my opinion, a lot of people really need to better understand how to use correctly C++ in an object-oriented way. When people first learn C, then often only use C++ as a better C... In my opinion, if someone learn C++ and also read Meyers book, he will know the essential. The main advantage of knowing C might be for some embedded development where C++ compiler are not available.
Philippe Mori
-
Language feature should make our lives easier to make portability as transparent as possible. Using standard C++ libraries (streams, collections, algorithms, memory management, ...) ), I can write portable code that runs on major OS without the need to think about it.
Watched code never compiles.
-
Maximilien wrote:
I can write portable code that runs on major OS without the need to think about it.
If you're writing generic algorithms, of course. Writing a high performance server or something comparable and it's a different situation. The standard C++ libraries make up a miniscule fraction of the code base I'm working on (and some of that is still tricky, such as the differences in UNICODE. A few days ago, I had a small class where the entire class is different between Win32 and Linux. Another class has huge differences between Win32 and CE; I haven't even looked at what the Linux version will be like. :) )
-
Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:
Watched code never compiles.
I started with VB5 in grade8. Then study C++, Assembly, Java in University. And Start my first work with RPG4, CL and LANSA. But Now I'm working on VB.NET Even if I'm not a good programmer. For me Programming Language is just a tool. I think which language to start doesn't matter.
-
Not as a first language. Nor should an OOP-only language (VB, C#, etc.) be the first language. In my opinion BASIC and Pascal (and maybe Perl?) are still good first languages even though they won't apply very well to modern business. Professional developers still to be smacked with C.
When I first started out, I did learn Pascal. Then moved onto C. Then Perl. Then C++. Start off with Perl? No because there are those strange UNIX syntax. To keep it clean, Pascal but yes I don't think it has much real use in business. Start off with C? I think that is ok.
-
Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:
Watched code never compiles.
Yes - C is simpler and a much smaller language than C++. C is great for learning about functions, pointers, memory management and calling operating system libraries. C is a beautiful language that allows you to program efficient algorithms. You can learn about how different data types are stored and represented in memory. C will give you the power to implement classic computer science structures and algorithms: arrays, trees, sorting and linked lists. If you 'get' C, you will know that you have what it takes to be a real programmer. C will give you small, lightweight and fast executables. With C, you will have a very good foundation that will complement what you learn with other higher level languages; and the lower level assembly language. Once you know C, it will stand apart from all other languages that you learn.
-
Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:
Watched code never compiles.
If the idea of a high-level programming language is to hide hardware details from the programmer, there should never have been any commands associated with memory management in the language.
-
Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:
Watched code never compiles.
There are two questions here: (1) The title of the thread "
Quote:
Are there reasons for beginner programmers to learn C
" (2) The first line of the question: "
Quote:
Are there reasons for beginner programmers to be taught C instead of C++?
" There is a difference. Now, if you were wanting to learn about programming, I would not recommend C as a starting point. However if you were being taught programming as part of, say, a course in microprocessor systems engineering then C and assembler would be highly appropriate.
-
Are there reasons for beginner programmers to be taught C instead of C++? I'm not even thinking about Object Oriented programming, but simple declarative programming. I'm reading a lot of questions on CodeProject and on StackOverflow where people ask about issues with C language features that are so prone to errors and defect that it makes me cringe. A lot of those issues could be handled by simple C++ features (memory management (new/delete, smart pointers), strings, collections, references, ... ) I know there are lot of legacy code out there and it should still be maintained, but old code "ways" should not be the emphasis of the education. :confused:
Watched code never compiles.
I think learning C (and maybe also assembler) is a very good way to understand what really happens. Personally, I find it quite painful to program in these languages, as I prefer a higher order of thinking that does not distract me from doing algorithms and a good software design. But to understand what really happens and why XY now behaves just the way it does, I find it very useful that I have learned ANSI C and i386 Assembler.