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

看板FB_chat作者時間20年前 (2006/04/18 05:07), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串9/45 (看更多)
--nextPart9974750.ZRnEKKlOy4 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 17 April 2006 16:47, John Baldwin wrote: > 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. I perceive the syntax of C++, C# and Java to be very similar. The differenc= es=20 are minor. What about C++ is clunky that isn't also clunky in C# and Java?= =20 One thing that comes to mind is that you can't use >> with nested templates= ,=20 but then that's not one of the most common things a C++ programmer writes=20 anyway. The things that bug me about C++ are mostly semantic in nature (no= =20 uniform access or read-only vars, requiring you to manually create accessor= =20 functions for everything, for example. Or no contracts, but then none of th= e=20 mentioned languages offer that.) > At work I recently described C# generics as "C++ templates that don't > suck" for example. :) But C# templates offer little over the C++ ones (well, ok, there is one thi= ng,=20 template type specification, that's nice), but have severe limitations. Why= =20 do you like them better? > 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 conditio= ns > (i.e. missing an edge case in implementation or design), and those type of > bugs are not something a language is going to solve. Sure, there won't ever be a dwim language. But every mechanism that prevent= s a=20 class of bugs categorically is a step in the right direction, imo (that'd b= e=20 the direction of correctness). I'm aware that C++ isn't much of an=20 improvement over C when it comes to providing such mechanisms. However, it= =20 does make writing code more comfortable (well, if you know it, and like OOP= ),=20 and it is actually shipped with the FreeBSD base system. Cheers Benjamin --nextPart9974750.ZRnEKKlOy4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBERANkgShs4qbRdeQRAj65AJ9M9MoD/vsHUPbQNrnHCN0p5X2++wCfXk9c FniOF3I61jWmEXP96gRBqmI= =w7Y4 -----END PGP SIGNATURE----- --nextPart9974750.ZRnEKKlOy4--
文章代碼(AID): #14H0E900 (FB_chat)
討論串 (同標題文章)
文章代碼(AID): #14H0E900 (FB_chat)