<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>El Tramo | Google</title>
  <subtitle>Remko Tronçon's Homepage</subtitle>
  <link href="http://el-tramo.be/blog/tag/google/feed/" rel="self" type="application/rss+xml"/>
  <link href="http://el-tramo.be/"/>
  <updated>2012-05-19T12:29:42+02:00</updated>
  <id>http://el-tramo.be/</id>
  <author>
    <name>Remko Tronçon</name>
    <uri>http://el-tramo.be/about/</uri>
  </author>
  
  <entry>
    <title>:set noexpandtab</title>
    <author>
      <name>Remko Tronçon</name>
      <uri>http://el-tramo.be/about/</uri>
    </author>
    <link href="http://el-tramo.be/blog/set-noexpandtab"/>
    <updated>2008-06-18T00:00:00+02:00</updated>
    <id>http://el-tramo.be/blog/set-noexpandtab</id>
    <content type="html">&lt;p&gt;Google recently published a &lt;a href=&quot;http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml&quot;&gt;C++ style guide&lt;/a&gt;, containing all the rules that Google code adheres to. Many of the style tips are quite sensible, and well accepted by many developers out there. However, I was surprised to find the following rule:&lt;/p&gt;

&lt;blockquote&gt;&lt;span&gt;&lt;strong&gt;Spaces vs. Tabs:&lt;/strong&gt;&lt;em&gt; Use only spaces, and indent 2 spaces at a time.
&lt;span style=&quot;font-style: normal;&quot;&gt;We use spaces for indentation. Do not use tabs in your code. You should set your editor to emit spaces when you hit the tab key.&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/blockquote&gt;


&lt;p&gt;I never really understood why so many people have such a hatred towards tabs. Is it just because they have seen code where some editor has mixed tabs with spaces (which of course results in a horrible mess)? Or do they have valid counter-arguments, even when tabs are used consistently?&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;Why would you force presentation of your code upon someone if you don&amp;rsquo;t need to? If you use tabs, you don&amp;rsquo;t need rules like ‘indent 2 spaces at a time’: I can choose whether I want 2 spaces, 4, or whatever indentation I feel most comfortable with when reading code. &lt;/p&gt;

&lt;p&gt;After some discussion, the pro-space people typically come up with the following piece of code, where they have their parameter names aligned:&lt;/p&gt;

&lt;blockquote&gt;&lt;code&gt;&lt;pre&gt;void SomeClass::someMethodName(int parameterA,
                               unsigned int parameterB,
                               std::string parameterC)
{
    ...
}&lt;/pre&gt;&lt;/code&gt;&lt;/blockquote&gt;


&lt;p&gt;No, you can&amp;rsquo;t do that with tabs, that&amp;rsquo;s true. But why would you do that in the first place (unless you&amp;rsquo;re using an editor which does such annoying auto-formating automatically)? When your method name gets too long, it won&amp;rsquo;t fit on your screen anyway. Why don&amp;rsquo;t you indent 2 tabs for your parameter names instead:&lt;/p&gt;

&lt;blockquote&gt;&lt;code&gt;&lt;pre&gt;void SomeClassWithALongName::someMethodName(
        unsigned int parameterA,
        int parameterB,
        std::string parameterC)
{
    ...
}&lt;/pre&gt;&lt;/code&gt;&lt;/blockquote&gt;


&lt;p&gt;Another popular argument is aligning member declarations:&lt;/p&gt;

&lt;blockquote&gt;&lt;code&gt;
&lt;pre&gt;FooClass foo_;
Bar      bar_;&lt;/pre&gt;&lt;/code&gt;&lt;/blockquote&gt;


&lt;p&gt;Same remark: why would you do this? Does it really make your code more readable? Besides, it doesn&amp;rsquo;t scale: whenever someone comes along and has to add a &lt;code&gt;VeryLongClassName&lt;/code&gt; member, your alignment  will be messed up, and you will have to change every member again.&lt;/p&gt;

&lt;p&gt;My opinion: let the person who reads your code decide how he/she wants to see it, and lay out your code in a way it is flexible to be seen with different view settings. This avoids lengthy discussions about whether tabs should be 2, 3, 4, or 13 spaces wide. Besides, people have been preaching the separation of presentation and content for ages for HTML and CSS, why would this be any different for code?&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Receiving Google Talk files with libjingle</title>
    <author>
      <name>Remko Tronçon</name>
      <uri>http://el-tramo.be/about/</uri>
    </author>
    <link href="http://el-tramo.be/blog/psi-googleft"/>
    <updated>2007-02-04T00:00:00+01:00</updated>
    <id>http://el-tramo.be/blog/psi-googleft</id>
    <content type="html">&lt;p&gt;As Google released a new version of &lt;a href=&quot;http://code.google.com/apis/talk/libjingle&quot;&gt;libjingle&lt;/a&gt; last friday, I decided to experiment with their file transfer implementation in Psi this weekend. I added some code that allows someone to accept files sent by Google Talk, and tested it with a few Google Talk contacts, with a perfect success rate (so far). For the brave who wish to experiment with this, see the instructions below. Note that this code is unofficial, untested, only uses a very rudimentary UI (there is no integration with the existing file transfers), still suffers from at least two bugs (on Mac OS X: one that segfaults when receiving images, and one where CPU skyrockets to 100% after a while, which we had with older libjingles as well), and has no support from the Psi developers whatsoever. Comments should therefore go directly to me.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;To compile Google File Transfer support in Psi, get the latest development version from &lt;a href=&quot;http://el-tramo.be/blog/psi-svn&quot;&gt;Subversion&lt;/a&gt;. First, use a custom configure script to configure Psi:&lt;/p&gt;

&lt;blockquote&gt;&lt;code&gt;./configure-jingle --enable-google-ft&lt;/code&gt;&lt;/blockquote&gt;


&lt;p&gt;(note that you may need to provide a path to expat). &lt;strong&gt;DO NOT&lt;/strong&gt; enable other Jingle features, as both conflict at the moment.&lt;/p&gt;

&lt;p&gt;Next, download and build the new version of libjingle by going into the &lt;code&gt;third-party/libjingle.new&lt;/code&gt; subdir, and executing the following commands:&lt;/p&gt;

&lt;blockquote&gt;&lt;code&gt;make -f Makefile.libjingle
qmake
make&lt;/code&gt;&lt;/blockquote&gt;


&lt;p&gt;Finally, go back to the root dir, and build Psi. After the build has finished, your version of Psi should be able to receive files from Google Talk, putting them in &lt;code&gt;~/googletalk_files&lt;/code&gt; (or &lt;code&gt;~/Desktop/googletalk_files&lt;/code&gt; if you are on Mac OS X).&lt;/p&gt;
</content>
  </entry>
  
</feed>

