<?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/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5582998384986440698</id><updated>2024-10-08T23:28:06.184-03:00</updated><title type='text'>Programação</title><subtitle type='html'>Todos os artigos aqui existentes são de autoria de Luciano G. Moreira e o autor não permite o uso dos textos nem inteiros nem em partes sem sua prévia autorização por escrito. Os comentários deixados são de inteira responsabilidade do autor do comentário.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-8824665150427394738</id><published>2014-01-07T14:26:00.000-02:00</published><updated>2014-01-07T14:26:00.435-02:00</updated><title type='text'>Mais sobre Qualidade (sistemas de)</title><content type='html'>Sou eu que estou fora de contexto e errado ou estou vendo algo que faz sentido?&lt;br /&gt;
&lt;br /&gt;
Muita gente, talvez até a maioria aqui no Brasil, vê os sistemas de gestão de qualidade como um fim em si mesmos e não como meios para se obter software de qualidade.&lt;br /&gt;
&lt;br /&gt;
Não deixo de me surpreender com este foco que vejo sendo dado para sistemas de gestão de qualidade tanto em empresas quanto em publicações da área. Parece que pouquíssimos veem estes sistemas como técnicas para obter de forma (mais ou menos) consistente um software com baixos índices de erros, e com custo e prazo aceitáveis, que são as dimensões básicas de qualidade.&lt;br /&gt;
&lt;br /&gt;
Eu vejo os sistemas de qualidade por esta ótica, de ferramenta e não de fim em si. Será que estou errado?</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/8824665150427394738/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2014/01/mais-sobre-qualidade-sistemas-de.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/8824665150427394738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/8824665150427394738'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2014/01/mais-sobre-qualidade-sistemas-de.html' title='Mais sobre Qualidade (sistemas de)'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-4190807618610591843</id><published>2013-12-04T14:25:00.002-02:00</published><updated>2013-12-04T14:25:14.971-02:00</updated><title type='text'>Factory / Código sem utilidade</title><content type='html'>Recentemente, em um treinamento sobre &lt;i&gt;design patterns&lt;/i&gt;, após apresentar o&amp;nbsp; &lt;i&gt;factory method&lt;/i&gt;,  pedi ao pessoal que fizesse um programa que, usando uma hierarquia de classes pré-existente que definia uma abstração para envio de arquivos, perguntasse ao usuário qual tipo de envio ele queria usar (entre FTP ou SMB) e enviasse um arquivo fictício usando o objeto de envio correto.&lt;br /&gt;
&lt;br /&gt;
Para clarear a coisas, a abstração de envio e a hierarquia de classes correspondente era algo do tipo:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;class FileSender&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; virtual sendFile(string filename, string destination) = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;class FTPFileSender: public FileSender&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; sendFile(string filename, string destination) {...}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;class SMBFileSender: public FileSender&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; sendFile(string filename, string destination) {...}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Claro, a ideia era que usassem um &lt;i&gt;factory method&lt;/i&gt; para a criação dos objetos. E todos acertaram esta parte. Todos implementaram um método FileSender::create, estático que fazia algum &lt;i&gt;return new&lt;/i&gt;, criando objetos das classes filhas FTPFileSender ou SMBFileSender e retornando um FileSender* apontando para o objeto criado.&lt;br /&gt;
&lt;br /&gt;
Até aqui 100%. O problema é que a maioria fez o seguinte:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;typedef enum {FTP, SMB} FileSenderType;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;FileSender::create(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;FileSenderType&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; type)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; switch(type)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case FTP:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new FTPFileSender;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; case SMB:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new SMBFileSender;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; default:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Log error and abort.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;void main()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; cout &amp;lt;&amp;lt; &quot;SMB ou FTP?&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;FileSenderType myType;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; // Alguma lógica para ler resposta do usuário e guardar em &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;myType&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; FileSender* fileSender = FileSender::create(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;myType);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; fileSender-&amp;gt;send(.....);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Você faria exatamente do mesmo jeito?&lt;br /&gt;
&lt;br /&gt;
Ah, então me acompanhe...&lt;br /&gt;
&lt;br /&gt;
Me descreva o que a &quot;&lt;i&gt;factory&lt;/i&gt;&quot; está fazendo e o que ela está poupando de trabalho para seu usuário (a main, no caso). Com um pouco de cuidado você vai concluir que ela&amp;nbsp; não poupa trabalho nenhum da main. Na verdade, a &lt;i&gt;factory&lt;/i&gt; não está fazendo NADA. Ela é código inútil, pois não engloba nenhuma abstração, não poupa nenhum trabalho da camada acima. Pense o que aconteceria se você colocasse os &lt;i&gt;news&lt;/i&gt; direto na main; haveria alguma desvantagem? Obviamente não. Por isso a &quot;&lt;i&gt;factory&lt;/i&gt;&quot; acima implementada não serve para nada.&lt;br /&gt;
&lt;br /&gt;
Não está convencido? Então imagine que agora queremos adicionar a possibilidade de envio de arquivos por SSH. Isto será feito criando uma nova classe SSHFileSender. Mas, com esta adição, vamos ter de mexer na main (código usuário), certo? Pois é. Agora imagine um caso mais real... Em vez de um ponto só de uso, um programa real pode ter muitos pontos de uso espalhados. E, para adicionar uma funcionalidade específica de FileSenders, vamos ter de sair procurando pelo código inteiro... Ruim, não? Pois é. E pensar que o &lt;i&gt;pattern&lt;/i&gt; &lt;i&gt;factory&lt;/i&gt; foi criado justamente para evitar isto...&lt;br /&gt;
&lt;br /&gt;
Dá para melhorar? Dá sim. Vamos atentar para o fato de que a &quot;&lt;i&gt;factory&lt;/i&gt;&quot; implementada não faz nada e é código inútil. Vamos tentar dar alguma utilidade para esta nossa FileSender::create(). Que tal se ela se responsabilizasse por perguntar ao usuário qual FileSender usar? Ou seja, colocar dentro dela o código que o pessoal colocou na main:&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;FileSender::create(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; typedef enum {FTP, SMB} FileSenderType;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; cout &amp;lt;&amp;lt; &quot;SMB ou FTP?&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;FileSenderType chosenType;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; // Alguma lógica para ler resposta do usuário e guardar em &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;chosenType&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;...&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; switch(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;chosenType&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case FTP:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new FTPFileSender;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; case SMB:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new SMBFileSender;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; default:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Log error and abort.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;void main()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; FileSender* fileSender = FileSender::create(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; fileSender-&amp;gt;send(.....);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Você consegue ver que implementando desta forma a factory se tornou realmente útil? Você consegue ver que, agora, para adicionar um novo tipo de FileSender, eu só preciso mexer em entidades que estão dentro da hierarquia de classes FileSender? Você consegue perceber a vantagem disto?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bom, por hoje era isto.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/4190807618610591843/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2013/12/factory-codigo-sem-utilidade.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/4190807618610591843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/4190807618610591843'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2013/12/factory-codigo-sem-utilidade.html' title='Factory / Código sem utilidade'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-2229204623931728858</id><published>2013-12-04T14:19:00.004-02:00</published><updated>2013-12-04T14:20:34.002-02:00</updated><title type='text'>Período sem publicações</title><content type='html'>Há um longo tempo desde minha última publicação neste blog.&lt;br /&gt;
&lt;br /&gt;
A questão é que eu estive envolvido em muitos assuntos nos últimos tempos, sobrando pouco tempo para conseguir elaborar posts com qualidade.&lt;br /&gt;
&lt;br /&gt;
Entre estes diversos assuntos, um é muito especial e tão querido que dispendo todos meus momentos livres cuidando dele. E isto é muito mais divertido do que escrever sobre programação: Meu filhão João Paulo, que está com 2 anos. &lt;br /&gt;
&lt;br /&gt;
Mas ontem terminei um artigo que iniciei há tempos e vou publicá-lo daqui a pouco. Fiquei feliz de ver que, mesmo sem postar novos artigos, o blog continua sendo bastante acessado.</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/2229204623931728858/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2013/12/periodo-sem-publicacoes.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/2229204623931728858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/2229204623931728858'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2013/12/periodo-sem-publicacoes.html' title='Período sem publicações'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-7898007222743326927</id><published>2012-05-16T15:14:00.001-03:00</published><updated>2022-10-27T17:52:44.853-03:00</updated><title type='text'>Árvore de fontes</title><content type='html'>Neste post vou falar como eu costumo organizar os arquivos-fonte de meus projetos. A divisão que eu uso obviamente não é a única adequada e nem a melhor, mas tem funcionado relativamente bem. As características que foram buscadas nesta formatação são:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Facilidade de localização do material.&lt;/li&gt;
&lt;li&gt;Formato estruturado e hierárquico.&lt;/li&gt;
&lt;li&gt;Manter todo o material de entrada necessário para o trabalho versionado e &lt;i&gt;baixável &lt;/i&gt;com um comando único.&lt;/li&gt;
&lt;li&gt;Possibilidade de usar integração contínua e builds CRISP.&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp;Vamos então à estrutura.&lt;br /&gt;
&lt;br /&gt;
project-x&lt;br /&gt;
├── code&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; ├── build&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; ├── output (não guardado no sistema de versionamento)&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; ├── internalDocs&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; └── TestPlans&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; ├── skels&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; ├── thirdparty&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; ├── bin&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; ├── dll&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; ├── include&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; └── lib&lt;br /&gt;
│&amp;nbsp;&amp;nbsp; └── userDeliverables&lt;br /&gt;
│&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ├── part1&lt;br /&gt;
│&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ├── part2&lt;br /&gt;
│&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ├── installers&lt;br /&gt;
│&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; └── userDocs&lt;br /&gt;
├── continuous-integration&lt;br /&gt;
└── thirdparty-originals&lt;br /&gt;
&lt;br /&gt;
No primeiro nível, temos a divisão em &lt;b&gt;code&lt;/b&gt;, &lt;b&gt;continuous-integration&lt;/b&gt; e &lt;b&gt;thirdparty-originals&lt;/b&gt;. Code vai conter o grosso do trabalho, e será descrito por último. &lt;br /&gt;
&lt;br /&gt;
Em &lt;b&gt;thirdparty-originals&lt;/b&gt;,&amp;nbsp; coloco todos os arquivos de peças de software de terceiros que serão usados no projeto. Importante: eu os coloco do jeito que eles vêm do terceiro, sem nenhum processamento. Todo o processamento que estes arquivos requeiram eu faço através de scripts para garantir a repetibilidade do processo e facilitar no caso de upgrade de uma peça. Os scripts de processamento criados para isto vão ficar em um lugar abaixo do dir &lt;b&gt;code&lt;/b&gt;, que será descrito mais para a frente.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Em &lt;b&gt;continuous-integration&lt;/b&gt;, coloco os arquivos usados para fazer integração contínua do projeto. Por exemplo, se vai ser usado cruise-control, aqui ficarão um cruise-control-config.xml e um delegating.xml. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
O diretório &lt;b&gt;code&lt;/b&gt; está organizado do modo abaixo descrito:&lt;br /&gt;
&lt;br /&gt;
No diretório &lt;b&gt;build&lt;/b&gt;, coloco os scripts de build que permitem buildar o sistema em linha de comando. Sempre procuro ter um script que permita, rodando um único comando, gerar o pacote pronto para envio para clientes. Gosto que este script crie um sub-dir chamado output e coloque seus produtos ali. Notem que este script de build master deve gerar inclusive a documentação de produto e empacotá-la do jeito necessário para a entrega (zip contendo os documentos e o instalador, por exemplo).&lt;br /&gt;
&lt;br /&gt;
No diretório&amp;nbsp; &lt;b&gt;internalDocs&lt;/b&gt; coloco a documentação de projeto. Por exemplo, diagramas de projeto, instruções de trabalho para programadores, user stories, planos de teste, etc. Vou usando sub-dirs para agrupar coisas relacionadas. Por exemplo, se tenho mais de um plano de teste, crio um sub-dir chamado testPlans, se tenho vários arquivos de user stories, crio um chamado userStories.&lt;br /&gt;
&lt;br /&gt;
Em &lt;b&gt;skels&lt;/b&gt;, coloco os arquivos de esqueleto que serão usados no projeto. É interessante que a maioria das pessoas que conheço guardam os esqueletos no armário (ok, normalmente é na pasta da qualidade ou no diretório de políticas da empresa) e não junto de onde eles são usados e, guardando no armário, não dão oportunidade de customização por projeto e muita gente acaba não usando-os por estarem longe. Eu gosto de meus esqueletos evoluindo, versionados e sempre à mão para serem usados de modo efetivo. A propósito, esqueletos são aqueles arquivos modelo que ajudam a ter uma homogeneidade visual no código e também ajudam a gente a se lembrar de detalhes como esconder o copy ctor de classes. Se você quer uns exemplos de esqueletos, de uma olhada &lt;a href=&quot;http://www.lgmoreira.com/&quot; target=&quot;_blank&quot;&gt;aqui&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
Em &lt;b&gt;thirdparty&lt;/b&gt; ficam os arquivos de peças de software de terceiros, cujos originais estão em thirdparty-originals, no formato em que eles precisam estar para serem usados no projeto. Aqui ficam também os scripts necessários para transformar o que temos em thirdparty-originals para o formato necessário. Um exemplo disto é uma biblioteca de terceiros. Digamos, por exemplo, que eu use a OpenSSL em Windows. O targz dos fontes dela estaria em thirdparty-originals e um script chamado buildOpenSSL, guardado em thirdparty compilaria as libs e as copiaria para thirdparty/dll e os includes públicos para thirdparty/include.&lt;br /&gt;
&lt;br /&gt;
Em &lt;b&gt;UserDeliverables&lt;/b&gt; coloco os fontes das várias partes do projeto (ou da única parte, se for o caso) e também a documentação de produto (manual do usuário, readme, history, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/7898007222743326927/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2012/05/arvore-de-fontes.html#comment-form' title='3 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/7898007222743326927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/7898007222743326927'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2012/05/arvore-de-fontes.html' title='Árvore de fontes'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-4435455511643871159</id><published>2012-04-26T14:55:00.000-03:00</published><updated>2012-04-26T14:55:00.801-03:00</updated><title type='text'>Esqueletos</title><content type='html'>Eu gosto de usar esqueletos, ou seja, aqueles arquivos de modelo. Eles me ajudam a lembrar de coisas que normalmente precisamos e também deixam o código com uma cara homogênea.&lt;br /&gt;
&lt;br /&gt;
Mas eu não gosto de esqueletos mortos, daqueles que estão estáticos e não podem ser mudados, ou que são iguais para todos os projetos. Gosto de esqueletos vivos, que evoluem, sendo customizados para cada projeto conforme vão sendo usados e gosto também que eles estejam versionados no sistema de versionamento DO PROJETO EM QUESTÃO.&lt;br /&gt;
&lt;br /&gt;
Costumo usar os seguintes esqueletos:&lt;br /&gt;
&lt;br /&gt;
header:&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;//*****************************************************************************&lt;br /&gt;// Version/Revision log :&lt;br /&gt;// ====================&lt;br /&gt;//$Log: $&lt;br /&gt;//&lt;br /&gt;//*****************************************************************************&lt;br /&gt;&lt;br /&gt;#ifndef TODO_NAME_H_INCLUDED&lt;br /&gt;#define TODO_NAME_H_INCLUDED&lt;br /&gt;&lt;br /&gt;//################################# Includes ##################################&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//################################## Types ####################################&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//################################ Constants ##################################&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//############################## Public Variables #############################&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//############################# ForwardDeclarations ###########################&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//################################# Classes ###################################&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//####################### Public Function Declarations ########################&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#endif // TODO_NAME_H_INCLUDED&lt;br /&gt;&lt;br /&gt;//*************************&amp;nbsp;&amp;nbsp;&amp;nbsp; E n d&amp;nbsp;&amp;nbsp; F i l e&amp;nbsp;&amp;nbsp;&amp;nbsp; ***************************** &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cpp:&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//*****************************************************************************&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// Version/Revision log :&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// ====================&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//$Log: $&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//*****************************************************************************&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//################################# Includes ##################################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#include &quot;TODO_NAME.h&quot;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//################################## Types ####################################
&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//######################### Private Classes Declaration&amp;nbsp; ######################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//################################ Constants ##################################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//############################# Private Variables #############################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//############################## Public Variables #############################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//############################# Private Functions #############################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//###################### Private Classes Implementation #######################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//###################### Public Classes Implementation ########################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//##################### Public Functions Implementation #######################&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//-------------------------------------------------&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// Unit tests&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//-------------------------------------------------&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#ifdef UNIT_TESTS&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#include &amp;lt;assert.h&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;using namespace std;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int main ()&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; &quot;Unit Testing for TODO_NAME class&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Logger::logTostdout();&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; &quot;Testing TODO&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; assert(!&quot;No UNITTESTS implemented yet!&quot;);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; &quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Tests finished with no errors&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#endif&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//*************************&amp;nbsp;&amp;nbsp;&amp;nbsp; E n d&amp;nbsp;&amp;nbsp; F i l e&amp;nbsp;&amp;nbsp;&amp;nbsp; *****************************&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
declaração de classe:&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//=============================================================================&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// Class: TODO_NAME&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// Remarks: TODO&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//=============================================================================&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;class TODO_NAME&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;public:&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TODO_NAME() {}&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~TODO_NAME() {}&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;private:&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TODO_NAME(const TODO_NAME&amp;amp; x);&amp;nbsp;&amp;nbsp;&amp;nbsp; // Hide copy ctor to avoid implicit calling&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TODO_NAME&amp;amp; operator=(const TODO_NAME&amp;amp; x);&amp;nbsp;&amp;nbsp;&amp;nbsp; // Hide = operator to avoid implicit calling&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}; // End of class TODO_NAME&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Implementação de clase:&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//=============================================================================&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// Class: TODO_NAME&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//=============================================================================&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//-----------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// Method: TODO&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;// Remarks: TODO&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//-----------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;void TODO_NAME::TODO(TODO)&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //TODO&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
Makefile:&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#*****************************************************************************&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;# Version/Revision log :&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;# ====================&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#$Log: $&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#*****************************************************************************&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;all:&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;TODO: Implement all target to build your items in the current dir&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;clean:&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;TODO: Implement clean target that undoes what all does...&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;install:&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;TODO: Implement install target that installs the itens created by all to the correct places.&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;uninstall:&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;TODO: Implement clean target that undoes EVERYTHING that install does...&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;.PHONY: all clean install uninstall&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/4435455511643871159/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2012/04/esqueletos.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/4435455511643871159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/4435455511643871159'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2012/04/esqueletos.html' title='Esqueletos'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-7469544924389854698</id><published>2012-04-05T13:35:00.002-03:00</published><updated>2012-04-05T13:35:39.082-03:00</updated><title type='text'>Uso robusto do default em switches</title><content type='html'>Noto uma grande tendência a usarem o &lt;i&gt;default&lt;/i&gt; do &lt;i&gt;switch&lt;/i&gt; para economizar digitação.&lt;br /&gt;
&lt;br /&gt;
Por exemplo:&lt;br /&gt;
&lt;br /&gt;
O cara tem 8 possíveis valores e tem de fazer o mesmo processamento para 6 deles; então coloca 2 &lt;i&gt;cases&lt;/i&gt; e cobre os 6 comuns com um &lt;i&gt;default.&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
enum {V1, V2, V3, V4, V5, V6, V7, V8} v;&lt;br /&gt;
... &lt;br /&gt;
&lt;br /&gt;
switch (v)&lt;br /&gt;
{&lt;br /&gt;
case V1:&lt;br /&gt;
&amp;nbsp; processV1(); &lt;br /&gt;
case V2:&lt;br /&gt;
&amp;nbsp; processV2(); &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
default:&lt;br /&gt;
&amp;nbsp; process3to8();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Funciona no dia em que é implementado. Mas é um pesadelo para 
manutenção. No dia que alguém incluir novos valores na enumeração, o 
novo valor vai ser &quot;automagicamente&quot; considerado como devendo ter o 
mesmo comportamento que o V3 a V8 tinham. O que pode estar errado. Coisas que acontecem automagicamente não são boas em programação. Por isso é uma boa prática se colocar os valores explicitamente e usar o default para logar erro indicando um valor inesperado (e, de preferência, abortar o programa imediatamente):&lt;br /&gt;
&lt;br /&gt;
enum {V1, V2, V3, V4, V5, V6, V7, V8} v;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
switch (v)&lt;br /&gt;
{&lt;br /&gt;
case V1:&lt;br /&gt;
&amp;nbsp; processV1(); &lt;br /&gt;
&lt;br /&gt;
case V2:&lt;br /&gt;
&amp;nbsp; processV2(); &lt;br /&gt;
&lt;br /&gt;
case V3:&lt;br /&gt;
case V4:&lt;br /&gt;
case V5:&lt;br /&gt;
case V6:&lt;br /&gt;
case V7:&lt;br /&gt;
case V8:&lt;br /&gt;
&amp;nbsp; process3to8(); &lt;br /&gt;
default:&lt;br /&gt;
&amp;nbsp; /* Logar uma mensagem indicando que um valor inesperado ocorreu na variável v, da função tal... */&lt;br /&gt;
/* Sempre que possível, abortar o programa nesta situação. */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
O ponto é que o &lt;i&gt;default&lt;/i&gt; deve ser usado para 
expressar: Faça isto para todos os outros valores possíveis (tanto 
conhecidos quanto os desconhecidos). E não é bom programar para fazer coisas com valores desconhecidos.&lt;br /&gt;
&lt;br /&gt;
O mesmo fenômeno ocorre para o else em trechos do tipo:&lt;br /&gt;
&lt;br /&gt;
enum {V1, V2, V3, V4} v;&lt;br /&gt;
... &lt;br /&gt;
v = getValueFromSomewhere()&lt;br /&gt;
&lt;br /&gt;
if(v== V1|| v==V2)&lt;br /&gt;
&amp;nbsp; doSomething()&lt;br /&gt;
else //Tratando o V3 e V4 como genérico (isto não é bom...)&lt;br /&gt;
&amp;nbsp; doOtherStuff();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Melhor seria usar algo como:&lt;br /&gt;
&lt;br /&gt;
if (v== V1|| v==V2)&lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp; doSomething()&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
else if (v== V3 || v == V4)&lt;br /&gt;
{ &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; doOtherStuff();&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
else&lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp; DebugLog &amp;lt;&amp;lt;&quot;Unexpected value received&amp;nbsp; in function XXXX. Value is &quot; &amp;lt;&amp;lt; v;&lt;br /&gt;
&amp;nbsp; abort();&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
Era isto.</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/7469544924389854698/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2012/04/uso-robusto-do-default-em-switches.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/7469544924389854698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/7469544924389854698'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2012/04/uso-robusto-do-default-em-switches.html' title='Uso robusto do default em switches'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-8702451261357744862</id><published>2012-02-09T12:24:00.003-02:00</published><updated>2012-02-09T12:27:38.584-02:00</updated><title type='text'>Sugestões de leitura</title><content type='html'>&lt;br /&gt;
Seguidamente me pedem algumas recomendações de livros. Então, montei esta lista aqui. Ela está dividida em um grupo de livros genéricos, que se aplicam a qualquer linguagem de programação, e outro específico de C++. Recomendo ler os livros mais ou menos na ordem em que aparecem listados. Sobretudo recomendo que todo mundo comece lendo o &quot;&lt;b&gt;The Pragmatic Programmer, From Journeyman to Master&lt;/b&gt;.&quot;&lt;br /&gt;
&lt;br /&gt;
Vamos às listas: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Desenvolvimento de software em geral, independente de linguagem:&lt;br /&gt;
&lt;/u&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;The Pragmatic Programmer, From Journeyman to Master&lt;/b&gt;. &lt;i&gt;David Thomas e Andrew Hunt&lt;/i&gt;.
 Este livro é um divisor de águas na carreira de um programador. Depois 
de lê-lo, você nunca mais será o mesmo. 
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Extreme Programming Explained&lt;/b&gt;. Kent Beck. É fundamental conhecer os conceitos apresentados 
neste livro, mesmo que não se vá aplicar tudo o tempo todo (BTW, o 
próprio Beck diz que nem todo o tipo de projeto deve ser feito em 
eXtreme Programming).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Refactoring: Improving the Design of Existing Code&lt;/b&gt;.&lt;b&gt; &lt;/b&gt;Martin
 Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts. Bastante 
indicado para quem trabalha com código herdado ou com equipes muito 
heterogêneas.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;The Agile Manifesto&lt;/b&gt;. Kent Beck et alli. 
http://agilemanifesto.org/. Recomendo também uma lida nas páginas 
adjacentes, como a de princípios. É tudo bem curto e se lê em poucos 
minutos.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Apps&lt;/b&gt;. Mike Clark. Embora ele use java nos exemplos, as ideias ajudam em qualquer linguagem.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Agile Software Development (The Agile Software Development Series)&lt;/b&gt;. Alistair Cockburn.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Planning Extreme Programming&lt;/b&gt;. Kent Beck e Martin Fowler. 
Interessante para quem pretende gerenciar projetos ou ter uma 
participação maior na gerência de seu projeto. Mesmo que não trabalhe em projetos XP, vale a pena ler.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Code Reading: The Open Source Perspective (Effective Software Development Series)&lt;/b&gt;.
 Diomidis Spinellis. Ler código é uma habilidade extremamente 
importante. Apesar dos comentários depreciativos&amp;nbsp; que a gente encontra 
em vários sites sobre o estilo do autor, o livro vale a pena; traz ideias bem interessantes e chama a atenção para a necessidade desta 
habilidade. De quebra, o leitor também pode se sensibilizar e passar a 
tentar escrever código lembrando que outros humanos o lerão. BTW, li uma
 frase um dia desses que dizia algo como: &quot;Escreva o código sempre 
pensando que o próximo programador a dar manutenção nele será um 
psicopata violento que sabe o seu endereço.&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;C++:&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Effective C++:50 Specific Ways to Improve Your Programs and Design&lt;/b&gt;. Scott Meyers. Leitura (e compreensão) obrigatória para qualquer candidato a programador C++ verdadeiro.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;More Effective C++: 35 New Ways to Improve Your Programs and Designs&lt;/b&gt;. Scott Meyers. Mais básico que o anterior. Talvez muita gente não aprenda nada de novo com este.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library&lt;/b&gt;. Scott Meyers. Leitura (e compreensão) obrigatória para qualquer candidato a programador C++ verdadeiro.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;The C++ Standard Library&lt;/b&gt;: A Tutorial and Reference. Nicolai M. Josuttis. Leitura obrigatória para programadores C++ médios em diante.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;The C++ Programming Language&lt;/b&gt;. Bjarne Stroustrup. Leitura 
obrigatória para programadores C++. Ponto a mais para que pronunciar 
corretamente o nome do autor ;-).&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Effective C++:50 Specific Ways to Improve Your Programs and Design&lt;/b&gt;.
 Scott Meyers. Não foi engano... Está duplicado de propósito. Quando 
você tiver chegado aqui, deve reler este livro. Ele é pequeno, rápido 
para reler. E provavelmente, na primeira vez que você leu, você não 
entendeu alguma coisa...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/8702451261357744862/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2012/02/seguidamente-me-pedem-algumas.html#comment-form' title='3 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/8702451261357744862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/8702451261357744862'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2012/02/seguidamente-me-pedem-algumas.html' title='Sugestões de leitura'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-896472451273169129</id><published>2011-10-19T15:36:00.000-02:00</published><updated>2011-10-19T15:36:19.164-02:00</updated><title type='text'>Código autodocumentado</title><content type='html'>Prezados, código auto-documentado é diferente de colocar comentários no código explicando o que ele faz ou de colocar documentação doxygen ou afins.&lt;br /&gt;
&lt;br /&gt;
Código auto-documentado é código escrito de forma clara, com nomes descritivos nas entidades (variáveis, funções, constantes, etc) e com uma estruturação lógica que facilita o entendimento. Levando a um exemplo extremo, a seção abaixo &lt;u&gt;&lt;b&gt;não&lt;/b&gt;&lt;/u&gt; é código auto-documentado:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
/* Function f(string s1, string s2)&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
This function prints a name on the screen, formatting as &quot;surname, name&quot;. s1 is the name and s2 is the surname.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
f(string s1, string s2)&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
{&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Nem que o comentário fosse no padrão doxygen, isto não seria código auto-documentado!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Agora um exemplo de auto-documentado:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
//----------------------------------------------&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
// This function prints a name on the screen, formatting&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
// as &quot;surname, name&quot;.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;printAsSurnameCommaName(string name, string surname)&lt;/span&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
...&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
} &lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/896472451273169129/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/10/codigo-autodocumentado.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/896472451273169129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/896472451273169129'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/10/codigo-autodocumentado.html' title='Código autodocumentado'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-8309135531635600915</id><published>2011-08-14T13:35:00.000-03:00</published><updated>2011-08-14T13:35:01.546-03:00</updated><title type='text'>Como documentar um refix no documento de change log de um software</title><content type='html'>&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Recentemente um colega me consultou sobre como documentar, no changelog que vai para o usuário, a correção de um bug que foi reaberto. Abaixo eu transcrevo a conversa (com autorização - agradecimentos ao Mateus pela autorização) pois outras pessoas também podem ter a mesma dúvida.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:26:31) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;se eu corrigo um bug e coloco no changelog:&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:26:39) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;fix bug XXX....&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:26:47) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;mas alguém vai lá e reabre o dito cujo.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:26:59) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;aí eu corrijo e libero outra versão, com o novo fix.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:27:04) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;como coloco no changelog?&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:27:07) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;Fix bug xxx&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:27:12) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;ou Refix bug xxx ?&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:27:25) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;changelog do source control ou do bug tracking?&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:27:33) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;do pacote. &lt;span style=&quot;color: #0b5394;&quot;&gt;[N.R. - Quer dizer: no documento que vai para o usuário.]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:27:40) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;ok.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:27:41) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;o arquivo changelog que vai pro usuário.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:28:06) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Fix of bug xxxx after its reopening by Fulano.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:28:50) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Ou, se quiseres mais curto: Refix of bug xxxx: Now I yyyyyyy [descrição do que foi feito] and it should really fix the problem.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:29:00) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;hmmm&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:29:09) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;esse segundo me agrada mais porque to colocando o título do bug também na linha.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:29:22) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;O importante é te colocares no lugar de um usuário que lê o changelog.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:29:50) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;pois é&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:29:55) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Se tu colocas só refix, o cara vai ficar perguntando WTH he means with refix. What was still broken.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:30:34) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;acho q não preciso ser tão verboso, já que o usuário é interno e tem acesso ao bugzila&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:30:51) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;mas acho bom indicar que foi reaberto e essa é uma &quot;re-correção&quot;&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:31:17) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;No caso do usuário ter acesso ao Bugzilla, o melhor mesmo é só refix of XXXX: Now I yyyyyy.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:31:27) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;blz.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:31:29) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;valeu.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:31:41) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Tu colocas no bugzilla o que foi feito para corrigir?&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:32:23) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;sim&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:32:37) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;ok. Isto é importante também.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:32:48) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Agora a cobrança do serviço de consultoria.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:33:16) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Eu gostaria de colocar este diálogo no meu blog de programação.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:33:29) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Ele exemplifica uma dúvida muito comum.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:33:54) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;Estou autorizado?&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(13:33:57) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; font-weight: bold;&quot;&gt;Mateus: &lt;/span&gt;sim&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:33:59) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;ok.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;(13:34:00) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;lg.moreira: &lt;/span&gt;;-)</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/8309135531635600915/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/08/como-documentar-um-refix-no-documento.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/8309135531635600915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/8309135531635600915'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/08/como-documentar-um-refix-no-documento.html' title='Como documentar um refix no documento de change log de um software'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-9189906416941654399</id><published>2011-08-09T14:26:00.000-03:00</published><updated>2011-08-09T14:26:00.394-03:00</updated><title type='text'>Tornar a vida do usuário mais simples: Nossa meta</title><content type='html'>Lembre-se sempre de que programas de computador existem para facilitar a execução de um trabalho. Ou seja, para tornar a vida do usuário mais simples. &lt;br /&gt;
&lt;br /&gt;
O que isto significa do ponto de vista de um programador? Significa que, ao tomar decisões de projeto, você deve pautá-las considerando o que vai &lt;u&gt;tornar  mais simples a vida &lt;/u&gt;&lt;u&gt;do usuário&lt;/u&gt;, mesmo que isto implique em tornar a sua vida mais complicada. Resumindo: sempre optar pelo que dá menos trabalho para o usuário, mesmo que isto implique em mais trabalho para o programador.</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/9189906416941654399/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/08/tornar-vida-do-usuario-mais-simples.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/9189906416941654399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/9189906416941654399'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/08/tornar-vida-do-usuario-mais-simples.html' title='Tornar a vida do usuário mais simples: Nossa meta'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-5691914449100903620</id><published>2011-08-08T12:05:00.001-03:00</published><updated>2011-08-08T12:06:25.645-03:00</updated><title type='text'>Command Line Interfaces</title><content type='html'>Taí um artigo que eu gostaria de ter escrito. Mas já o fizeram muito bem em &lt;a href=&quot;http://www.antoarts.com/designing-command-line-interfaces/&quot;&gt;http://www.antoarts.com/designing-command-line-interfaces/&lt;/a&gt;. Recomendo que leiam.&lt;br /&gt;
&lt;br /&gt;
Alguns excertos:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;&quot;Ease of automation:&lt;/b&gt; Most command-line interfaces can easily be automated using scripts.&lt;b&gt;&quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&quot;Fast startup times:&lt;/b&gt; Most command-line interfaces beat their graphical counterparts several times at startup time&lt;b&gt;&quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&quot;Easier to use remotely:&lt;/b&gt; Maybe it’s just me, but I prefer to remotely control computers via SSH over VNC&lt;b&gt;&quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&quot;Higher efficiency:&lt;/b&gt; Being able to do a lot by just  typing some characters instead of searching in menus increases the  efficiency which you are able to do work at&lt;b&gt;&quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Try to avoid interactivity&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Name the program correctly&lt;/li&gt;
&lt;li&gt;Follow the CLI conventions on arguments&lt;/li&gt;
&lt;li&gt;&quot;Provide --version and --help&quot;&lt;/li&gt;
&lt;li&gt;&quot;If a program has nothing of importance to say, then be quiet&quot;&lt;/li&gt;
&lt;li&gt;&quot;Every program should do one, and only one thing, and do it well&quot;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/5691914449100903620/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/08/command-line-interfaces.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5691914449100903620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5691914449100903620'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/08/command-line-interfaces.html' title='Command Line Interfaces'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-7486556522087471156</id><published>2011-08-04T14:26:00.002-03:00</published><updated>2011-08-04T14:27:21.284-03:00</updated><title type='text'>Metodologia XGH</title><content type='html'>XP é coisa do passado. A onda é usar XGH:&lt;a href=&quot;http://www.judsonmaria.net/index.php/geral/extreme-go-horse-programming&quot;&gt; http://www.judsonmaria.net/index.php/geral/extreme-go-horse-programming.&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/7486556522087471156/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/08/motodologia-xgh.html#comment-form' title='4 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/7486556522087471156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/7486556522087471156'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/08/motodologia-xgh.html' title='Metodologia XGH'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-1064618038234772746</id><published>2011-07-26T18:10:00.000-03:00</published><updated>2011-07-26T18:10:01.113-03:00</updated><title type='text'>Mais sobre as &quot;Regras de Ouro&quot;</title><content type='html'>Após a divulgação do artigo &lt;a href=&quot;http://lg-prog.blogspot.com/2011/02/as-regras-de-ouro-do-desenvolvimento-de.html&quot;&gt;&quot;As &#39;Regras de Ouro&#39; do desenvolvimento de software&quot;&lt;/a&gt;, me pediram para falar mais sobre cada uma, dando exemplos quando possível. Vou tentar atender ao pedido neste artigo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Não se repita. &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Esta regra não se refere apenas a não dizer a mesma coisa duas vezes. Esta regra não se refere apenas a não dizer a mesma coisa duas vezes. Ela está voltada para coisas mais profundas como não armazenar a mesma informação em mais de um lugar.&lt;br /&gt;
&lt;br /&gt;
Por exemplo, imagine que você tem um conjunto de arquivos que deve ser instalado pelo instalador do seu software e, consequentemente, removido na desinstalação. Seria uma quebra desta regra se você fizesse algo do tipo:&lt;br /&gt;
&lt;blockquote&gt;:install&lt;br /&gt;
&amp;nbsp; copy a b c d e f &amp;lt;destDir&amp;gt;&lt;br /&gt;
:uninstall&lt;br /&gt;
&amp;nbsp; remove a b c d e f from &amp;lt;destDir&amp;gt; &lt;/blockquote&gt;Notaram a repetição de &quot;a b c d e f&quot;? Neste caso para evitar a repetição, a resposta seria usar uma variável. Em outros casos, pode ser mais complicado e exigir até mesmo um gerador de código automático.&lt;br /&gt;
&lt;br /&gt;
Outro caso comum de repetição acontece quando um programador (normalmente novo na equipe, mas às vezes também um antigo e com preguiça de procurar o que já existe no código) inadvertidamente cria uma função para fazer a mesma coisa que uma que já existe e que ele não conhecia.&lt;br /&gt;
&lt;br /&gt;
Outro exemplo, mais sutil:&lt;br /&gt;
&lt;br /&gt;
Comentários descrevendo o que uma parte de código faz. O código em si deveria ser claro o suficiente para explicar o que ele faz (leitores entenderem), além de fazer o que deve (computadores entenderem). Os comentários devem ser usados apenas para informar sobre decisões e aspectos de mais alto nível relacionados ao código. Como está muito bem dito por Andrew Hunt e David Thomas em The Pragmatic Programmer: &quot;bad code &lt;i&gt;requires&lt;/i&gt; lots of comments&quot;.&lt;br /&gt;
&lt;br /&gt;
Outro exemplo:&lt;br /&gt;
&lt;br /&gt;
Duplicação entre a especificação e o código. Ok, esta é difícil de eliminar, mas num mundo ideal seria legal ter a informação só na especificação e o código sair sozinho. Uma das ideias com UML é poder especificar usando-a e gerar código automaticamente. Bom, a gente sabe o final da história e não preciso falar a respeito. :-)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Não separe o que deve estar junto. &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&quot;O que Deus uniu, o programador não separe.&quot;&lt;br /&gt;
&lt;br /&gt;
Exemplos:&lt;br /&gt;
&lt;br /&gt;
Documentação de projeto (especificações, etc) devem estar guardadas junto com o código (também devido à regra de manter as coisas perto de onde são usadas - a propósito, todos sabem que as especificações devem ser usadas durante a codificação?).&lt;br /&gt;
&lt;br /&gt;
cpp e h de um mesmo módulo devem estar no mesmo diretório.&lt;br /&gt;
&lt;br /&gt;
Instalador de produto e código do produto devem estar na mesma árvore.&lt;br /&gt;
&lt;br /&gt;
Código do módulo e &lt;i&gt;unit test&lt;/i&gt; do módulo devem estar juntos. Aliás, eu particularmente prefiro que o código de &lt;i&gt;unit test&lt;/i&gt; esteja &lt;u&gt;dentro do mesmo arquivo&lt;/u&gt; que o código de produção do módulo; assim, se diminui o trabalho para criar casos de teste novos ao criar funcionalidades novas e se evita o &quot;esquecimento&quot; de atualizar os testes. &lt;i&gt;Unit test &lt;/i&gt;junto do código de produção também facilita a depuração quando aparece um bug, pois facilmente se coloca o módulo suspeito em teste (lembem-se de &lt;a href=&quot;http://lg-prog.blogspot.com/2010/12/o-procedimento-de-correcao-de-bug.html&quot;&gt;&quot;O procedimento de correção de bug&quot;&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Não junte o que deve estar separado ou coisas que não estão relacionadas.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&quot;O que o programador junta, nem o diabo separa.&quot;&lt;br /&gt;
&lt;br /&gt;
Exemplo clássico: O programador precisa fazer uma função que retorna nome e sobrenome, então ele concatena os dois dados numa string e retorna a string, na ilusão de que, se alguém precisar do nome e sobrenome separados (ou em um formato de concatenação diferente...), é só &quot;parsear a string&quot;. Não caia nesta ilusão; o correto é retornar os dados separadamente, porque isto é uma interface mais genérica. Ou, o que ainda é melhor no caso de linguagem orientada a objetos: Não ter uma função que retorna o nome e o sobrenome e sim métodos que processam o nome e sobrenome internamente e resolvem todo o problema dentro da classe (exemplo: um serializador para stream).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Guarde as coisas perto de onde elas são usadas.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Aqui a questão é guardar as coisas fisicamente próximas de onde elas são usadas.&lt;br /&gt;
&lt;br /&gt;
Por exemplo, eu tive um cliente que seguidamente me contactava perguntando a data em que alguma versão do software tinha sido liberada e o que tinha sido incluído naquela versão. Para dar uma resposta rápida e exata, eu precisava ter estas informações à mão perto de minha estação de trabalho. Solução: Imprimir um resumo de cada release contendo data, novidades e versão liberada e deixar estas folhas presas na parede na frente da minha mesa - guardadas onde elas seriam usadas.&lt;br /&gt;
&lt;br /&gt;
Outros exemplos:&lt;br /&gt;
&lt;br /&gt;
Se há uma instrução de como desligar o ar condicionado, imprima-a e coloque-a perto do aparelho ao invés de deixá-la na rede da empresa. O mesmo vale para instruções de como fechar porta, fazer café, normas de codificação, etc..&lt;br /&gt;
&lt;br /&gt;
Se há um esqueleto padrão de arquivo fonte, ponha-o bem pertinho de onde os arquivos fonte vão ficar. Junto com os fontes, no sistema de versionamento, num diretório chamado skels, por exemplo.&lt;br /&gt;
&lt;br /&gt;
Guarde todo o material necessário para o seu projeto de software no mesmo sistema de versionamento e faça com que seja fácil (com um comando) baixar tudo quando necessário.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Teste tudo que você faz.&amp;nbsp; &lt;/b&gt;&lt;br /&gt;
Teste cedo, teste frequentemente. Se tem 3 linhas, já devia ter sido testado. Se tem um if, já devia ter passado por 2 testes.&lt;br /&gt;
&lt;br /&gt;
O que você testa, funciona de primeira; o que você não testa, dá pau. Precisa dizer mais?</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/1064618038234772746/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/07/mais-sobre-as-regras-de-ouro.html#comment-form' title='6 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1064618038234772746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1064618038234772746'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/07/mais-sobre-as-regras-de-ouro.html' title='Mais sobre as &quot;Regras de Ouro&quot;'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-5663301960074994783</id><published>2011-07-02T14:43:00.000-03:00</published><updated>2011-07-02T14:43:00.758-03:00</updated><title type='text'>Sistemas de Qualidade de Software</title><content type='html'>Muito se fala em sistemas de Qualidade de Software (em geral, o pessoal gosta de maiúsculas no nome). Um sistema muito discutido e aplicado no Brasil tem sido o CMM. Infelizmente, poucas vezes se retorna às origens deste sistema para ver de onde surgiu e que problema ele visava resolver. Também poucas vezes se fala a respeito do sucesso ou fracasso deste sistema no mundo de desenvolvimento de SW. Vamos dar uma olhada rápida (e com uma dose de parcialidade) nisto.&lt;br /&gt;
&lt;br /&gt;
O CMM começou com o Departamento de Defesa Americano, como uma ferramenta para &lt;b&gt;avaliação&lt;/b&gt; da maturidade de seus fornecedores, em meio a uma crise no gerenciamento e na qualidade do que era recebido. Notem que ele foi concebido como uma ferramenta de avaliação (por conseguinte, externa, para ser usada pelo contratante) e não como uma ferramenta de trabalho das empresas contratadas (que produzem o software). Muito tempo se passou desde então. Hoje em dia, não sei se o DOD ainda usa CMM. Mas sei que muita gente propõe que o usemos como metodologia para produzir software melhor. Pode ser que se consiga, mas até hoje, ainda não presenciei casos de sucesso real. E tenho minhas dúvidas se um modelo originalmente concebido como ferramenta de avaliação realmente é suficiente ou adequado para promover melhorias na qualidade.&lt;br /&gt;
&lt;br /&gt;
Sobre sucessos e fracassos, sempre ouço que a indústria indiana de software tem um grande número de empresas com certificações CMM altas e que isto comprova a importância do CMM. Pode ser. Minha experiência com tais empresas é muito limitada: Resume-se ao fato de que ouvi muitos clientes americanos reclamarem da baixa qualidade do software de companhias indianas, tanto em relação à qualidade intrínseca (correção, desempenho, etc) quanto a prazos. Claro que não devemos generalizar, mas é o que ouvi. A outra experiência que tive foi de uma empresa em que trabalhei e que não tem (ou ao menos não tinha na época) CMM e foi contratada para desenvolver um software que estava há 2 anos nas mãos de uma indiana certificada CMM. Tal software, mesmo após estes 2 anos de trabalho, ainda não era minimamente funcional e apresentava um número elevado de bugs registrados. A decisão tomada logo que minha companhia entrou em cena foi abandonar totalmente a base de código herdada e recomeçar o projeto do zero. Aceitamos o desafio e o projeto foi concluído em aproximadamente 6 meses, com índices de bug baixíssimos (zero críticos, zero graves, três cosméticos) e com funcionalidades mais avançadas que as do projeto original.&lt;br /&gt;
&lt;br /&gt;
E aí me perguntam se eu gosto de Qualidade de Software. Bom, eu prefiro software de qualidade...&lt;br /&gt;
&lt;br /&gt;
LGM</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/5663301960074994783/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/07/sistemas-de-qualidade-de-software.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5663301960074994783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5663301960074994783'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/07/sistemas-de-qualidade-de-software.html' title='Sistemas de Qualidade de Software'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-5459511570542712848</id><published>2011-06-16T23:52:00.000-03:00</published><updated>2011-06-16T16:34:54.530-03:00</updated><title type='text'>O conjunto básico</title><content type='html'>E que tal se a gente conversasse hoje sobre o que são as coisas fundamentais num projeto de software?&lt;br /&gt;
&lt;br /&gt;
Todo projeto de software deve conter os itens listados abaixo. Quanto mais cedo eles forem criados, melhor. Recomendo até que eles sejam criados / adicionados na ordem em que os listo.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; &lt;b&gt;Sistema de &lt;/b&gt;&lt;b&gt;&lt;i&gt;bug tracking&lt;/i&gt;&lt;/b&gt;. Exemplos: Bugzilla, Mantis, etc.&lt;br /&gt;
Por que deve ser o primeiro item? Porque bugs ocorrem desde o primeiro dia de trabalho no projeto. Pode ser um erro em algum diagrama, algum problema que um programador encontra no código de outro como resultado de uma revisão, etc. Se ganha muito se isto for registrado de modo centralizado e &lt;u&gt;CONCISO&lt;/u&gt;.&lt;br /&gt;
Deve ser um sistema orientado para desenvolvedores, de modo a ajudar não só no controle, mas no processo de correção, ou seja:&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Deve ter, no mínimo, os estados &lt;b&gt;New &lt;/b&gt;(não corrigido ainda), &lt;b&gt;Fixed &lt;/b&gt;(bug corrigido, correção &lt;i&gt;comitada &lt;/i&gt;no &lt;i&gt;source control&lt;/i&gt;) e &lt;b&gt;Verified&lt;/b&gt; (um release-build que contém a correção foi criado, testado para o bug e não se viu o dito cujo ocorrer novamente). Outros estados, embora não sejam fundamentais, ajudam muito. Exemplos: Assigned (tem alguém corrigindo o bug - isto evita que, em grupos grandes, dois desenvolvedores trabalhem na mesma coisa sem saber), Closed (confirmado pelo usuário que reportou o bug que ele não acontece mais).&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Os desenvolvedores precisam poder criar entradas neste sistema. Parece mentira, mas tem muita equipe que acha que desenvolvedor não acha bug... Surpresa: Eles acham MUITOS. E normalmente os acham MUITO ANTES que o software entre em uma fase de testes.&lt;/li&gt;
&lt;li&gt; Deve permitir que os desenvolvedores coloquem anotações acerca da investigação das causas do bug no próprio bug report. (As seguintes &lt;a href=&quot;http://lg-prog.blogspot.com/2011/02/as-regras-de-ouro-do-desenvolvimento-de.html&quot;&gt;Regras de Ouro&lt;/a&gt; se aplicam: &quot;Não separe o que deve estar junto.&quot;, &quot;Guarde as coisas perto de onde elas são usadas.&quot; &lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;b&gt;Sistema de versionamento de fontes&lt;/b&gt;. Exemplos: subversion, git, cvs. &lt;br /&gt;
Deve ser colocado no ar bem cedo, pois devemos ter o histórico desde o início. Muita gente mostra resistência em colocar material no sistema de versionamento antes de ter &quot;algo que funcione&quot;. Não é uma boa idéia. Vença a resistência e comece a versionar no primeiro dia. &lt;br /&gt;
Detalhes importantes:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Não existe um sistema de versionamento que seja absoluto. Cada método de trabalho casa melhor com um sistema diferente. Não se renda a modismos na hora de escolher. Escolha com a cabeça.&lt;/li&gt;
&lt;li&gt;Um bom versionamento implica em ter tudo no mesmo sistema e na mesma árvore de diretórios. Um comando de checkout único deve baixar todo o material necessário para trabalhar no projeto.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;b&gt;Build automatizado e integração contínua&lt;/b&gt;. Mesmo antes de ter um software funcional (antes de começar a programar), ponha no ar um sistema de integração contínua e automatize o processo de build. O que se quer é que se produza os &lt;i&gt;deliverables&lt;/i&gt; do software com apenas um comando e, ao se commitar algo no sistema de versionamento, o sistema de integração contínua faça o build e testes sozinho. Importante: Considero parte dos &lt;i&gt;deliverables&lt;/i&gt; a geração de tags no sistema de versionamento, de modo a permitir a recuperação dos fontes usados em cada build.&lt;br /&gt;
Na fase inicial do projeto, ainda não temos código, mas já devemos fazer um sistema automático que gere o pacote de instaladores, documentos (manual do usuário, etc), mesmo que gere um instalador com um executável tipo &quot;return 0&quot;, que não faz nada.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Unit tests&lt;/b&gt;. Automatizados, de preferência com possibilidade de rodá-los automaticamente durante o processo de build. Os unit tests devem ser aprimorados ao longo do projeto, por exemplo, quando se encontra um bug (ver &lt;a href=&quot;http://lg-prog.blogspot.com/2010/12/o-procedimento-de-correcao-de-bug.html&quot;&gt;O procedimento de correção de bug&lt;/a&gt;). Importante: Unit test é feito e rodado pelos desenvolvedores. Pode (e deve, sempre que possível) ser rodado automaticamente no &lt;i&gt;build&lt;/i&gt; também; mas o fundamental é que os desenvolvedores possam rodar cada unit test de modo simples e na sua cópia de trabalho dos fontes.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Número de versão no software&lt;/b&gt;. Sem números de versão não tem como ter rastreabilidade do software. Não tem como saber o que foi testado; não tem como saber quando bugs foram corrigidos. Mais detalhes no artigo &lt;a href=&quot;http://lg-prog.blogspot.com/2011/01/identificadores-de-versao.html&quot;&gt;Identificadores de Versão&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Testes funcionais&lt;/b&gt;. Deve-se ter uma rotina de testes funcionais bem definida e executá-los seguidamente ao longo do projeto. Detalhes importantes:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;O ambiente de teste (máquinas, dispositivos, etc) deve ser diferente do usado no desenvolvimento. Testes na máquina do desenvolvedor sempre funcionam (a não ser que seja um desenvolvedor muito relapso)...&lt;/li&gt;
&lt;li&gt;Usar sempre o material gerado nos builds automatizados para os testes. Nunca rode testes funcionais oficiais usando material gerado nas máquinas de desenvolvedores.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/5459511570542712848/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/02/o-conjunto-basico.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5459511570542712848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5459511570542712848'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/02/o-conjunto-basico.html' title='O conjunto básico'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-1200841862013250917</id><published>2011-05-02T10:07:00.000-03:00</published><updated>2011-05-02T10:07:58.982-03:00</updated><title type='text'>Assinaturas padrão dos operadores de stream</title><content type='html'>Sempre esqueço da assinatura padrão dos operadores de inserção e remoção do C++. Então resolvi anotar aqui:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;std::ostream&amp;amp; operator&amp;lt;&amp;lt;(std::ostream&amp;amp; s, const MyData&amp;amp; data);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;std::istream&amp;amp; operator&amp;gt;&amp;gt;(std::istream&amp;amp; s, MyData&amp;amp; data);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Um exemplo de implementação do &amp;gt;&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;istream&amp;amp; operator&amp;gt;&amp;gt;(istream&amp;amp; s, MyDataEnum&amp;amp; data)&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int v;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;s &amp;gt;&amp;gt; v;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (s) //Conversion OK.&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;data = MyDataEnum(v);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return s;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/1200841862013250917/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/03/assinaturas-padrao-dos-operadores-de.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1200841862013250917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1200841862013250917'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/03/assinaturas-padrao-dos-operadores-de.html' title='Assinaturas padrão dos operadores de stream'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-1599953019022905891</id><published>2011-03-07T11:37:00.000-03:00</published><updated>2011-03-07T11:37:00.392-03:00</updated><title type='text'>Orientação a objetos</title><content type='html'>Prezados.&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;O preceito mais básico da Orientação a Objetos é ter dados e operações dentro da mesma unidade lóg&lt;/span&gt;ica (no caso, a classe). Isto também se diz da seguinte forma: Os objetos devem ser responsáveis por si próprios; eles é que devem realizar as operações sobre seus dados internos.&lt;br /&gt;
&lt;br /&gt;
Outro preceito importante é o de encapsulamento de dados ou &lt;i&gt;information hiding&lt;/i&gt;. É até anterior à OO, importante também em outros paradigmas de programação. Trata-se de não expor detalhes de como uma entidade é implementada; expor apenas a interface da entidade. Em OO, isto significa, ter poucos (idealmente, nenhum) dados públicos (no sentido &lt;b&gt;semântico&lt;/b&gt; de públicos). Um excelente livro sobre programação que eu li, e agora me escapa qual, dizia a este respeito que devemos seguir o conselho ouvido na infância: &quot;&lt;i&gt;Don&#39;t show your private parts.&lt;/i&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
Perco as contas de quantas vezes vejo isto tudo ser deixado de lado. Por exemplo quando fazem algo assim:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;class Horario&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; unsigned hora;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; unsigned minuto;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;public:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; unsigned getHora();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; unsigned getMinuto();&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;&amp;nbsp; void setHora(unsigned hora);&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; void setMinuto(unsigned minuto);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;main()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Horario&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; t0, t1, t2, t3;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; t0.setHora = 10;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; t0.setMinuto = 10;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; // um pouco mais de código, inicializando tn e fazendo sabe-se mais o que....&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; // então imprime alguns t:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; cout &amp;lt;&amp;lt; t2.getHora() &amp;lt;&amp;lt; &#39;:&#39; &amp;lt;&amp;lt; t2.getMinuto() &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; cout  &amp;lt;&amp;lt; t3.getHora() &amp;lt;&amp;lt; &#39;:&#39; &amp;lt;&amp;lt; t3.getMinuto() &amp;lt;&amp;lt;  endl;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
estão jogando no lixo os preceitos mencionados acima.&lt;br /&gt;
&lt;br /&gt;
O &lt;i&gt;information hiding&lt;/i&gt; foi pro vinagre, pois embora os membros não sejam declarados como públicos, semanticamente eles são totalmente públicos: usuários da classe podem fazer o que bem entenderem com eles... Os getXXX e setXXX geram o problema.&lt;br /&gt;
&lt;br /&gt;
Além disso, o preceito básico da OO foi pro espaço também. Notem que as operações (inicialização e &quot;impressão&quot;) sobre os objetos estão sendo feitas FORA do objeto (fora da classe).&lt;br /&gt;
&lt;br /&gt;
Melhor seria algo como:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;class Horario&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; unsigned hora;&lt;br /&gt;
&amp;nbsp; unsigned minuto;&lt;br /&gt;
public: &lt;br /&gt;
&amp;nbsp; Horario(unsigned h, unsigned m): hora(h), minuto(m) {};&lt;br /&gt;
&amp;nbsp; string paraString() &lt;br /&gt;
&amp;nbsp;&amp;nbsp; {/*converte para string no formato hh:mm, possivelmente usando ostringstream*/};&lt;br /&gt;
&amp;nbsp; //Eventualmente outras operações com Horarios, mas nada de getXXX ou setXXX&lt;br /&gt;
&amp;nbsp;};&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; Horario t0(10,10);&lt;br /&gt;
&amp;nbsp; Horario t2(5,11);&lt;br /&gt;
&amp;nbsp; Horario t3(23,55);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; // um pouco mais de código, inicializando tn e fazendo sabe-se mais o que....&lt;br /&gt;
&amp;nbsp; // então imprime alguns t:&lt;br /&gt;
&amp;nbsp; cout &amp;lt;&amp;lt; t2.paraString() &amp;lt;&amp;lt; endl;&lt;br /&gt;
&amp;nbsp; cout &amp;lt;&amp;lt; t3.paraString() &amp;lt;&amp;lt; endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Ou, para este caso de &quot;impressão&quot;, usando um operador de inserção em stream:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;class Horario&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; friend ostream&amp;amp; operator&amp;lt;&amp;lt;(ostream&amp;amp; s, const Horario&amp;amp; h);&lt;br /&gt;
&amp;nbsp; unsigned hora;&lt;br /&gt;
&amp;nbsp; unsigned minuto;&lt;br /&gt;
public:&amp;nbsp; &lt;br /&gt;
&amp;nbsp; Horario(unsigned h, unsigned m): hora(h), minuto(m) {};&lt;br /&gt;
&amp;nbsp; //Eventualmente outras operações com Horarios, mas nada de getXXX ou setXXX&lt;br /&gt;
&amp;nbsp;};&lt;br /&gt;
&lt;br /&gt;
ostream&amp;amp; operator&amp;lt;&amp;lt;(ostream&amp;amp; s, const Horario&amp;amp; h) &lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; s &amp;lt;&amp;lt;&amp;nbsp; h.hora &amp;lt;&amp;lt; &#39;:&#39; &amp;lt;&amp;lt; h.minuto;&lt;br /&gt;
&amp;nbsp; return s;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; Horario t0(10,10);&lt;br /&gt;
&amp;nbsp; Horario t2(5,11);&lt;br /&gt;
&amp;nbsp; Horario t3(23,55);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; // um pouco mais de código, inicializando tn e fazendo sabe-se mais o que....&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; // então imprime alguns t:&lt;br /&gt;
&amp;nbsp; cout &amp;lt;&amp;lt; t2 &amp;lt;&amp;lt; endl;&lt;br /&gt;
&amp;nbsp; cout &amp;lt;&amp;lt; t3 &amp;lt;&amp;lt; endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;IMPORTANTE!!!!!! Nesta implementação acima, a classe e o operator&amp;lt;&amp;lt; devem estar no &lt;u&gt;mesmo&lt;/u&gt; módulo. Ou seja, as declarações de ambas no mesmo .h (horario.h, por exemplo) e as implementações de ambas no mesmo .cpp (horario.cpp, por exemplo). Notem que quebramos um pouco do &lt;i&gt;information hiding &lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; nesta implementação,&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; já que o operator&amp;lt;&amp;lt; precisa acessar os dados privados da classe. Quer dizer, a classe não mostra as suas &quot;partes privadas&quot; para todo mundo, mas mostra para os &quot;amiguinhos&quot;. Não é o ideal e não me agrada, mas até pode ser aceitável em algumas situações, desde que classe e operador tenham uma &quot;união estável&quot; bem forte e a classe tenha poucos &quot;amiguinhos&quot; (entidades friend).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Eu prefiro uma implementação que inclui o encapsulamento da paraString() e a conveniência do operador&amp;lt;&amp;lt;: Implemento o operator&amp;lt;&amp;lt; chamando o paraString(). Neste caso, a declaração de friend fica desnecessária.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/1599953019022905891/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/03/orientacao-objetos.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1599953019022905891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1599953019022905891'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/03/orientacao-objetos.html' title='Orientação a objetos'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-3676420074117373724</id><published>2011-02-26T22:39:00.000-03:00</published><updated>2011-02-26T22:39:25.372-03:00</updated><title type='text'>As &quot;Regras de Ouro&quot; do desenvolvimento de software</title><content type='html'>&lt;ol&gt;&lt;li&gt;Não se repita.&lt;/li&gt;
&lt;li&gt;Não separe o que deve estar junto.&lt;/li&gt;
&lt;li&gt;Não junte o que deve estar separado ou coisas que não estão relacionadas.&lt;/li&gt;
&lt;li&gt;Guarde as coisas perto de onde elas são usadas.&lt;/li&gt;
&lt;li&gt;Teste tudo que você faz. (O que você testa, funciona de primeira; o que você não testa, dá pau.)&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/3676420074117373724/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/02/as-regras-de-ouro-do-desenvolvimento-de.html#comment-form' title='8 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/3676420074117373724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/3676420074117373724'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/02/as-regras-de-ouro-do-desenvolvimento-de.html' title='As &quot;Regras de Ouro&quot; do desenvolvimento de software'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-5552304976136374394</id><published>2011-02-23T23:50:00.044-03:00</published><updated>2012-07-19T16:27:17.486-03:00</updated><title type='text'>Para quem se escreve o código-fonte?</title><content type='html'>&lt;div&gt;
Bom, todo (ou quase todo) software que escrevemos possui código-fonte. Mas quando estamos escrevendo este código quem devem ser os &quot;leitores&quot; a quem o dirigimos? Costumo dizer que a resposta dada por um programador para esta pergunta (e o quanto ele aplica a resposta na prática) definem o nível de habilidade deste programador.&lt;br /&gt;
&lt;br /&gt;
Os programadores mais iniciantes ou tacanhos pensam que se deve escrever para que o computador entenda e isto basta. Programadores avançados sabem que se precisa escrever para outros programadores lerem. O que passa desapercebido é que devemos ser claros na nossa escrita e, para isso, devemos ter um vocabulário rico.&lt;br /&gt;
&lt;br /&gt;
Em programação, muitas vezes se pode escrever operações ou expressões diferentes que levam a um mesmo resultado. Usar estas diferenças para expressar melhor o que o programa faz e como o programador pensou na solução é o que eu chamo de ter um vocabulário rico. Aumentamos o nosso vocabulário de programação do mesmo jeito que o de português: estudando, lendo bons textos (no caso, lendo programas), escrevendo com cuidado e pedindo para pessoas experientes revisarem nossos &quot;textos&quot;.&lt;br /&gt;
&lt;br /&gt;
Em programação, muitas vezes se usa o termo &quot;idioma&quot; para se referir às peças de vocabulário. Em outros artigos, vou dar alguns exemplos de idiomas em C++, procurando mostrar diferentes idiomas cujos resultados são idênticos para o computador, mas que dizem coisas diferentes para quem lê o código.&lt;br /&gt;
&lt;br /&gt;
Isto me lembra de uma discussão recorrente que tenho com programadores: Eu dizendo &quot;Isto está errado.&quot; e o programador respondendo &quot;Mas funciona, logo está certo&quot;. Nem tudo que funciona está certo, justamente porque o código pode estar &lt;u&gt;fazendo&lt;/u&gt; a coisa certa, mas &lt;u&gt;dizendo&lt;/u&gt; a coisa errada. Ou seja, está escrito para o computador, mas não para os leitores humanos.&lt;br /&gt;
&lt;br /&gt;
Vamos a alguns exemplos:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;strike&gt;int some16BitVal&lt;/strike&gt;;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sint_16 some16BitVal;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Mesmo que sint_16 seja um define ou typedef para int, a linha de cima está errada. Quando se escreve int, se está dizendo: preciso de um inteiro que seja o mais eficiente possível nesta arquitetura, mas não me importa o seu tamanho. Se precisamos de tamanho definido, o correto é expressar isto com um tipo.&lt;br /&gt;
&lt;br /&gt;
Outra bem comum: Aproveitar uma constante para dois usos só por que, coincidentemente elas têm o mesmo valor. Se você usa uma mesma constante (e.g. &lt;i&gt;const int mySize=33;&lt;/i&gt;) em vários pontos do código, você está dizendo que &lt;b&gt;obrigatoriamente e irrevogavelmente&lt;/b&gt; todos aqueles pontos estão ligados e que mudando num todos &lt;b&gt;tem de ser mudados juntos&lt;/b&gt;, mantendo todos sempre o mesmo valor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/5552304976136374394/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/02/para-quem-se-escreve-o-codigo-fonte.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5552304976136374394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5552304976136374394'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/02/para-quem-se-escreve-o-codigo-fonte.html' title='Para quem se escreve o código-fonte?'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-1257016001042313647</id><published>2011-02-22T17:38:00.001-03:00</published><updated>2011-02-27T16:40:23.061-03:00</updated><title type='text'>Backup de blog</title><content type='html'>O comando&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;wget -e robots=off -E -H -k -K -p -r -l 1 http://lg-fotos.blogspot.com&lt;/div&gt;&lt;br /&gt;
parece fazer um backup completo de um blog.</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/1257016001042313647/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/02/backup-de-blog.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1257016001042313647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1257016001042313647'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/02/backup-de-blog.html' title='Backup de blog'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-5192683918461720231</id><published>2011-01-21T07:50:00.010-02:00</published><updated>2011-01-25T16:44:14.740-02:00</updated><title type='text'>&quot;The miserable programmer paradox&quot;</title><content type='html'>O artigo hoje não é meu. Este post é para apontar para um post de outrem.&lt;br /&gt;
&lt;br /&gt;
Me enviaram o endereço &lt;a href=&quot;http://blog.garlicsim.org/post/2840398276/the-miserable-programmer-paradox&quot;&gt;the-miserable-programmer-paradox&lt;/a&gt; há alguns dias e no fim de semana consegui ler. Nada mais verdadeiro do que o que ele diz.&lt;br /&gt;
&lt;br /&gt;
E uma grande verdade que todos os envolvidos com desenvolvimento de software deveriam aprender está escrita lá no meio: &quot;&lt;i&gt;A train of thought is a fragile thing&lt;/i&gt;&quot;. Programação e interrupções ao programador simplesmente não combinam. ;-)&lt;br /&gt;
&lt;br /&gt;
Abraços e até o próximo.&lt;a class=&quot;cssButton&quot; href=&quot;javascript:void(0)&quot; id=&quot;publishButton&quot; onclick=&quot;if (this.className.indexOf(&amp;quot;ubtn-disabled&amp;quot;) == -1) {var e = document[&#39;postingForm&#39;].publish;(e.length) ? e[0].click() : e.click(); if (window.event) window.event.cancelBubble = true; return false;}&quot; target=&quot;&quot;&gt;&lt;div class=&quot;cssButtonOuter&quot;&gt;&lt;div class=&quot;cssButtonMiddle&quot;&gt;&lt;div class=&quot;cssButtonInner&quot;&gt;Publicar postagem&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/5192683918461720231/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/01/miserable-programmer-paradox.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5192683918461720231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/5192683918461720231'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/01/miserable-programmer-paradox.html' title='&quot;The miserable programmer paradox&quot;'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-910661821530758296</id><published>2011-01-08T23:31:00.000-02:00</published><updated>2011-01-08T23:31:10.224-02:00</updated><title type='text'>Identificadores de versão</title><content type='html'>O assunto de hoje é identificadores de versão. Os famosos v1.0,  v1.2.5.9, etc.&lt;br /&gt;
&lt;br /&gt;
Todo mudo já viu estes números em software e a  maioria acha que entende bem como funcionam e para que servem. Nem  todos... Muitos tem uma vaga idéia; alguns tem uma idéia melhor, mas não  sabem como incrementar cada campo e poucos realmente sabem qual a real  utilidade destes números e quais são os mecanismos lógicos de avançar os  números de versão de um software.&lt;br /&gt;
&lt;br /&gt;
Vamos aos detalhes.&lt;br /&gt;
&lt;br /&gt;
Primeiro,  por que se tem números de versão? A resposta é simples: Para termos  rastreabilidade do software em campo. E o que é isto? É se poder  identificar de forma inequívoca qual versão de um programa um usuário  estava rodando (por exemplo, para poder auxiliar o usuário ou  reportar/corrigir um bug). Sabendo-se o identificador de versão (VID),  deve-se ser também capaz de recuperar os arquivos fonte exatos  que geraram aquela versão do software (provavelmente usando tags ou  baselines de seu sistema de versionamento de fontes). Isto mostra que  temos que garantir que nosso software &lt;b&gt;nunca&lt;/b&gt; repetirá um VID, ou  seja, &lt;b&gt;se mudamos &lt;u&gt;qualquer coisa&lt;/u&gt; no software, temos de mudar o  VID&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Há várias estratégias e formatos de VID possíveis que garantem a rastreabilidade e alguns ainda dão indicações de compatibilidade entre versões do software. Eu vou explicar o mecanismo de 4 dígitos comumente usado, pois ele é simples de entender e amplamente difundido. Neste mecanismo, os VIDs têm a forma M.n.r.b ou M.n.r-b, onde M, n, r e b são números naturais (0, 1, 2, 3...). M é chamado de Major, n é o minor, r é o release (também chamado de patch level e abreviado como p) e b é o build.&lt;br /&gt;
&lt;br /&gt;
Como queremos que qualquer mudança no software cause mudanças no VID, vamos incrementar o build number &lt;b&gt;cada vez que &lt;i&gt;buildarmos &lt;/i&gt;o software&lt;/b&gt; (ou seja, gerou os &lt;i&gt;deliverables&lt;/i&gt; -- instaladores, executáveis, etc -- do software, incrementa o build number). Notem que o build number será incrementado SEM TER HAVIDO ALTERAÇÕES NOS FONTES! Alguns vão perguntar: Ué, mas sem alterações nos fontes, então nada mudou e não precisa mudar o VID... Errado! O tempo passou, a máquina em que o build foi realizado envelheceu (pode ter sofrido atualizações de software...), eventualmente até estamos buildando em uma máquina diferente. Ou seja, muita coisa pode ter mudado. Por isso, incrementa-se o build number e assim se tem certeza que não teremos duas cópias com mesmo VID e comportamento diferente. Notem que o processo de incrementar o build number pode e deve ser automatizado. O próprio conjunto de scripts de build ou ferramentas de build deve se encarregar de incrementar o build number, evitando esquecimentos. Detalhe importante: Mesmo que se mude de máquina, o build number tem de ir sempre crescendo, quer dizer, temos de bolar um jeito de que os scripts guardem qual o último build number  usado em algum lugar compartilhado e o incrementem. A solução clássica é guardar o buil number (e o resto todo do VID) no repositório de fontes (sistema de versionamento de fontes).&lt;br /&gt;
&lt;br /&gt;
E quando mudamos algo nos fontes? Bom, aí precisamos de um incremento em alguma parte além do build number. Se a alteração foi apenas uma correção de bug ou alteração interna, sem mudança nas funcionalidades do software, se incrementa apenas o release number. Ao incrementar o release number, se volta o build number para zero. Isto faz com que a seqüência de VIDs fique do tipo M.n.0.0, M.n.0.1, M.n.0.2, M.n.1.0, ...&lt;br /&gt;
&lt;br /&gt;
Se houve alteração ou adição de funcionalidades, devemos incrementar o minor ou o major, dependendo do tipo de alteração. O minor é incrementado se podemos garantir que não houve quebra de compatibilidade na nova versão. Isto normalmente ocorre se só houve adições ao software e tudo que se podia fazer antes continua valendo (por exemplo, ler na nova versão os arquivos gerados com a versão anterior, executar as mesmas operações que eram possíveis anteriormente, etc).&lt;br /&gt;
&lt;br /&gt;
Se ocorre quebra de compatibilidade, devemos incrementar o major number. Muitos recomendam também incrementar o major number quando houve muitas alterações no software, mas há que se olhar esta recomendação com certo cuidado, pois é difícil definir o que são &quot;muitas&quot;...&lt;br /&gt;
&lt;br /&gt;
Resumindo a conversa:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Os números de versão existem para permitir rastreabilidade.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Há muitos procedimentos (especificações) de como atualizar números de versão que funcionam, garantindo a rastreabilidade (e existem também alguns escritos por aí que não funcionam, portanto, &lt;i&gt;caveat&lt;/i&gt;...).&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Um mecanismo lógico possível de ser usado estabelece um identificador de versão de 4 números (major, minor, release e build) incrementados da seguinte forma:&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;No mínimo o build number é incrementado sempre que se reconstroi o software.&lt;/li&gt;
&lt;li&gt;No mínimo o release number é incrementado se houve alterações nos fontes.&lt;/li&gt;
&lt;li&gt;No mínimo o minor number é incrementado se houve alterações de funcionalidade no software.&lt;/li&gt;
&lt;li&gt;O major number é incrementado se houve alterações no software com quebra de compatibilidade.&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;PS.: Se fala em &quot;compatibilidade para trás&quot; (&lt;i&gt;backward compatibility&lt;/i&gt;). Para explicar este conceito, o melhor jeito é usando um exemplo. Imagine que você usa a versão 1.1 de um editor de textos para criar alguns arquivos. Logo a seguir, você instala a versão 1.2 deste editor e cria novos arquivos com ela. Se diz que há &lt;i&gt;backward compatibility&lt;/i&gt; se a versão 1.2 do editor conseguir abrir sem problemas os arquivos da 1.1. O&amp;nbsp; contrário, ou seja, abrir os arquivos da 1.2 usando a 1.1 pode não ser possível, e, por isso, se fala em &quot;para trás&quot;. No esquema de versionamento descrito neste artigo, alterações no minor number indicam que há compatibilidade para trás.&lt;br /&gt;
&lt;br /&gt;
PS2: No caso das duas versões do software abrirem arquivos uma da outra, independentemente de qual é mais nova, têm-se compatibilidade total. No esquema de versionamento descrito neste artigo, alterações no release number indicam compatibilidade total.&lt;br /&gt;
&lt;br /&gt;
PS3: O exemplo de abrir arquivos de outras versões é APENAS UM EXEMPLO DIDÁTICO para explicar o conceito de compatibilidade. Na realidade, todas as funcionalidades do software devem ser levadas em conta e cada tipo de software tem coisas diferentes a serem avaliadas. Exemplos: Uma biblioteca com backward compatibility significa que programas linkados com uma versão mais antiga vão funcionar com a mais nova; no caso de servidores, os clientes que sejam feitos para a versão mais antiga do servidor devem continuar funcionando com a versão mais nova; e por aí vai.&lt;br /&gt;
&lt;br /&gt;
Abraços e até o próximo artigo.&lt;br /&gt;
LGM</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/910661821530758296/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2011/01/identificadores-de-versao.html#comment-form' title='3 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/910661821530758296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/910661821530758296'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2011/01/identificadores-de-versao.html' title='Identificadores de versão'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-4024494938855192704</id><published>2010-12-23T12:32:00.001-02:00</published><updated>2010-12-23T12:33:35.413-02:00</updated><title type='text'>Microsoft Office</title><content type='html'>O artigo de hoje é curto e não é sobre programação. É sobre compra de software da MS. Tentei comprar o Office Home &amp;amp; Student hoje via internet. Incrível, mas provavelmente é mais difícil comprar do que usar uma versão pirata.&lt;br /&gt;
&lt;br /&gt;
Depois de duas horas de trabalho infrutífero e frustrante, finalmente consegui ao menos baixar uma versão de avaliação do 2010. Desagradável que no final, por eu estar no Brasil, ele não deu muita atenção ao meu pedido inicial de baixar a versão em inglês e, em algum dos milhares de reloads de página que precisei dar, deve ter mudado para pt_BR sem eu notar. Resultado: Estou novamente tentando baixar a versão em inglês. Agradeci a todas as divindades de todas as religiões que eu estava baixando o trial version e não tinha feito nenhum pagamento...&lt;br /&gt;
&lt;br /&gt;
Resumindo, além de ser caro, o Office é difícil de ser comprado. A não ser que esta versão seja realmente maravilhosa e me surpreenda muito durante o trial, vou acabar mesmo é usando Google Docs para editar documentos. (E viva o SaaS...)</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/4024494938855192704/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2010/12/microsoft-office.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/4024494938855192704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/4024494938855192704'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2010/12/microsoft-office.html' title='Microsoft Office'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-1618341424253112691</id><published>2010-12-12T22:03:00.000-02:00</published><updated>2010-12-12T22:03:59.342-02:00</updated><title type='text'>O procedimento de correção de bug</title><content type='html'>&lt;div&gt;&lt;div&gt;Pessoal, parece incrível, mas a maioria das pessoas não tem a  menor noção dos passos básicos para corrigir um bug. Então, decidi  escrever um pequeno texto falando sobre isto.&lt;br /&gt;
&lt;br /&gt;
Vamos começar  definindo o que é um bug. Bug é um resultado obtido que é diferente do  desejado. Trata-se de um &lt;i&gt;defeito&lt;/i&gt;. &lt;br /&gt;
&lt;br /&gt;
Assim sendo, a correção  do bug deve começar com uma indicação clara do defeito, ou seja, com um  bom &lt;i&gt;bug report&lt;/i&gt;. Buenas, não adianta inventar no bug report, nem  usar ferramentas com milhares de campos, nem com letras em ouro. O que  resolve é ter &lt;u&gt;claramente&lt;/u&gt; no report as seguintes informações:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Passos  que fazem com que o resultado indesejado (o bug) aconteça &lt;u&gt;de forma  determinística&lt;/u&gt;. De forma determinística significa: aconteça SEMPRE  que eu seguir aqueles passos e sem precisar de nada mais...&lt;br /&gt;
Por que  isto é importante? Porque sem ter um modo consistente de fazer o bug  manifestar-se, a pessoa que vai tentar corrigir teria de agir por  adivinhação e isto não é nem muito científico nem muito profissional.&lt;/li&gt;
&lt;li&gt;Resultado  esperado.&lt;br /&gt;
Por que é importante? Para o corretor saber quando ele  chegou onde devia.&lt;/li&gt;
&lt;li&gt;Resultado obtido.&lt;br /&gt;
Por que é  importante? Para o corretor saber se ele realmente está vendo O MESMO  bug que quem reportou (o reporter).&lt;/li&gt;
&lt;li&gt;Versão do software em que o  bug foi visto.&lt;br /&gt;
Não queremos perder tempo tentando corrigir algo que  já foi corrigido em um patch, service pack ou versão mais nova...&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;Tendo  isto, podemos começar o processo de investigação e correção:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;b&gt;Reproduza  o bug.&lt;/b&gt;&lt;/li&gt;
&lt;ol&gt;&lt;li&gt;Instale EXATAMENTE a mesma versão do  software indicada no report. &lt;u&gt;Use o instalador que foi para campo&lt;/u&gt; e  não uma recompilação de fontes.&lt;/li&gt;
&lt;li&gt;Siga os passos de como  reproduzir o bug.&lt;/li&gt;
&lt;li&gt;Certifique-se de que obteve o &quot;resultado  obtido&quot; citado no report.&lt;/li&gt;
&lt;/ol&gt;&lt;li&gt;&lt;b&gt;Reproduza o bug compilando os  fontes. &lt;/b&gt;&lt;br /&gt;
Faça isto seguindo os mesmos passo que no item anterior,  mas recompile o software a partir dos fontes em que vai trabalhar. Você  vai se surpreender com a quantidade de vezes que, mesmo após ter  passado no passo anterior, com os fontes de trabalho, o bug não aparece.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Investigue  a causa raiz do bug.&lt;/b&gt;&lt;br /&gt;
Aqui entram em cena as ferramentas de  depuração: debugger, instrumentação de código, código dos unittests,  inteligência e experiência do corretor, etc. É impossível descrever em  detalhes como se faz isto, e só sobre este item eu poderia escrever  vários artigos, então aqui vamos apenas dizer que tem de investigar até  achar a causa do bug.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Arrume seus unittests para pegarem o  erro.&lt;/b&gt;&lt;br /&gt;
Seus unittest não pegaram o erro anteriormente, pois ele  foi visto por alguém. Então há uma falha nos unittests e ela deve ser  corrigida. Ao fim deste passo, seu unittest deve estar apontando um  erro.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Altere o código para corrigir o bug.&lt;/b&gt;&lt;br /&gt;
Certifique-se  também de que agora os unittests estão passando. A propósito, use os  unittest do módulo sendo alterado como auxiliar na alteração do código,  ou seja, não compile o software inteiro antes que o unittest do módulo  alterado esteja passando.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Rode TODOS os unittests do  software.&lt;/b&gt;&lt;br /&gt;
Isto vai deixá-lo mais seguro de que nada foi quebrado  no conserto.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Faça um rebuild incluindo as correções.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Re-execute  os passos descritos no bug report e certifique-se de que o resultado  esperado agora é obtido.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Levante (ao menos mentalmente)  as possíveis áreas adjacentes do software que podem ter tido efeitos  colaterais com sua mexida e TESTE-AS.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Se o bug não foi  encontrado como resultado da execução de seus testes internos, &lt;/b&gt;&lt;b&gt;revise  seu plano de teste para incluir um caso de teste que pegue o bug.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;Pronto.  Agora você tem um bug corrigido apropriadamente e com maiores chances  de sucesso.&lt;br /&gt;
&lt;br /&gt;
Os princípios que norteiam este processo são:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Trabalho  metódico: sem adivinhações, basear-se em fatos.&lt;/li&gt;
&lt;li&gt;Melhoria  contínua: melhorar as redes de proteção (unittests e plano de testes)  quando um bug passa por elas e a cada novo bug elas ficam melhores.&lt;/li&gt;
&lt;li&gt;One  var is gooood, two vars is baaaaad: Uma variável é bom, duas variáveis é  ruim.... Mude sempre apenas uma coisa de cada vez. -- a propósito, a  frase é uma brincadeira com o slogan das ovelhas do Animal Farm.&lt;/li&gt;
&lt;/ul&gt;Abraços  e até o próximo artigo.</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/1618341424253112691/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2010/12/o-procedimento-de-correcao-de-bug.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1618341424253112691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/1618341424253112691'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2010/12/o-procedimento-de-correcao-de-bug.html' title='O procedimento de correção de bug'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5582998384986440698.post-764461440519177563</id><published>2010-12-12T19:19:00.000-02:00</published><updated>2010-12-12T19:21:31.071-02:00</updated><title type='text'>Inauguração do BLOG</title><content type='html'>Buenas, então vamos a uma breve introdução sobre este blog.&lt;br /&gt;
&lt;br /&gt;
Originalmente, eu criei uma página com artigos em http://www.lgmoreira.com, mas está me parecendo que escrever e gerenciar a página com o google sites é meio enfadonho e que é mais simples com um blog. Por isso, criei o blog aqui e vou passar os artigos da página para cá.&lt;br /&gt;
&lt;br /&gt;
No começo, vou tentar manter o material nos dois locais. Mas com o tempo, vou optar por um deles e deixar no outro apenas um link para o local escolhido.&lt;br /&gt;
&lt;br /&gt;
Abraços e até mais.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;PS: Não esqueçam que este trabalho é voluntário e, no caso de alguém querer contribuir com alguns reais pelo trabalho, pode fazer através do &lt;a href=&quot;https://sourceforge.net/donate/?user_id=2970023#donate&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;SourceForge.&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lg-prog.blogspot.com/feeds/764461440519177563/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://lg-prog.blogspot.com/2010/12/inauguracao-do-blog.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/764461440519177563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5582998384986440698/posts/default/764461440519177563'/><link rel='alternate' type='text/html' href='http://lg-prog.blogspot.com/2010/12/inauguracao-do-blog.html' title='Inauguração do BLOG'/><author><name>LG</name><uri>http://www.blogger.com/profile/02092681733385522762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigEsIgzAMPwlXLnjvuCBSWdPj55cXDTYTf6bdo3cK2rVh51zsrvdgJLsxhOVGlXYBKtkcmeIYxvSKiZil-Qi4hOc6gX_Dux_-e4Zmy8IPpfdjHYxkvQOPUxaDzcU8NVQE/'/></author><thr:total>0</thr:total></entry></feed>