IntelliJ IDE

How IntelliJ IDEs waste disk space

I love IntelliJ IDEs. I use Android Studio for Android, PyCharm for Python, and GoLand for Go. They are powerful. I just wish they didn’t fill my 500GB disk as if there is no tomorrow. For example, with IDE settings left over from old installations. Bash 1 2 3 4 5 6 7 8 9 10 11 12 $ du -shc ~/Library/Application\ Support/JetBrains/* | sort -h ... 264M JetBrains/PyCharm2023.2 359M JetBrains/PyCharmCE2023.2 382M JetBrains/PyCharmCE2023.3 387M JetBrains/PyCharmCE2024.1 625M JetBrains/GoLand2023.2 927M JetBrains/GoLand2024.1 938M JetBrains/GoLand2023.3 950M JetBrains/GoLand2024.2 ... 5.3G total If you check inside, it is mostly “plugins” that are consuming the disk space. It is safe to delete all the old versions of the settings unless you are planning to downgrade. ...

Ship tools as standalone static binaries

Open AI is ditching TypeScript to rebuild Codex in Rust. This is a great example of why you should always ship tools as standalone static binaries using compiled languages. Reddit Comment The biggest advantage of such tools is not speed or efficiency. Rather, it is the ability to not install the full tool chain to just use a tool. Compiler provides additional safety check Compilation is an additional guardrail that reduces the likelihood of shipping non-functioning code. ...

It is hard to recommend Python in production

It is hard to recommend Python in production

I started writing in the 2010s when Python 2 was going to be deprecated and Python 3 was too early to support. Python might have died there and then but was picked up by the data science and machine learning community, so, it survived. Running Python in production comes with various gotchas though. Python is resource-intensive Let’s consider a simple Docker image containing “Hello World”. ...

Go language

How to setup Go packages under monorepo

Let’s say you want to have two Go packages pkg1 and pkg2 in a monorepo setup. Here’s what a good project structure would look like.

Go language

Generics in Go

Generics in Go were added about a year back in Go 1.18. In my experience they are great and they fix one of the biggest roadblocks in terms of writing reusable code in Go. I’ll illustrate that with an example. First, do ensure that you have at least Go 1.18 Bash 1 2 $ go version go version go1.19.1 darwin/amd64 Let’s consider a simple case of implementing a Map function in Go that maps an array (well, a slice) to another array (again, actually, a slice). ...

Go language

Inheritance in Go language

Go language does not have the concept of a class directly. It, however, has a concept of an interface as well as a struct. I’ll illustrate how this can be used to build most of the inheritance constructs that a language like Java or C++ offers.

Infinite network timeouts in Java and Go

Java made a huge mistake of having no network timeouts. A network request can block a thread forever. Even Python did the same. The language designers should have chosen some conservative appropriate numbers instead. What’s surprising is that the Go language repeated it! Here’s a simple demo