Blog de Jarley Nóbrega
Tecnologia
60% Of Apps In Android Market Are Free (Vs. 30% Or Less In Other App Stores)
02/09/10
O post abaixo, publicado no TechCrunch, explica parte de minha decisão em trocar o meu velho (e bom) HTC S621 por um Samsung Galaxy rodando Android. A lista de aplicações disponíveis no Android Market é imensa, e a maioria é gratuíta.
————————————————————–
App store analytics provider Distimo
yesterday published its latest report
, once again zooming in on the pricing of mobile applications across a variety of platforms.
Consistent with its previous findings, Google’s Android Market
has by far the largest share of free applications available compared to other mobile app store, but the gap is also widening.
In July 2010, 60% of all applications on Android Market were free of charge, representing an increase of 3% since May 2010 when it was 57%.
As you can tell from the graph below, that share is more than double the share of free apps on other mobile app stores, with the exception of Palm’s App Catalog (albeit barely).
The share of free applications is smallest on Windows Marketplace for Mobile (22%), followed by the Apple App Store for iPad (26%) and RIM’s BlackBerry App World (26%).
(click image for full size)
Let’s take a closer look at the prices of paid apps across mobile application stores.
Distimo posits that the average price of the 100 most popular apps in Android Market and Palm’s App Catalog is higher than the average price of the entire catalogue of applications.
While the average price of all applications is only 16% higher in the Apple App Store for iPad than in the App Store for iPhone, the average price of the 100 most popular applications is nearly three times as high in the former.
More than 60% of applications are priced below or equal to $2 in the App Store for iPhone, Android Market, Nokia’s Ovi Store and Palm’s App Catalog. The proportion of applications priced
below or equal to $2 is much lower in the App Store for iPad and Windows Marketplace for Mobile.
Notably, it seems prices of apps for iOS devices are on the rise. The proportion of paid applications priced below $1 on the Apple App Store for iPad and Apple App Store for iPhone has decreased in both in July 2010, from 30% to 25% and from 49% to 45%, respectively.
(click image for full size)
(click image for full size)
Como manter um blog (para estudantes de doutorado)
24/08/10
Para tentar tirar um pouco da poeira do blog, replico aqui o post de Matt Might sobre como manter uma atividade de escrita mesmo fazendo um PhD, trabalhando e cuidando da família.
————————————————————————
“I don’t have time,” is the worst excuse not to blog.
Yet, I hear it often from fellow academics.
My advisor from grad school recently asked, “How can you write tons of papers and grant proposals, teach your classes, advise students, take care of your family and still have time to blog? Where does that time come from?”
Embedded in his question is an assumption that blogging has to take time.
Were this true, I couldn’t recommend it Ph.D. students or pre-tenure profs.
The secret to low-cost academic blogging is to make blogging a natural byproduct of all the things that academics already do.
- Doing an interesting lecture? Put your lecture notes in a blog post.
- Writing a detailed email reply? “Reply to public” with a blog post.
- Answering the same question a second time? Put it in a blog post.
- Writing interesting code? Comment a snippet into a post.
- Doing something geeky at home? Blog about what you learned.
I’ll save an argument for the benefits of academic blogging for another post. For now, I’ll argue that those benefits need not be high to overcome the cost.
Read below for my efficient blogging strategies.
Tip 1: Lecture as post
A favorite gripe of junior professors is that teaching is a waste of their time.
Excellence in teaching buys no credit for tenure at many universities.
(Of course, putrid teaching can derail a tenure case.)
Teaching is an opportunity to convert lecture notes into blog posts and external evangelism. The conversion usually polishes a lecture too.
It’s hard to teach a class without creating lecture notes.
Why not write those lecture notes as a blog post?
Examples
- First-class macros in meta-circular evaluators.
- A lambda-calculus interpreter in C++ templates.
- Compiling Scheme to C.
- Compiling Scheme to Java.
Tip 2: “Reply to public” as post
Many of the academics that “don’t have time to blog” seem to have plenty of time to write detailed, well-structured replies and flames over email.
Before pressing send, ask yourself, should this answer be, “Reply,” “Reply to all,” or “Reply to public”?
If you put effort into the reply, don’t waste it on a lucky few. Share it.
Of course, “reply to public” is not limited to email. A few of my recent posts started on Quora. If I still used Usenet, I bet the same would be true there.
Examples
- This post.
- 3 qualities of successful Ph.D. students.
- Greasemonkey scripts for Apply Yourself.
- Why guaranteed file compression is impossible.
Tip 3: Advice as post
I hear some questions with alarming repetition. To name a few:
- What is grad school like?
- How many years does a Ph.D. take?
- How can I get into grad school?
- How should I structure a thesis proposal?
Any question asked more than once is a candidate for a blog post.
Examples
- The illustrated guide to a Ph.D.
- HOWTO: Get into grad school.
- A thesis proposal is a contract.
- Productivity tips for academics.
Tip 4: Vented steam as post
My colleague, Suresh Venkatasubramanian, claims that the need to vent steam is his preferred reason for posting.
Blogs are a way to safely let it out, assuming appropriate diplomacy.
Examples
- The CRAPL: An academic-strength open-source license.
- American Airlines sucks.
- Why peer reviewers should use Tor.
Tip 5: Blog as code repository
I used to be great at starting coding projects, but terrible at finishing them.
That changed when I started posting code on my blog.
Posting my code on my blog forces me to do three things:
- It makes me refactor my code into a clean design.
- It makes me comment my code sufficiently.
- It makes me search for the most concise solution.
I’ve stopped rewriting code, because I reuse the code I post on my blog.
At the same time, I’ve picked up months-old projects and continued them.
Now when I write code, I look for ways to turn parts of it into a blog post.
Examples
- Matching regular expressions with derivatives.
- A nonblocking lexing toolkit based on derivatives.
- A pipelined nonblocking webserver in Scala.
- A reference implementation of k-CFA.
Tip 6: Blog as long-term memory
There are lots of things I used to know, but forgot.
When I find myself relearning something for the second time, I write a blog post on it, so that I won’t have to relearn it again.
I often write these up as a HOWTO.
Examples
- HOWTO: Create native iPhone apps in JavaScript.
- HOWTO: Make cat 5 network cables.
- HOWTO: Rip a DVD.
- HOWTO: Create an online book catalog.
- HOWTO: Fix mold and allergy problems.
A few more tips
I have a few miscellaneous tips for busy academic bloggers:
- Don’t blog before a deadline.
- Don’t post too frequently.
- Don’t feel pressure to post with regularity. Twitter and RSS can alert your readers.
- Don’t spend too much time on a post. It doesn’t have to be as polished as something you submit for peer review. I don’t even spell-check.
- Do store up posts if you have free time. Release when you’re busy.
- Don’t submit your own work to social news sites. If you write well enough, others will do it for you.
- Don’t feel the need to have comments. I get plenty of constructive, meaningful interaction with my readers over twitter and email.
Academic blogs I like
- Dave Herman’s The Little Calculist. I point this out to my students as a great example of grad student blogging as note-taking. (Dave recently finished his Ph.D., but he’s given this blog to himself and to the community forever.)
- John Regehr’s Embedded in Academia. John’s posts are much more polished than mine, and they’re entertaining, educational and thorough as a result. His posts are great outreach and service to the field. He nails the post-tenure associate professor blog perfectly.
- Suresh Venkatasubramanian’s geomblog. Suresh’s blog is a great mixture of field-specialist and pan-academic writing. There’s something worth knowing in every post.
- Daniel Lemire’s blog hits topics ranging from his own research interests to broader academic concerns. He thoughtfully compresses many of his posts into small, bite-sized form.
- Dick Lipton’s blog does a major service to theory of computation, because he spends time writing engaging, thoughtful and accessible articles. Dick does the esteemed yet friendly full professor blog well.
Who needs math skills?
25/03/10
Após quase um mês de aulas no doutorado do CIN, percebi o quanto estou enferrujado em alguns princípios básicos de cálculo. Durante a minha graduação cursei 4 disciplinas de cálculo, 3 de álgebra e 1 de estatística. Mesmo assim, senti uma dificuldade enorme em acompanhar as primeiras aulas – em grande parte, pelo tempo que passou entre a graduação e o meu novo contato com o mundo dos números. Mas o principal motivo foi o simples fato que nunca precisei utilizar esses conhecimentos na minha carreira como analista de sistemas. Esse assunto veio à tona quando li o post de Alan Skorkin falando exatamente sobre os problemas que estou enfrentando agora. Vale a pena dar uma olhada.
———————————————————-
You Don’t Need Math Skills To Be A Good Developer But You Do Need Them To Be A Great One
A little while ago I started thinking about math. You see, I’ve been writing software for quite a few years now and to be totally honest, I haven’t yet found a need for math in my work. There has been plenty of new stuff I’ve had to learn/master, languages, frameworks, tools, processes, communication skills and library upon library of stuff to do just about anything you can think of; math hasn’t been useful for any of it. Of course this is not surprising, the vast majority of the work I’ve been doing has been CRUD in one form or another, that’s the vast majority of the work most developers do in these interweb times of ours. You do consulting – you mostly build websites, you work for a large corporates – mostly build websites, you freelance – you mostly build websites. I am well aware that I am generalising quite a bit, but do bear with me, I am going somewhere.
Eventually you get a little tired of it, as I did. Don’t get me wrong it can be fun and challenging work, providing opportunities to solve problems and interact with interesting people – I am happy to do it during work hours. But the thought of building yet more websites in my personal time has somewhat lost its luster – you begin to look for something more interesting/cool/fun, as – once again – I did. Some people gravitate to front-end technologies and graphical things – visual feedback is seductive – I was not one of them (I love a nice front-end as much as the next guy, but it doesn’t really excite me), which is why, when I was confronted with some search-related problems I decided to dig a little further. And this brings me back to the start of this story because as soon as I grabbed the first metaphorical shovel-full of search, I ran smack-bang into some math and realized exactly just how far my skills have deteriorated. Unlike riding a bike – you certainly do forget (although I haven’t ridden a bike in years so maybe you forget that too
).
Broadening Horizons
Learning a little bit about search exposed me to all sorts of interesting software-y and computer science-y related things/problems (machine learning, natural language processing, algorithm analysis etc.) and now everywhere I turn I see math and so feel my lack of skills all the more keenly. I’ve come to the realization that you need a decent level of math skill if you want to do cool and interesting things with computers. Here are some more in addition to the ones I already mentioned – cryptography, games AI, compression, genetic algorithms, 3d graphics etc. You need math to understand the theory behind these fields which you can then apply if you want to write those libraries and tools that I was talking about – rather than just use them (be a producer rather than just a consumer – to borrow an OS metaphor
). And even if you don’t want to write any libraries, it makes for a much more satisfying time building software, when you really understand what makes things tick, rather than just plugging them in and hoping they do whatever the hell they’re supposed to.
The majority of developers will tell you that they’ve never needed math for their work (like I did a couple of paragraphs above
), but after musing on it for a while, I had a though. What we might have here is a reverse Maslow’s hammer problem. You know the one – when you have a hammer, everything looks like a nail. It is a metaphor for using a favourite tool even when it may not be best for the job at hand. Math is our hammer in reverse. We know the hammer exists but don’t quite know how to use it, so even when we meet a problem where our hammer would be the perfect tool, we never give it serious consideration. The screwdriver was good enough for my granddaddy, it was good enough for my daddy and it is good enough for me, who needs a hammer anyway? The trick with math is – people are afraid of it – even most programmers, you’d think we wouldn’t be, but we are. So, we turn our words into a self-fulfilling prophecy. It’s not that I don’t need math for my work it’s just that I don’t really know it and even if I do, I don’t know how to apply it. So I get by without it and when you make-do without something for long enough, after a while you don’t even notice it’s missing and so need it even less – self-fulfilling prophecy.
Here is some food for thought about something close to all our hearts – learning new skills. As a developer in the corporate world, you strive to be a generalizing specialist (read this book if you don’t know what I am talking about). You try to be decent at most things and really good at some. But what do you specialize in? Normally people choose a framework or two and a programming language and go with that, which is fine and worthwhile. But consider the fact that frameworks and to a lesser extent languages have a limited shelf life. If you’re building a career on being a Hibernate, Rails or Struts expert (the struts guys should really be getting worried now
), you will have to rinse and repeat all over again in a few years when new frameworks come along to supersede the current flavour of the month. So is it really the best investment of your time – maybe, but then again maybe not. Math, on the other hand is not going away any time soon. Everything we do in our field is built upon solid mathematical principles at its root (algorithms and data structures being a case in point), so time spent keeping up your math skills is arguably never wasted. And it, once again, comes down to really understanding something rather than just using it by rote – math can help you understand everything you do more deeply, when it comes to computers. Infact, as Steve Yegge said, what we do as programmers is so much like math we don’t even realise it.
What/Who Makes A Difference

