diff --git a/content/thoughts/python-loses-2nd-place-loved-language.md b/content/thoughts/python-loses-2nd-place-loved-language.md new file mode 100644 index 0000000..c31a3df --- /dev/null +++ b/content/thoughts/python-loses-2nd-place-loved-language.md @@ -0,0 +1,89 @@ ++++ +title = "Python Losing the 2nd Place on Loved Languages: A Thought" +date = 2020-06-09 + +[taxonomies] +tags = ["python", "typescript", "stackoverflow", "survey"] ++++ + +On this year StackOverflow Survey, Python lost its 2nd place in the "Most +Loved Languages" ranking to TypeScript. On our Python group, people started +wondering why. And I just thought it would be nice to post my thoughts on +the situation. + + + +Before anything, I may have do make a disclaimer saying that I do love Python, +and I think it is a great language 'cause it is very concise but also very +expressive. I don't think any other language get close to Python in doing +those points so well. + +Disclaimer done, let me explain why I think Python lost its second place in +the hearts of developers. + +## Types + +One of the first thoughts one can think when we talk about "losing a +position" in any rank is "because it got worse". But I really don't think this +is what happened here, and what actually happened is that TypeScript shown +developers something better. + +TypeScript is aimed to JavaScript development, a zone where anything goes, +types are very flexible and magical -- to the point what most of things +actually produce a [Wat](https://www.destroyallsoftware.com/talks/wat). By +using types, making sure you're not adding a string to an array, a lot of +problems suddenly disappear. It is no silver bullet, but it prevents a whole +class of issues that would popup in production. + +So, in an environment that chaotic things happen, suddenly you have something +that puts order back and you gotta love it for that. Surely, it's not just +types that make TypeScript more loved than JavaScript, but it is partially +why. + +(Just to add to this point: Rust is still the most loved language 5 years in a +row, and it uses some pretty strong typing, close do Haskell, with added +syntax closer to what most languages use.) + +I still believe that, in the long run, type hinting can fill the gap for +Python to reach the proper position. I'd love to use it to add hinting in all +functions and then have something that I could set the level of checking on +different environments: make the application crash if the function was called +with the wrong types on development environment; just log (logging or stderr) +on staging; and do absolutely nothing on production. That would allow me to +use the best of both worlds: Dynamic when developing, but static when testing. + +## Python 2 is dead + +One of the things that happened to Python in the beginning of this year, when +the survey was done, was that Python 2 became unsupported. Surely, that +doesn't mean any Python 2 installation would stop working, but it gave an +extra jump to porting things to Python 3. + +And, even with all the backporting and improvements in Python 3, it was not a +smooth sail. That change, that forced change, may have let some Python devs +with some bitter taste about the language. No one wants to just fix changes in +the language, when the way things work must still work, quirks and all. + +## Hype + +Python is not a hyped language anymore. + +Sure, it is still a reference for machine learning and related fields, but the +once thriving environment of web dev was taking by the hype of other +languages. + +Python is not the hot stuff on web dev anymore. And because it is not the hot +stuff, people don't _want_ the old stuff; the old stuff is not cool anymore, +so they don't like it anymore. + +Related: Just because something has hype, it doesn't mean it is _better_; it +just makes the non-hyped stuff "not better", even if there was no change at +all in the latest. + +## Side-point + +One point not raised by anyone in the group: Although Python lost its second +place in the "Most Loved" ranking, it is still the most wanted language -- +meaning, it is the language most developers _want_ to learn. If the general +feeling was "Python sucks!", I pretty much doubt the want would still be +representative -- and Python have a large lead compared to JavaScript. diff --git a/content/thoughts/python-loses-2nd-place-loved-language.pt.md b/content/thoughts/python-loses-2nd-place-loved-language.pt.md new file mode 100644 index 0000000..529d328 --- /dev/null +++ b/content/thoughts/python-loses-2nd-place-loved-language.pt.md @@ -0,0 +1,96 @@ ++++ +title = "Python Perde a Segunda Posição Nas Linguagens Mais Amadas: Uma Reflexão" +date = 2020-06-09 + +[taxonomies] +tags = ["python", "typescript", "tipos", "stackoverflow", "pesquisa"] ++++ + +Na pesquisa desse ano do StackOverflow, Python perdeu a segunda posição no +ranking de "Linguagens Mais Amadas" para TypeScript. No nosso grupo de Python, +as pessoas começaram a se perguntar o porque. E eu achei que seria +interessante postar minhas reflexões sobre a situação. + + + +Antes de mais nada, eu preciso fazer um aviso de que eu adoro Python, e eu +acredito que é uma grande linguagem por ser concisa mais ainda assim bem +expressiva. Eu não acredito que tenha algum outra linguagem que chegue perto +de Python nesses quesitos. + +Aviso dado, me deixem explicar porque eu acho que Python perdeu o segundo +lugar no coração dos desenvolvedores. + +## Tipos + +Um dos primeiros pontos que as pessoas pensam quando falamos de "perdeu uma +posição" em qualquer ranking é porque "ficou pior". Mas eu não acho que seja o +que aconteceu aqui, e o que realmente aconteceu é que TypeScript mostrou algo +melhor para desenvolvedores. + +TypeScript foi projetada para desenvolvimento JavaScript, uma zona onde +qualquer coisa vale, tipos são bem flexíveis e mágicos -- ao ponto de que a +maior parte das coisas produz um +[Wat](https://www.destroyallsoftware.com/talks/wat). Usando tipos, +certificando que você não está adicionando uma string a um array, um monte de +problemas desaparecem. Não que seja uma bala de prata, mas previne uma classe +inteira de problemas que iriam aparecer em produção. + +Assim, em um ambiente onde coisas caóticas acontecem, de repente você tem algo +que coloca ordem de volta e você vai adorá-lo por isso. Não que os tipos sejam +a única coisa que faz com que TypeScript seja mais amado que JavaScript, mas +pode explicar parcialmente o porque. + +(Apenas para adicionar nesse ponto: Rust ainda é a linguagem mais amada, agora +por 5 anos consecutivos, e tem uma tipagem bem forte, semelhante a Haskell, +com uma sintaxe mais próxima das linguagens mais usadas.) + +Eu ainda acredito que, a longo prazo, type hinting pode preencher essa falha +do Python para voltar a sua posição original. Eu gostaria que se eu +adicionasse hints em todas as funções e ter algo que permitisse definir o +nível de validação em ambientes distintos: Fazer a aplicação gerar um erro se +a função fosse chamada com os tipos incorretos em desenvolvimento; gerar um +warning (no logging ou no stderr) em staging; e fazer absolutamente nada em +produção. Isso permitiria que eu tivesse o melhor de dois mundos: Dinâmico +quando desenvolvendo mas estático em testes. + +## Python 2 Morreu + +Uma das coisas que aconteceu com o Python no começo desse ano, quando a +pesquisa foi feita, foi que Python 2 ficou sem suporte oficial. Obviamente +isso não significa que as instalações de Python 2 simplesmente pararam de +funcionar, mas deu um empurrão a mais para portar código para Python 3. + +E, mesmo com todas as melhorias no Python 3 para ajudar a portar aplicações, +ainda assim não foi algo completamente suave. Essa mudança, essa mudança +forçada, pode ter deixado alguns desenvolvedores Python com um gosto ruim. E +ninguém quer simplesmente corrigir problemas com a linguagem, deixando as +coisas funcionarem do jeito que estavam antes, coisas estranhas e tudo mais. + +## Hype + +Python não é mais uma linguagem "hypada". + +Ainda é a referência para machine learnign e campos relacionados, mas o antigo +ambiente de desenvolvimento web foi capturado pelo hype de outras linguagens. + +Python não é mais a "legalzisse" de desenvolvimento web. E porque não é mais a +legalzisse, pessoas não _querem_ a coisa antiga; a coisa antiga não é mais +legal, então o pessoal não gosta mais dela. + +Relacionado: Só porque alguma coisa tem hype, não quer dizer que seja +_melhor_; apenas faz com que as coisas sem hype se tornem "não melhores", +mesmo que não tenha havido qualquer alteração nesses últimos. + +## Relacionado + +Um ponto que não foi levantado no grupo: Mesmo que Python tenha perdido o +segundo lugar no ranking de "Mais Amadas", Python ainda é a linguagem mais +procurada -- o que significa que ainda é a linguagem que os desenvolvedores +mais querem _aprender_. Se o sentimento geral fosse de "Python é ruim!", eu +duvido que a procuram ainda seria representativa -- e Python ainda tem uma +liderança considerável com relação a JavaScript. + +