惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tor Project blog
B
Blog RSS Feed
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
罗磊的独立博客
GbyAI
GbyAI
N
Netflix TechBlog - Medium
博客园 - 司徒正美
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
W
WeLiveSecurity
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
SecWiki News
SecWiki News
V
Vulnerabilities – Threatpost
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Register - Security
The Register - Security
Cisco Talos Blog
Cisco Talos Blog
Martin Fowler
Martin Fowler
A
About on SuperTechFans
S
Security @ Cisco Blogs
T
Tenable Blog
C
Check Point Blog
N
News and Events Feed by Topic
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Attack and Defense Labs
Attack and Defense Labs
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
P
Palo Alto Networks Blog
V
V2EX
博客园 - 聂微东
Project Zero
Project Zero
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Docker
N
News | PayPal Newsroom
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
小众软件
小众软件
Application and Cybersecurity Blog
Application and Cybersecurity Blog
人人都是产品经理
人人都是产品经理
V2EX - 技术
V2EX - 技术
I
Intezer
L
LINUX DO - 最新话题

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode So Far So Rust Retrying HTTP Requests with Rust A Primer on Control Charts Learning Rust Explicit is Better than Implicit: Rust for Pythonistas Using Custom Delimiters in Jinja Templates TIL: Creating Fixed Length Iterables in Python Documentation Without Assumption Vagrant Learning Golang No, A Virtual Machine Is Not Enough: Why Developers Need Native Linux Empathy in Tech For Those Who Came in Late A Weekend With PostgreSQL TIL: Gooey and Python Fire for Quick GUIs and CLIs TIL: 2ality - Dr. Axel Rauschmayer's JavaScript Blog TIL: MassDNS - High-Performance Bulk DNS Lookups TIL: Matomo Analytics, Google Tech Writing, Memory Programming, and NES TV Signals TIL: MontyDB - MongoDB Implemented in Python Returning to the Craft of Programming TIL: CPUFetch, OneFetch, and Learn CSS TIL: DNS Performance Testing and Pi-hole with Unbound TIL: Eli Bendersky's Blog, Awesome By Example, NoCoDB, and Martin Kleppmann TIL: CRDTs, Extreme HTTP Performance, and BYTEPATH Game TIL: AutoInvent, ASGI, Python Packaging, RAPIDS GPU Computing, and FlaskCon TIL: MangaDesk - Terminal Client for MangaDex TIL: McFly - Smart Shell History Search TIL: Siege Load Testing and Awesome FastAPI Resources TIL: Ventoy Bootable USB and Justniffer Network Analysis TIL: CLI Code Review, Git Split Diffs, and Internal Combustion Engine TIL: Benford's Law, Web Security Headers, Event Sourcing, and Mozilla Security Guidelines How to Write Documentation - The README.md File The Importance of Documentation TIL: NNgroup UX Research, SponsorBlock, and Labella Python Library TIL: The Little Book of Rust Macros and Rust Performance Book TIL: Git-Bug Distributed Issue Tracker and Omni Kubernetes Monitoring TIL: Zellij - Modern Terminal Multiplexer TIL: How Discord Handles 2.5 Million Concurrent Voice Users TIL: Volumio - The Audiophile Music Player TIL: Areopagitica - Milton's Defense of Free Speech TIL: Fast Node Manager, Zoxide Smart CD, Technical Writing, PyO3, and Qubes OS TIL: Slurm Workload Manager for HPC Clusters TIL: Data Visualization Guide and Oso Authorization Academy TIL: CORS Deep Dive, Piku Tiny PaaS, Rust Strings, and Deno Standard Library TIL: Raspberry Pi OS Development, Vim Beginner Guide, Password Management, and QueryBook TIL: uBlock Origin Performance Optimization on Firefox TIL: Breaking PostgreSQL at Scale and LeetCode Problem Patterns TIL: Awesome Tmux Resources for Terminal Multiplexing TIL: Grit - A Multitree-Based Personal Task Manager TIL: Lens 4.2 Kubernetes IDE, Shell Scripting Guide, and Dark HTTP Server Do The Job You Hate So You Won't Hate The Job You Love TIL: Innernet VPN Solution and NoteCalc Calculator App TIL: Argo CD for GitOps and Lens Kubernetes IDE TIL: Modern Rust CLI Tools - System Monitoring, HTTP Requests, and DNS TIL: tz - A Time Zone Helper Tool TIL: Distributed Systems Education, Fallacies, and Self-Hosted Internet Archiving TIL: Real-Time Voice Cloning Technology TIL: ChartMuseum for Helm, AMD's Corporate Journey, and Kubernetes Pod Scaling TIL: Docker and Kubernetes Tools - Whaler, Descheduler, and Dive TIL: Post-Mortem Collection, Terminal Plotting, and Technical Twitter TIL: Dark Mode Toggle Web Component by Google Chrome Labs TIL: Python eval(), exec(), and compile() Functions TIL: Camelot PDF Tables, PostgreSQL Row Level Security, Zerodha Varsity, and Write Yourself a Git TIL: fuser Command for Process and File Investigation TIL: i Hate Regex - The Ultimate Regex Cheat Sheet TIL: Dolt - Git for Data and Database Version Control TIL: x86 Assembly Programming and SafeEyes Break Reminder TIL: Comprehensive Distributed Systems Reading List TIL: Cosmopolitan C Library, Distributed Systems Book, High Performance Browser Networking, and Rust Roguelike Tutorial TIL: ABlog for Sphinx - Documentation as a Blog Platform
Python - A Reflection in 2022
2022-01-07 · via Stonecharioteer on Tech