You don’t believe me, then consider this. Most of the people who are almost universally respected in our field as great programmers are also great mathematicians. I am talking people like Donald Knuth, Edsger W. Dijkstra, Noam Chomsky, Peter Norvig. But then again these guys weren’t really developers, they were computer scientists, so it doesn’t really count right? I guess, but then again, maybe we shouldn’t really talk until our output in pure lines of code even begins to approach 10% of what these people have produced. Of course, you can be successful and famous without being a boffin, everyone has heard of Gavin King or DHH. That’s kinda true (although it’s an arguable point whether or not many people have heard of Gavin or DHH outside their respective niches), but “heard of” and universally respected are different things, about as different as creating a framework and significantly advancing the sum-total of human knowledge in your field (don’t get me wrong, I respect Gavin And David, they’ve done a hell of a lot more than I have, but that doesn’t make what I said any less of a fact). How is all of this relevant? I dunno, it probably isn’t, but I thought I’d throw it in there anyway since we’re being introspective and all.
The world is getting filled up with data, there is more and more of it every day and whereas before we had the luxury of working with relatively small sets of it, these days the software we write must operate efficiently with enormous data sets. This is increasingly true even in the corporate world. What this means is that you will be less and less likely to be able to just “kick things off” to see how they run, because with the amount of data you’ll be dealing with it will just grind to a halt unless you’re smart about it. My prediction is that algorithm analysis will become increasingly important for the lay-programmer, not that it wasn’t before, but it will become more so. And what do you need to be a decent algorist – you guessed it, some math skills.
So, what about me? Well, I’ve decided to build up/revive my math skills a little bit at a time, there are still plenty of books to read and code to write, but I will try to devote a little bit of my time to math at least once in a while, because like exercise, a little bit once in a while, is better than nothing (to quote Steve Yegge yet again). Of course I have a bit of an ace up my sleeve when it comes to math, which is good for me, but luckily with this blog, we might all benefit (I know you’re curious, I’ll tell you about it soon
).
Where Do You See Yourself In 5 Years

