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 444914
To view parent comment, click here.
To read all comments associated with this story, please click here.
rom508
Member since:
2007-04-20

Besides, that OO-C thing is just the bit that caught my eye. When someone claims that C is the way to go for web development, I naturally assume that they don't have a clue. Call it a prejudice, but I'm rarely wrong.

In the world where web apps are barely secure even though they are written in high level languages like Java, the last thing we need it to return to buffer overflows, dangling pointers, etc.


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

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.

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

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.

Edited 2010-10-13 15:06 UTC

Reply Parent Score: 2

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

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