TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Mind at Work: Guido van Rossum on how Python makes thinking in code easier

11 点作者 pauloxnet超过 5 年前

1 comment

moksly超过 5 年前
We recently picked up python, mostly by accident. We had some really shorty formatted XML. We’re talking no-schema because nodes of the same type contain different elements. No consistency. Some nodes used differently from each other depending on the purpose and three different model-trees dropped into one giant mess, not at random but at datapoint entry but without the time stamp.<p>C# just couldn’t handle it, none of the libraries we tried could and when we wrote our own it was just hopelessly inefficient. Enter python and everything was as simple as telling python which element value&#x2F;text&#x2F;whatever they decided to store the data in and you’d get it. 200 lines of code later and a 5 second runtime we had our data in neatly store objects in a couple of dictionaries.<p>At that time we could have dumped it onto our SQL cluster and let C# take over, but the programmer in charge decided to just go at it with python. Mostly for the heck of it. A few weeks later he had replaced a major SSIS service and multiple C# services with some relatively simple python that cut the total runtime from 30 minutes to 5.<p>I’d never written a line of python before this, but reading the code, I understood everything to the point where I’d feel comfortable maintaining&#x2F;expanding it, with very minuscule help from the documentation (and google).<p>I don’t personally have that much love for dynamic types, and I’m not sure how we would use it, if we needed to run it outside our environment, but the experience perfectly highlights how python won and repeatedly continues to win our hearts.