So, is all this math gonna be good for anything? It’s hard to say in advance, I am pretty happy with where I am at right now and so might you be, but it’s all about potential. End of the day, if you’re a developer in the corporate world you don’t really need any math. If you’re happy to go your entire career doing enterprise CRUD apps during work hours and paragliding or wakeboarding (or whatever trendy ‘sport’ the geeky in-crowd is into these days) during your off time then by all means, invest some more time into Spring or Hibernate or Visual Studio or whatever. It will not really limit your potential in that particular niche; you can become extremely valuable – even sought after. But if you strive for diversity in your career and want to have the ability to try your hand at almost any activity that involves code, from information retrieval to Linux kernel hacking. In short if you want to be a perfect mix of developer, programmer and computer scientist, you have to make sure you math skills are up to scratch (and hell, you can still go wakeboarding if you really want
). Long story short, if you grok math, there are no doors that are closed to you in the software development field, if you don’t – it’s going to be all CRUD (pun intended)!
NoSQL: O fim dos bancos de dados relacionais?
12/03/10
O Digg é mais um grande nome da Web 2.0 que acaba de migrar os seus (gigantescos) conjuntos de dados do mundo relacional para o modelo “pós-relacional”, esse último conhecido como NoSQL. Eles se juntaram à empresas como Google, Amazon, e-Bay, LinkedIn, Twitter e Facebook, com o objetivo de prover níveis de performance mais adequados para as consultas realizadas em bases de dados monstruosas, típicas de aplicações da Web 2.0. Para ter idéia do problema, imagine uma consulta na base de 2 PB (dois Petabytes) do e-Bay sendo feita online por um conjunto de centenas ou milhares de usuários simultaneamente. Imagine agora fazer um join com essa quantidade toda de linhas em tabelas de um banco relacional.
A estratégia do Digg está descrita em dois posts no blog do serviço. O primeiro fala sobre as dificuldades de escalabilidade da infraestrutura de banco de dados, baseada em uma solução mestre-escravo particionada um servidor MySQL. O texto mostra um exemplo de um a consulta com join que levava 14 segundos para ser completada. Após a migração para um datastore não-relacional, baseado no modelo distribuído do Cassandra, a mesma consulta pôde ser realizada em menos de um segundo. O segundo texto fala sobre a migração completa dos principais serviços do Digg usando o Cassandra e ainda lista as principais contribuições da equipe de desenvolvimento para o projeto.
O Futuro de Java
09/03/10
Interessante post de Eric Bruno sobre o futuro de Java como plataforma e linguagem de programação. O post original pode ser visto aqui. Um dado curioso extraído do texto é sobre a quantidade de linguagens dinâmicas que atualmente utilizam a JVM para rodar. A lista inclui Rexx, Ruby, JavaScript, Python, PHP, Groovy, Clojure e Scala.A justificativa para esse movimento é a melhora sensível na execução das aplicações através de recursos como os compiladores Just-In-Time da plataforma.
Apesar de muita gente nos últimos meses ter começado a fuçar outras linguagens em substituição a Java (eu me incluo nesse meio), a linguagem ainda é a mais utilizada pelos desenvolvedores, com mais de nove milhões deles construindo aplicações para as mais variadas plataformas e dispositivos. Um fato que assustou a comunidade Java foi a recente compra da Sun pela Oracle e as incertezas no futuro da plataforma geradas pela aquisição. Os caras da Oracle se comprometeram a manter o Java Community Process como o fórum de discussão e evolução da plataforma e adiantaram ainda que a nova versão (chamada provisoriamente de Java 7) trará algumas mudanças significativas, incluindo a modularização da JVM, o suporte nativo à outras linguagens e melhorias no suporte ao processamento com vários núcleos. A integração da JVM com o JRockit da BEA levará a criação de um novo mecanismo de garbage collection, trazendo alguns benefícios adicionais de performance para as aplicações.
Eric também prevê que o sofrimento atual dos desenvolvedores de aplicações para web na criação de interfaces com o usuário, deverá ser amenizado quando ocorrer a evolução natural das novas versões de JavaFX. Confesso que não me animei muito em estudar essa nova API, e atualmente estou estudando e desenvolvendo uma pequena aplicação com o Vaadin, um framework criado como uma extensão dos componentes de GWT. Assim que a aplicação entrar no ar, eu divulgarei a URL para vocês acessarem.
Os 25 erros de programação mais perigosos
19/02/10
Na minha jornada para estudar outras linguagens de programação (para sair um pouco do mundo de Java), comecei a estudar os capítulos relacionados à segurança em Scala e Ruby on Rails. Para a primeira, eu recomendo uma lida no capítulo 3 do livro “The Definitive Guide to Lift: A Scala-based Web Framework“, voltado para construção de aplicações web usando Scala e o framework Lift. Para a segunda existe um livro inteiro dedicado ao assunto: “Security on Rails“. Mas antes de ler esses capítulos, me chamou atenção o artigo publicado pela Common Weakness Enumeration intutulado “2010 CWE/SANS Top 25 Most Dangerous Programming Errors”. Esse trabalho mostra um resumo muito bem estruturado dos principais erros de programação que tornam vulnerável uma aplicação web. A leitura do artigo é mais rápida que um livro inteiro sobre segurança e pode ser usada com um check-list para sua aplicação.
O artigo completo pode ser visto aqui. Vale a pena dar uma olhada, independente da linguagem de programação que você esteja usando.
2010 CWE/SANS Top 25 Most Dangerous Programming Errors
O Melhor e o Pior da Década
25/01/10
Eu recebo uma quantidade muito grande de informação todos os dias, normalmente via email, feeds RSS, posts no Twitter e Facebook, além dos sites de notícias que costumo visitar com alguma frequência. Filtrar tudo isso consome uma parcela considerável de tempo, apesar de ter aprendido a separar no olho o que é lixo e o que é informação relevante. Uma das minhas resoluções para 2010 foi tentar manter esse blog o mais atualizado possível, com a missão de publicar dois ou três posts por semana. Essa tarefa é pouco complicada em função das várias atividades que exerço, ainda mais com o início do doutorado do CIN previsto para Março. Mesmo assim, comecei a separar algumas coisas para publicar aqui, começando com alguns artigos e posts de outros blogs.
Para iniciar essa série, dei uma olhada no post de James Turner, publicado final do ano passado no O’Reilly Radar, com uma lista das melhores e piores coisas que apareceram em TI ao longo dessa última década. A lista de Turner incluía entre os avanços uma série de tecnologias bem consolidadas. Para entender o porquê da lista, basta imaginar como vivíamos sem essas tecnologias em 2000 e como elas estão onipresentes em nossas vidas agora. Segue a lista das melhores:
- AJAX: possibilitou uma melhoria sensível na experiência do usuário e em questões relativas à usabilidade das aplicações voltadas para Web 2.0. Sem ela, provavelmente não teríamos algo como Gmail, Orkut, Twitter, Digg, entre um monte de outras aplicações “user-centric”.
- Twitter: na visão de Turner, a verdadeira essência do que ele chamou de “web logging”. Mas ele alerta que os maiores benefícios do uso do Twitter ocorrem quando combinado com outras aplicações em forma de marshups.
- WiFi ubíqua: essa eu concordo em grau, gênero e número com ele. Na visão de Turner, basta imaginar como nos conectávamos à internet no começo da década e como o fazemos agora. É cada vez mais comum (talvez nem tanto aqui no Brasil), permanecer o tempo todo conectado em restaurantes, aeroportos, shoppings e mais um monte de outros lugares.
- Smartphones: imagine o seu telefone em 2000. Imagine-o hoje. A inclusão de itens como câmeras digitais, acesso à redes sem fio e 3G, aplicativos, jogos, entre outros, mudou o conceito do que conhecíamos como um telefone celular. E eles ainda continuam fazendo ligações para outros celulares
. - A cultura do “Do It Yourself”: hoje em dia é fácil ter a sua própria estação de TV (veja Justin.tv, por exemplo), o seu próprio jornal (esse blog é um exemplo
), a sua própria estação de rádio (veja a Last.fm). Uma das coisas mais interessantes que eu vi recentemente é a possibilidade de publicar o seu próprio livro (em papel e PDF) completamente de graça. Dê uma olhada no site da Lambert Academic Publishing e veja como publicar a sua dissertação ou tese na faixa. - Popularização do Open Source: você está lendo esse blog através de uma infraestrutura de software 100% open source. Grandes corporações mantém servidores, aplicações e um mundo de tecnologia por trás disso, todos baseados em software onde o código-fonte está disponível para qualquer um alterar e testar. Como Turner diz em seu post, “se até a Microsoft está lançando aplicações open source…”, imagine que essa próxima década será a consolidação do movimento OSS (Open Source Software).
- Evolução do hardware: imagine acessar a internet usando um modem de 56 Kbps, em uma máquina com 20 MB de disco, 640 KB de RAM e um processador com clock de 2 Mhz. Pense no iPhone que você tem no bolso e entenda porque a evolução do hardware na última década não desmentiu a Lei de Moore.
Em seu post, Turner também lista uma série de decepções e falácias do mundo tecnologia:
- SOAP: só quem precisou configurar um arquivo WSDL para um web service sabe o sofrimento que é utilizar tecnologias baseadas em SOAP.
- A guerra de propriedade intelectual: aqui no Brasil a onda de processos em cima dos usuários que baixam conteúdo protegido por direitos autorais ainda não chegou com força. Mas lá fora tem gente indo para cadeia por fazer download de músicas e filmes. Ainda bem que existem iniciativas como as do Radiohead, Nine Inch Nails, CSS, e um monte de gente boa que distribui o seu trabalho de graça na Web.
- O culto ao Scrum: Apesar de muita gente achar que as metodologias ágeis são a salvação da engenharia de software, só com muito suor e disciplina se consegue praticar tudo o que o Scrum prega. No ano passado, tirei a minha certificação Scrum Master, mas admito que existem várias barreiras culturais que impedem a adoção das práticas “puras” do Scrum. Mesmo assim, sou adepto de algumas coisas que Alexandre Magno chama de “Scrum, but…”. Em resumo, acho Scrum fantástico, mas sem extremismos.
- O fim dos fins de semana: TI é uma área com um nível de stress alto em relação à outras profissões. Todas as maravilhas citadas por Turner têm um efeito colateral quando colocadas em conjunto. A nossa casa passou a ser uma extensão do escritório. Estamos conectados o tempo todo e isso implica em muito trabalho para fazer nos fins de semana. Como se já não bastasse a pressão enorme para entregar software no prazo, funcionando e com alto grau de reuso…
O artigo completo pode ser visto aqui.
A velha rotina do Ubuntu
03/11/09
A cada seis meses, mais especificamente em Abril e Outubro, eu tenho uma estranha rotina: investir horas dos meus fins de semana para fazer o meu notebook funcionar após atualizar o S.O. com a última versão do Ubuntu. A lista de problemas já é bem conhecida minha: o acesso à rede sem fio deixa de funcionar, o plugin do Firefox para suportar vídeos em flash precisa ser reinstalado, o som do Skype precisa ser reconfigurado, um monte de pequenas aplicações precisam ser atualizadas na mão (a Canonical restringe a atualização de um monte de programas), entre outras coisas menores.
Como usuário veterano de Linux, acho normal passar algumas horas recompilando drivers, alterando arquivos de configuração, etc. É um preço que se paga por ter um S.O. estável e seguro. O problema é quando a coisa foge completamente de controle, como aconteceu com a versão 9.10, lançada em 29/10. Provavelmente esse release será conhecido como a pior coisa que a Canonical colocou no ar, desde que começaram as distribuições do Ubuntu a cada seis meses. Em um artigo publicado no The Register, com o singelo título de “Early adopters bloodied Ubuntu’s Karmic Koala“, foram citados os dados de uma enquete que apontam que 20% dos usuários encontraram problemas na atualização de difícil resolução. Em outro post do mesmo jornal, alguns usuários especializados sugerem que se espere pelo menos um mês para fazer a atualização, tempo considerado crucial para a Canonical corrigir as besteiras incorporadas nessa versão.
Os problemas da 9.10 vão desde o não reconhecimento do HD, passando por incompatibilidades com o chipset gráfico (que não existiam na 9.04, claro), chegando a questões de segurando envolvendo a arquitetura de criptografia do S.O. No meu caso, além dos velhos problemas conhecidos (vide o primeiro parágrafo desse post), dessa vez tive que lidar com o não reconhecimento de minhas placas de rede e um travamento irritante causado por interrupções geradas pelo kernel. Como todo early adopter de tecnologia, vou tentar mais uma vez resolver esses problemas, mas confesso que dessa vez fiquei p*** o suficiente para pensar seriamente em tentar outra distro (alguém já experimentou o Mandriva?).
Ao longo da semana eu irei postar o status da resolução dos problemas.
P.S.: e os caras da Canonical lançaram essa versão logo na semana em que o Windows 7 chegou às lojas. Belo tiro no pé…
———
Update: deixei de lado o mecanismo de atualização do Ubuntu, fiz um backup (+50GB) e instalei o S.O. do zero. O resultado foi um sistema limpo, estável e que reconheceu 100% de meus dispositivos de hardware. Só falta colocar o som do Skype para funcionar. Em resumo, não confie na atualização automática. Prefira fazer uma instalação limpa.
“Software Engineering ≠ Computer Science”, de Chuck Connell
04/08/09
Um excelente post de Chuck Connel na Dr. Dobb’s, defendendo a tese que a Engenharia de Software (ES) não faz parte da Ciência da Computação (!). Achei muito interessante o ponto de vista dele, mostrando que a ES não precisa ter um rigor matemático em suas atividades, basicamente, porque software é feito com “criatividade, visão, pensamento multidisciplinar e humanidade”. Isso me lembra alguns colegas de trabalho em um passado recente, tentando provar por fim da força que Análise por Pontos de Função é algo confiável
. O trecho onde ele fala que essas técnicas de estimativas são meramente subjetivas, devido aos fatores humanos presentes em sua formulação, é um excelente argumento na defesa de metodologias mais ágeis para tentar prever os diversos aspectos da construção de software.
Veja abaixo o post de Connell. O
—————————————–
“A few years ago, I studied algorithms and complexity. The field is wonderfully clean, with each concept clearly defined, and each result building on earlier proofs. When you learn a fact in this area, you can take it to the bank, since mathematics would have to be inconsistent to overturn what you just learned. Even the imperfect results, such as approximation and probabilistic algorithms, have rigorous analyses about their imperfections. Other disciplines of computer science, such as network topology and cryptography also enjoy similar satisfying status.
Now I work on software engineering
, and this area is maddeningly slippery. No concept is precisely defined. Results are qualified with “usually” or “in general”. Today’s research may, or may not, help tomorrow’s work. New approaches often overturn earlier methods, with the new approaches burning brightly for a while and then falling out of fashion as their limitations emerge. We believed that structured programming was the answer. Then we put faith in fourth-generation languages, then object-oriented methods, then extreme programming, and now maybe open source.
But software engineering is where the rubber meets the road. Few people care whether P equals NP just for the beauty of the question. The computer field is about doing things with computers. This means writing software to solve human problems, and running that software on real machines. By the Church-Turing Thesis, all computer hardware is essentially equivalent. So while new machine architectures are cool, the real limiting challenge in computer science is the problem of creating software. We need software that can be put together in a reasonable amount of time, for a reasonable cost, that works something like its designers hoped for, and runs with few errors.
With this goal in mind, something has always bothered me (and many other researchers): Why can’t software engineering have more rigorous results, like the other parts of computer science? To state the question another way, “How much of software design
and construction can be made formal and provable?” The answer to that question lies in Figure 1.

