<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-17885055.post8416455013608697521..comments</id><updated>2009-03-03T15:51:45.090+01:00</updated><title type='text'>Comments on The Julipedia: Blog: Debug messages without using the C++ preprocessor</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.julipedia.org/feeds/8416455013608697521/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17885055/8416455013608697521/comments/default'/><link rel='alternate' type='text/html' href='http://blog.julipedia.org/2009/03/debug-messages-without-using-c.html'/><author><name>Julio Merino</name><uri>http://www.blogger.com/profile/08233346614736256024</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-17885055.post-6302887610167729642</id><published>2009-03-03T15:51:00.000+01:00</published><updated>2009-03-03T15:51:00.000+01:00</updated><title type='text'>C'mon... it's _not_ that bad...#if __LP64__# defin...</title><content type='html'>C'mon... it's _not_ that bad...&lt;BR/&gt;&lt;BR/&gt;#if __LP64__&lt;BR/&gt;# define t_address_FMT "0x%016lx"&lt;BR/&gt;#else&lt;BR/&gt;# define t_address_FMT "0x%016llx"&lt;BR/&gt;#endif&lt;BR/&gt;&lt;BR/&gt;#define FMT(t) t##_FMT&lt;BR/&gt;&lt;BR/&gt;fprintf(wherever, "blabla "FMT(t_address)" bleble\n", address);&lt;BR/&gt;&lt;BR/&gt;*Faster* and *explicit*.&lt;BR/&gt;&lt;BR/&gt;OO is not the way to go for _everything_...&lt;BR/&gt;&lt;BR/&gt;apa!&lt;BR/&gt;&lt;BR/&gt;PS: just waiting for C++0x to be official and have type safety on typedefs :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17885055/8416455013608697521/comments/default/6302887610167729642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17885055/8416455013608697521/comments/default/6302887610167729642'/><link rel='alternate' type='text/html' href='http://blog.julipedia.org/2009/03/debug-messages-without-using-c.html?showComment=1236091860000#c6302887610167729642' title=''/><author><name>Lluis</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.julipedia.org/2009/03/debug-messages-without-using-c.html' ref='tag:blogger.com,1999:blog-17885055.post-8416455013608697521' source='http://www.blogger.com/feeds/17885055/posts/default/8416455013608697521' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-17885055.post-9192772519592150959</id><published>2009-03-03T08:48:00.000+01:00</published><updated>2009-03-03T08:48:00.000+01:00</updated><title type='text'>iostreams may not be as efficient as printf, but f...</title><content type='html'>iostreams may not be as efficient as printf, but for debugging code, it does not matter; it's gonna be slow anyway.&lt;BR/&gt;&lt;BR/&gt;About internationalization, that's a good point that I hadn't thought about!  But then you can use formatting strings embedded in streams.  Take a look at Boost.Format.&lt;BR/&gt;&lt;BR/&gt;At last, about type safety, that's true, but things get very ugly when you start using custom types (aka typedefs).  Then you need to define ugly macros to embed in the format strings such as printf("blah %" FORMAT_FOR_FOO " rest of the string", a_foo);...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17885055/8416455013608697521/comments/default/9192772519592150959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17885055/8416455013608697521/comments/default/9192772519592150959'/><link rel='alternate' type='text/html' href='http://blog.julipedia.org/2009/03/debug-messages-without-using-c.html?showComment=1236066480000#c9192772519592150959' title=''/><author><name>Julio M. Merino Vidal</name><uri>http://www.blogger.com/profile/08233346614736256024</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11711662837553049744'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.julipedia.org/2009/03/debug-messages-without-using-c.html' ref='tag:blogger.com,1999:blog-17885055.post-8416455013608697521' source='http://www.blogger.com/feeds/17885055/posts/default/8416455013608697521' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-17885055.post-2311390670937473416</id><published>2009-03-03T07:30:00.000+01:00</published><updated>2009-03-03T07:30:00.000+01:00</updated><title type='text'>&gt;this is C++, so you should be using iostreamsthis...</title><content type='html'>&amp;gt;this is C++, so you should be using iostreams&lt;BR/&gt;&lt;BR/&gt;this is joke, yes?&lt;BR/&gt;&lt;BR/&gt;iostream is very not efficient in compare to printf,&lt;BR/&gt;but even if don&amp;#39;t care how fast is your program or output doesn&amp;#39;t put big value to all time there is problem of internalization.&lt;BR/&gt;&lt;BR/&gt;cout &amp;lt;&amp;lt; &amp;quot;My name is &amp;quot; &amp;lt;&amp;lt; name &amp;lt;&amp;lt; endl;&lt;BR/&gt;&lt;BR/&gt;in different languages order of words is different, so you have to change all such code if you want add support of another language.&lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt;in compare &lt;BR/&gt;printf(i18n(&amp;quot;My name is %s\n&amp;quot;), name);&lt;BR/&gt;&lt;BR/&gt;you need change in one place in i18n function.&lt;BR/&gt;&lt;BR/&gt;yeah, and about type safety,&lt;BR/&gt;&lt;BR/&gt;gcc warn about types and format string mismatch, if you use another compiler you can use lint or something similar.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17885055/8416455013608697521/comments/default/2311390670937473416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17885055/8416455013608697521/comments/default/2311390670937473416'/><link rel='alternate' type='text/html' href='http://blog.julipedia.org/2009/03/debug-messages-without-using-c.html?showComment=1236061800000#c2311390670937473416' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.julipedia.org/2009/03/debug-messages-without-using-c.html' ref='tag:blogger.com,1999:blog-17885055.post-8416455013608697521' source='http://www.blogger.com/feeds/17885055/posts/default/8416455013608697521' type='text/html'/></entry></feed>