I built my career on Python. In 2014, I had to make a decision. It was between either choosing to learn Ruby or Python. I was helping to create a tool and process for a team of content writers at Flipkart – I was a content writer there, and I’d used Excel for it at first, until Excel couldn’t handle the queries anymore. I called my friend who recommended Python. I learnt Python, almost over the course of a weekend, and I was making a PyQT4 application in a few weeks.

I knew nothing about software development. I was using Github to store the code, this was a personal project. And I was having fun. It was enjoyable, really. Then I installed Python on all my colleagues’ laptops, and my application ran. I eventually found PyInstaller and gave them all executables instead. It was really fun.

Somehow, I wonder if the entrypoint to Python has changed in the years since. I still like the language – it’s still my primary source of income. However, something about it seems to have changed at a fundamental level.

I didn’t learn about virtual environments until a long time later. I was using Python 2.7, since I learnt from Zed Shaw, who was a staunch opposer of Python 3 for the longest time. I didn’t need any of that.

Today, if someone came to me and asked me about getting started with Python, what would I tell them? Would it be the same things I experienced, or would I overwhelm them with unnecessary tooling?

The Complexity Problem

What’s the best way to install Python on your machine? I no longer run sudo apt-get install python python-pip. I don’t remember the last time I had to use get-pip.py. I have used miniconda, Anaconda, asdf, pyenv, and poetry. Right now, I like asdf, but I have a feeling I won’t use it too long. That deserves a post in and of itself really.

What’s the best way to manage dependencies? Is it creating a virtual environment and capturing the dependencies in a requirements.txt file, or perhaps you’d like to use poetry to do that and store only your direct dependencies in a pyproject.toml file? Maybe you’ve heard of pip-tools and want to use a requirements.in file which you can then use to generate a requirements.txt. Or do you want to write the requirements file yourself? Have you heard how nodejs, Rust and other languages generate a .lock file or with the hashes of the dependencies so you’re safer when using other registries? Maybe someone has told you you should be looking at the output from dependabot when you get an alert about malicious packages or packages with vulnerabilities.

And deployment. How do you deploy? Do you recreate your development environment in a cloud server? Perhaps you have a nice little shell script that does this. Or maybe you’ve heard of Ansible, to automate this. Or maybe Packer. Or maybe your company has its own deployment tool. Do you use Docker or Kubernetes? Do you still use Docker or should you use Podman? And how do you build a Docker image anyway? Should you redo the steps you’re doing on your laptop on your container or should you just use a version-tagged python container and then install packages at a global level because the container runs in an isolated environment, using something you’ve heard called cgroups?

Isn’t this exhausting? I find it to be. It wasn’t this way before. And I’ve still not spoken about Typing and uploading your .tar.gz or wheel file to pypi.org. And I’ve not spoken about Python versions yet.

What Happened to the Zen?

What’s even going on in the Python world? Somehow, the language is becoming less enjoyable to me. I remember having so much fun with it. What happened to the Zen of Python.

There should be one– and preferably only one –obvious way to do it.

What happened to that? As it stands, these are only the ways I remember off the top of my head. I haven’t spoken about virtualenvwrapper or pipenv or the deadsnakes PPA for Ubuntu. The role of all these tools is to make things easier, so why does it feel so tiresome? I cannot imagine how it must feel as a newcomer to this world. Do bootcamps cover all this? They’d lose me on day 1. I have been in the business of mentoring younger developers and students who reach out to me for help, and I never really tell them all this stuff. It seems tiresome to me, and I cannot imagine what they must feel.

Looking at Alternatives

In the last few weeks I’ve been learning Golang and I admit, I’ve had the longest resistance to Golang. I wanted to, want to, learn Rust instead, but Go is more popular, and it’s easier to convince people to pick it up as opposed to getting them excited about Rust. I still want to learn Rust and build things with it, but I want to use Golang for whatever I’ve been doing with Python.

gopls has been a sheer joy to use with Neovim, and I’ve never had that sort of experience with Python, even though I use pyright.

Back to Basics

But I still love Python. It’s been my main language for about 8 years now. I didn’t know any other language enough to build things with before it. And I had fun with it. I cannot imagine even building half the things I’ve built with Python in any other language. But I feel like I want to return to the basics with it.

What does that entail? I’m not sure really. I’ve tried downloading and building versions of Python and using python3 -m venv env to create environments, but it feels too clunky a process. Or perhaps, whenever I need a new environment, I can build an entirely new version of Python, store them all in ~/python/py<version>/<project-name>, and use direnv to automatically enable/disable it when I enter the folder.

Discovery: Shims

Did you know about shims? I had been searching for something like this for ages and didn’t know what the right term was! Direnv is amazing.

The state of Python both excites and exhausts me. It’s good that there are so many tools now, but it cannot be easy. If I delve on this too much, I might end up making my own tool. It’ll end up being like the battle of the Frameworks. And for what it’s worth, I still think Flask is better than Django. I’m more attuned to doing things explicitly than having an entire framework do things for you. Call me old fashioned.