The topics above the line constitute software engineering. The areas of study below the line are the core subjects of computer science. These latter topics have clear, formal results. For open questions in these fields, we expect that new results will also be formally stated. These topics build on each other — cryptography on complexity, and compilers on algorithms, for example. Moreover, we believe that proven results in these fields will still be true 100 years from now.
So what is that bright line, and why are none of the software engineering topics below it? The line is the property “directly involves human activity”. Software engineering has this property, while traditional computer science does not. The results from disciplines below the line might be used by people, but their results are not directly affected by people.
Software engineering has an essential human component. Software maintainability, for example, is the ability of people to understand, find, and repair defects in a software system. The maintainability of software may be influenced by some formal notions of computer science — perhaps the cyclomatic complexity of the software’s control graph. But maintainability crucially involves humans, and their ability to grasp the meaning and intention of source code. The question of whether a particular software system is highly maintainable cannot be answered just by mechanically examining the software.
The same is true for safety. Researchers have used some formal methods to learn about a software system’s impact on people’s health and property. But no discussion of software safety is complete without appeal to the human component of the system under examination. Likewise for requirements engineering. We can devise all sorts of interview techniques to elicit accurate requirements from software stakeholders, and we can create various systems of notation to write down what we learn. But no amount of research in this area will change the fact that requirement gathering often involves talking to or observing people. Sometimes these people tell us the right information, and sometimes they don’t. Sometimes people lie, perhaps for good reasons. Sometimes people are honestly trying to convey correct information but are unable to do so.
This observation leads to Connell’s Thesis:
Software engineering will never be a rigorous discipline with proven results, because it involves human activity.
This is an extra-mathematical statement, about the limits of formal systems. I offer no proof for the statement, and no proof that there is no proof. But the fact remains that the central questions of software engineering are human concerns:
- What should this software do? (requirements, usability, safety)
- What should the software look like inside, so it is easy to fix and modify? (architecture, design, scalability, portability, extensibility)
- How long will it take to create? (estimation)
- How should we build it? (coding, testing, measurement, configuration)
- How should we organize the team to work efficiently? (management, process, documentation)
All of these problems revolve around people.
My thesis explains why software engineering is so hard and so slippery. Tried-and-true methods that work for one team of programmers do not work for other teams. Exhaustive analysis of past programming projects may not produce a good estimation for the next. Revolutionary software development tools each help incrementally and then fail to live up to their grand promise. The reason is that humans are squishy and frustrating and unpredictable.
Before turning to the implications of my assertion, I address three likely objections:
The thesis is self-fulfilling. If some area of software engineering is solved rigorously, you can just redefine software engineering not to include that problem.
This objection is somewhat true, but of limited scope. I am asserting that the range of disciplines commonly referred to as software engineering will substantially continue to defy rigorous solution. Narrow aspects of some of the problems might succumb to a formal approach, but I claim this success will be just at the fringes of the central software engineering issues.
Statistical results in software engineering already disprove the thesis.
These methods generally address the estimation problem and include Function Point Counting, COCOMO II, PROBE, and others. Despite their mathematical appearance, these methods are not proofs or formal results. The statistics are an attempt to quantify subjective human experience on past software projects, and then extrapolate from that data to future projects. This works sometimes. But the seemingly rigorous formulas in these schemes are, in effect, putting lipstick on a pig, to use a contemporary idiom. For example, one of the formulas in COCOMO II is PersonMonths = 2.94 × SizeB, where B = 0.91 + 0.01 × Σ SFi, and SF is a set of five subjective scale factors such as “development flexibility” and “team cohesion”. The formula looks rigorous, but is dominated by an exponent made up of human factors.
Formal software engineering processes, such as cleanroom engineering, are gradually finding rigorous, provable methods for software development. They are raising the bright line to subsume previously squishy software engineering topics.
It is true that researchers of formal processes are making headway on various problems. But they are guilty of the converse of the first objection: they define software development in such a narrow way that it becomes amenable to rigorous solutions. Formal methods simply gloss over any problem centered on human beings. For example, a key to formal software development methods is the creation of a rigorous, unambiguous software specification. The specification is then used to drive (and prove) the later phases of the development process. A formal method may indeed contain an unambiguous semantic notation scheme. But no formal method contains an exact recipe for getting people to unambiguously state their vague notions of what software ought to do.
To the contrary of these objections, it is my claim that software engineering is essentially different from traditional, formal computer science. The former depends on people and the latter does not. This leads to Connell’s Corollary:
We should stop trying to prove fundamental results in software engineering and accept that the significant advances in this domain will be general guidelines.
As an example, David Parnas wrote a wonderful paper in 1972, On The Criteria To Be Used in Decomposing Systems into Modules. The paper describes a simple experiment Parnas performed about alternative software design strategies, one utilizing information hiding, and the other with global data visibility. He then drew some conclusions and made recommendations based on this small experiment. Nothing in the paper is proven, and Parnas does not claim that anyone following his recommendations is guaranteed to get similar results. But the paper contains wise counsel and has been highly influential in the popularity of object-oriented language design.
Another example is the vast body of work known as CMMI from the Software Engineering Institute at Carnegie Mellon. CMMI began as a software process model and has now grown to encompass other kinds of projects as well. CMMI is about 1000 pages long — not counting primers, interpretations, and training materials — and represents more than 1000 person-years of work. It is used by many large organizations and has been credited with significant improvement in their software process and products. But CMMI contains not a single iron-clad proven result. It is really just a set of (highly developed) suggestions for how to organize a software project, based on methods that have worked for other organizations on past projects. In fact, the SEI states that CMMI is not even a process, but rather a meta-process, with details to be filled in by each organization.
Other areas of research in this spirit include design patterns, architectural styles, refactoring based on bad smells, agile development, and data visualization. In these disciplines, parts of the work may include proven results, but the overall aims are systems that foundationally include a human component. To be clear: Core computer science topics (below the bright line) are vital tools to any software engineer. A background in algorithms is important when designing high-performance application software. Queuing theory helps with the design of operating system kernels. Cleanroom engineering contains some methods useful in some situations. Statistical history can be helpful when planning similar projects with a similar team of people. But formalism is just a necessary, not sufficient, condition for good software engineering. To illustrate this point, consider the fields of structural engineering and physical architecture (houses and buildings).
Imagine a brilliant structural engineer who is the world’s expert on building materials, stress and strain, load distributions, wind shear, earthquake forces, etc. Architects in every country keep this person on their speed-dial for every design and construction project. Would this mythical structural engineer necessarily be good at designing the buildings he or she is analyzing? Not at all. Our structural engineer might be lousy at talking to clients, unable to design spaces that people like to inhabit, dull at imagining solutions to new problems, and boring aesthetically. Structural engineering is useful to physical architects, but is not enough for good design. Successful architecture includes creativity, vision, multi-disciplinary thinking, and humanity.
In the same way, classical computer science is helpful to software engineering, but will never be the whole story. Good software engineering also includes creativity, vision, multi-disciplinary thinking, and humanity. This observation frees software engineering researchers to spend time on what does succeed — building up a body of collected wisdom for future practitioners. We should not try to make software engineering into an extension of mathematically-based computer science. It won’t work, and can distract us from useful advances waiting to be discovered.”
Tutorial de Scala – Parte 1
25/07/09
Scala é uma linguagem de programação que adota o paradigma funcional, tendo como principal característica a execução de seus scripts através de uma máquina virtual Java (JVM). Scala é enquadrada na categoria das linguagens dinâmicas, com forte integração com as bibliotecas criadas para a plataforma Java.
As Origens
Em paralelo a todo esse trabalho em cima de generics, Odesky começou a criação de uma nova linguagem de programação em 2001. A linguagem era a Scala e foi utilizada como referência para as suas aulas no EPFL. Em 2003, a linguagem teve o seu primeiro release disponível para a comunidade de programadores. Em 2006, a versão 2.0 de Scala foi lançada e vem evoluindo rapidamente com a colaboração de Lex Spoon, Burak Emir, Adriaan Moors, Philipp Haller, entre outros. Odesky continua como líder do projeto e principal commiter das alterações significativas na linguagem, atualmente em sua versão 2.7.5.
Pré-requisitos
O próximo passo é baixar a última versão do Scala no endereço http://www.scala-lang.org/downloads. Essa opção não é necessária se você decidir usar a linguagem a partir de uma IDE, como o Eclipse. Para maiores detalhes dessa opção veja a seção “Instalando Scala no Eclipse”.
Instalando Scala
A maneira mais simples e recomendável para instalar Scala é utilizar a ferramenta lzPack, disponível na página de downloads da linguagem. Esse utilitário está disponível em http://www.scala-lang.org/downloads, e a sua execução é relativamente simples, independente do sistema operacional utilizado.
Para os usuários do Windows, certifique-se que o JDK tenha sido instalado corretamente, com a varíavel de ambiente JAVA_HOME devidamente configurada. Em seguida, basta dar um duplo clique no arquivo scala-2.7.x.final-installer.jar e verificar se a tela mostrada na Figura 1.1 apareceu normalmente.

