Re: Why is not more FreeBSD software written in C++?

看板FB_chat作者時間20年前 (2006/04/17 22:49), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串8/45 (看更多)
On Sunday 16 April 2006 10:50, Benjamin Lutz wrote: > Why did I even ask the question? I perceive correctness as a big problem when > programming in C. It is difficult to know for sure that a C program is > correct, since there are no guards against mistakes like string buffer > overflows, erroneous pointer handling or memory allocation. C++ is of course > far from being a golden bullet, but it does solve some of the problems (using > C++ strings instead of char* generally means you don't have to worry about > string buffer overflows). To be honest, if you want a "safer" language, I'd prefer going from C to C# or Java. C++'s syntax is, quite frankly, clunky in several places. At work I recently described C# generics as "C++ templates that don't suck" for example. :) Also, many of the bugs I either have myself or run into in other people's code come from the programmer not taking into account all of the conditions (i.e. missing an edge case in implementation or design), and those type of bugs are not something a language is going to solve. -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org _______________________________________________ freebsd-chat@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-chat To unsubscribe, send any mail to "freebsd-chat-unsubscribe@freebsd.org"
文章代碼(AID): #14Gwh-00 (FB_chat)
討論串 (同標題文章)
文章代碼(AID): #14Gwh-00 (FB_chat)