摘要:
我只针对c++码农们讲,其他语言不了解不过应该大同小异。曾几何时翻开21天学通c++系列等脑残入门书,都以匈牙利命名法示人(DWORD dwXXX, int nXXX, string strXXX)。现在我可以负责任的告诉你,把类型名写在前面'''''屁'''''用都没有,对你没看错,就是这么坚决。原因如下:1.现代的编译器早已经可以明显看出任意变量的类型,你把类型写在前面除了增加代码长度外没有任何好处。2.真正的匈牙利命名法,是要标注变量的种类(kind)而不是类型(type)这有很大区别。举例:int door 阅读全文
摘要:
source:http://stackoverflow.com/questions/1434937/namespace-functions-versus-static-methods-on-a-classBy default, use namespaced functions.Classes are to build objects, not to replace namespaces.In Object Oriented codeScott Meyers wrote a whole Item for his Effective C++ book on this topic, "Pr 阅读全文
摘要:
原文地址:http://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS代码下载地址:http://www.codeproject.com/KB/IP/smtp_ssl/CSmtp_v2_1_ssl.zipIntroductionI needed to send emails in a product written in C++, so I searched the Internet and found a great article:SMTP Clientwritten byJakub Piwowarczyk. Howe 阅读全文
摘要:
都是简单的单词,我就不翻译了。原文地址:http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/Let’s say you need to write an XML file with this content:< ?xml version="1.0" encoding="UTF-8"? >< root description="this is a naïve example" >< /root >How do we 阅读全文