Para os usuários das várias distribuições Linux, o processo é basicamente o mesmo. Baixe o instalador e execute-o com o comando sudo java -jar scala-2.7.x.final-installer.jar. Se você não estiver utilizando um ambiente gráfico (Gnome ou KDE), o instalador irá executar em modo texto. De forma semelhante, siga as instruções até completar todo o processo de instalação. Para usuários do Ubuntu, ainda é possível instalar Scala a partir do utilitário apt-get ou do gerenciador de pacotes Synaptic. Para instalar em linha de comando digite sudo apt-get install scala.
Para verificar se tudo correu sem problemas, abra uma janela de prompt (ou terminal no Linux) e digite scala no Windows ou ./scala no Linux. Deverá ser exibida uma tela semelhante à Figura 1.2 abaixo.

Figura 1.2 – Executando Scala
Para sair da ferramenta de linha de comando do Scala, digite exit.
Uma alternativa para os usuários da IDE Eclipse é fazer a instalação do Scala diretamente dentro dessa ferramenta de desenvolvimento. Essa opção apresenta algumas vantagens para o uso regular de Scala como linguagem de programação, como por exemplo, o uso de um editor de código sensível ao contexto, recursos de autocomplete, marcadores de erros, indentação do código, entre outras características típicas de ambientes integrados de desenvolvimento.
Durante a escrita desse capítulo, utilizei a versão mais recente do Scala IDE para o Eclipse 3.5 ou superior (as versões mais antigas do Eclipse executam esse plugin com várias restrições). Para instalar o plugin para essa versão do Eclipse, vamos utilizar a ferramenta de instalação da IDE. Após entrar no Eclipse, navegue pelo menu Help, e escolha a opção Install New Software. Após a exibição da tela de instalação, no campo Work with, digite a URL do repositório do plugin: http://www.scala-lang.org/scala-eclipse-plugin e clique em Add. A tela mostrada na Figura 1.3 deverá ser exibida.

