Linked by Thom Holwerda on Tue 12th Oct 2010 21:52 UTC
Java "Oracle and IBM today announced that the companies will collaborate to allow developers and customers to build and innovate based on existing Java investments and the OpenJDK reference implementation. Specifically, the companies will collaborate in the OpenJDK community to develop the leading open source Java environment."
Thread beginning with comment 444923
To view parent comment, click here.
To read all comments associated with this story, please click here.
drstorm
Member since:
2009-04-24

If you are constantly having problems with buffer overflows and dangling pointers, then maybe you should go back to college.

Who said that I had problems with my C code? We are talking about the mainstream here, and the majority of people who write code do have these problems.

Besides, many people who do know about these problems and generally write quality code occasionally make these errors and the reason is simple: Do something enough times and you'll make a mistake eventually. Why should we do something manually if it can be done automatically?

I've written huge amounts of C code - stacks, queues, linked lists, concurrent hash tables, multithreaded network servers that can handle 1000s of concurrent connections, using I/O multiplexing (poll, kqueue, epoll, etc). I've also written a fair amount of string/text parsing code, e.g. HTTP parser, and I didn't really have any major issues with buffer overflows or dangling pointers.

Well, good for you... and bad for you! While it is great that you know C inside and out, from what you've said it is likely that C is the only language you know so well. Don't get me wrong, C is a great language, but you seem to think that one size fits all.

Also, you said that you did not experience any major pointer problems, but if you used a managed language, you wouldn't have any problems at all.

When someone says C is insecure, or results in buggy code, it is usually the case of an incompetent programmer who blames his tools.

Either that or they are talking about the statistics and not about any specific person.

If you think it's impossible to write reusable software in C, using object-oriented interfaces, then get a book by Eric S. Roberts "Programming Abstractions in C", you may learn a great deal from it.

I never said it was impossible. I am saying, however, that it is impractical. That's why we have C++. I will check the book out, though.


Personally, I prefer C to C++, because IMO C++ has a rather cumbersome syntax, but if I wanted OOP, C++ would be the logical choice for me.

Your post mostly implies that I am incompetent, while you are the experienced expert. I take my part of the blame for that, because I made it personal in the first place, and I am sorry for that. However, I still disagree with you.

Please, defend your position and convince me that I should use C for OOP instead of C++ with some solid arguments.

Edited 2010-10-13 17:30 UTC

Reply Parent Score: 4

Neolander Member since:
2010-03-08

Besides, many people who do know about these problems and generally write quality code occasionally make these errors and the reason is simple: Do something enough times and you'll make a mistake eventually. Why should we do something manually if it can be done automatically?
(...)
Also, you said that you did not experience any major pointer problems, but if you used a managed language, you wouldn't have any problems at all.

Ever heard of memory debugging tools like Valgrind ? Using them in testing is just as safe as using an interpreted language, but you don't need to perform slow checks *every time* a program is run.

Removing errors is part of the debugging phase. Doing it once the program is fully cleaned up is just unnecessary. If bugs go past the debugging phase, it's the debugging phase that is faulty for not stress-testing all aspects of the product.

Reply Parent Score: 3

RshPL Member since:
2009-03-13


Ever heard of memory debugging tools like Valgrind ? Using them in testing is just as safe as using an interpreted language, but you don't need to perform slow checks *every time* a program is run.

Valgrind is cool, even VERY cool but unfortunately it is not a solution to every memory problem. The reason for that is that valgrind works only for heap allocated memory and everything on stack or any static memory accesses won't be checked. Usually when I have very weird undebuggable memory problems I have to change my stack data to be dynamically allocated .. sometimes it reveals stuff .. but still it is a great inconvenience. Managed languages may have an advantage in this but still C/C++ rock. ;)

Reply Parent Score: 1

rom508 Member since:
2007-04-20

Please, defend your position and convince me that I should use C for OOP instead of C++ with some solid arguments.


You misunderstand me, I'm not trying to convince anyone to use C. You can use whatever you're happy with. My original point was about Java and how it's perceived to be the only viable solution in the area where it's deployed, when in fact you could use plain old C and achieve much better performance with smaller memory footprint.

Reply Parent Score: 1

RshPL Member since:
2009-03-13

Era of hackers has ended. Now is an era of sunday programmers and web developers ... You think those can do quality C? ;)
The most common misconception is that the market needs more programmers - nothing could be more wrong ... it's the bad programmers themselves that create the need for more programmers .. an endless loop of bugs, incompetence and shitty design.

Reply Parent Score: 2

drstorm Member since:
2009-04-24

Well, I guess most people couldn't use C with the same productivity, but, yeah, it could be done.

Once again, I apologize for jumping to conclusions, because the whole thing might be misunderstanding on my part. I am not 100% sure, because it's 3am over here. ;)

Anyhow, there are plenty of more suitable Java alternatives for web dev. C# comes to mind, for example. C wouldn't be high on my list of alternatives. Just because it can be done, does not mean it should be done.

I withdraw from this conversation and I hope that, ranting aside, I made some valid points...

Thanks for taking the time to respond. ;)

Reply Parent Score: 2