No campo Name marque a opção Scala e clique em Next, seguindo o processo de instalação até o fim. Para testar a instalação, crie um novo projeto, clicando em File -> New ->…-> Scala Project. A tela mostrada na Figura 1.4 é apresentada. Digite o nome do projeto como Hello e clique em Finish.

object HelloWorld { def main(args : Array[String]) : Unit = { println(”Hello World Scala!”) } }

Figura 1.5 – Executando a aplicação
Instalando Scala no Netbeans
Durante a escrita desse capítulo só existiam plugins Scala para o Netbeans em estágio de desenvolvimento, o que pode ser fonte de erros e chateação para quem for utilizá-los. Como pré-requisito principal para instalação, é exigida a versão 6.7 do Netbeans ou superior. Para iniciar a instalação, baixe a última versão do plugin da URL http://sourceforge.net/projects/erlybird/files/nb-scala/nb-scala%206.7v1/nb-scala-6.7v1.zip/download. Descompacte o plugin em um diretório de sua máquina e entre no Netbeans. Escolha a opção Ferramentas -> Plugins. Clique na aba Baixados, selecione todos os arquivos com extensão .nbm e instale o plugin do Scala a partir do diretório onde ele foi descompactado.
Para testar a instalação, crie um novo projeto Scala escolhendo as opções Arquivo -> Novo Projeto. Em seguida, escolha Scala e Scala Application e pressione Next. No campo Project Name digite Hello e confirme. Para o nosso exemplo simples do HelloWorld o Netbeans já cria um objeto Main, com o código necessário para imprimir o texto. Clique no objeto e execute-o. Deverá ser mostrada uma tela semelhante à da Figura 1.6, com a execução da aplicação.



