Live data from Hacker News

Python Is Easy. Go Is Simple. Simple != Easy

preslav.me

111–120 of 313 posts

Re: Python Is Easy. Go Is Simple. Simple != Easy

#111

Earlier quoted context omitted.

F# is basically statically-typed Python (with better performance).

I've been meaning to try it. Isn't F# modeled after Haskell?

Kinda. F# is modeled after OCaml. OCaml and Haskell are both modeled after ML. I suppose you could say they are cousins.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#112

Earlier quoted context omitted.

I will spell it out for you: Almost every language in the world has some sort of template-based autocomplete for common boilerplate that is often used, from class definition templates to if statements. If you aren't using one of these, you're probably working unproductively by thinking about all of your boilerplate instead of just taking it off the shelf. Copilot and its ilk just take this one step further by effecti…

> I will spell it out for you: Almost every language in the world has some sort of template-based autocomplete for common boilerplate that is often used, from class definition templates to if statements. Which is very conceptually simple . `sout` in Intellij creating Java `println(...)` is very simple. Completely straightforward. Unlike LLMs. - Go is simple! - Great, but it takes a while for me to produce code in Go.…

The LLM is just fancy autocomplete. You are latching on to the LLM aspect, not the autocomplete aspect, while the latter is the important part. The LLM literally just does a little more than a traditional autocomplete in real life. I said it because it's easy for people to understand what "copilot" actually does and I (wrongly) assumed people didn't go crazy when you mentioned it.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#113

Earlier quoted context omitted.

It's very simple. It's explicit and tells you exactly how errors are handled (if you care), and it follows a very common pattern that is easy to ignore when you don't want to know how errors are handled. Simple and concise are two very different things. In comparison, languages with exceptions give you a minefield around every function call.

Ok. Then I will spell it out: using an LLM to generate code is not remotely simple.

You can also just use templates for this sort of thing.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#114
post #65

Earlier quoted context omitted.

Ok, maybe you can help me figure something out that I haven’t been able to. I’ve got a project broken down into modules. Module A uses module B. These are both checked into GitHub, so the module path is something like guthub.com/distortedsignal/my-project/src/a or whatever. I need to make a change across both of these modules. Will my compilation pick up the changes? What if I need to make a backward-incompatible cha…

> I need to make a change across both of these modules. Will my compilation pick up the changes? Yes, add a replace directive to A's go.mod and point it to B's directory. It'll pick up changes immediately. You can also vendor + disable modules + change stuff in the vendor folder to quickly experiment, though IDEs tend to get moody about this. Backwards incompatible in principle: release a new major version of B. Impo…

Ok, I wasn’t able to figure that out when I was in the codebase.

What do you do if you’re working in a fork of the project and you need to make those changes?

Re: Python Is Easy. Go Is Simple. Simple != Easy

#115

I'm diving back into python after being mostly away for the better part of a decade having built high scale, highly available systems in Go during that time (including migrating several projects from python and perl to go). Being suddenly back in python is jarring. So much inheritance - abstract base classes and multiple inheritance via mixins, strange coupling in tests via over use of mocking and patching, and a rel…

Python code typically doesn't and shouldn't rely heavily on inheritance. It sounds like you're working on non-idiomatic Python code. Bad luck.

Django typically does this.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#116
post #5

Earlier quoted context omitted.

Don't forget the fact that it doesn't have this overbloated concept of inheritance and polymorphism of let's say Java where you have to look through 6 files to understand what's even going on. Even generics in Go were a heated debate because they make the language more complex. All in all Go was created by geniuses and it shows.

> it doesn't have this overbloated concept of inheritance and polymorphism of let's say Java where you have to look through 6 files to understand what's even going on Several Go codebases I've worked on would like a word. Some Go people really love their interfaces and abstractions and making sure every method is only 3 lines and pretty soon you're 20 files and three type hierarchies deep trying to figure out what a…

No one is safe from bad developers. I've seen go SDKs for paid products that were clearly written by people with only a vague idea what the target language offers. I have to assume such libraries were hammered until the compiler just accepted what was given

Re: Python Is Easy. Go Is Simple. Simple != Easy

#118

Earlier quoted context omitted.

A certain number of developers will be able to complicate any language or mechanism you provide them, it's how they feel important. I've notice the there is a group of people who has their entire identity tied up in being "smarter" than everyone else, except they aren't, so they build extremely complex systems, because they think that's what smart people do. They are interestingly often extremely well versed in their…

You are mistaken if you think that the abundant use of interfaces etc. is motivated by anything along those lines. As someone who often puts basically everything behind an interface and abstracts everything in sight, it's not because it has anything to do with being smart, quite the opposite; it's the only way I can keep any meaningful portion of the code in my head. Give me a 5000-line straightforward / unabstracted…

This is me as well.

Another reason for me for having interfaces is simple mocking in tests.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#119

Earlier quoted context omitted.

I mean it's not like MATLAB where a company put in millions of dollars to make these libraries - the entire ecosystem was developed by open source contributors because they liked something about Python - sure, it's probably not as sophisticated as some of the other languages, but it has a low barrier of entry, it has users, and people developed libraries - in some cases because that's where users are and in many case…

> they liked something about Python I think it's simply what they already knew. Very few programmers learn multiple languages to any kind of depth. Is there any evidence that Python is an easy language to learn? I think we've reached a situation where beginners learn Python because it's seen as beginner friendly... because beginners learn Python!

It's definitely easier than many other languages to start learning. Absolute beginners don't want to worry about overflow, signedness, or anything like that. They just want to add some numbers and have it work. Python isn't perfect by any stretch, but having syntax like "for x in y:" goes a long way towards helping beginners not have to care about stuff they're not ready for yet.

Admittedly, that's just an opinion. I don't know of any relevant studies, but Python wasn't always the preferred language for beginners, and it changed at some point. It feels like there must be a reason for that.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#120

JS is both

I also enjoy the simplicity of JS.

Pros:

* Being single threaded makes concurrency simple. No need to think about mutex/semafor/channel/etc.

* Everything is a pointer so no debate on whether to use pointer vs value for variable

* Not to many reserved keywords to learn before being able to write javascript

* I like async/await

Cons:

* Tiny standard library

* Very little standardization between projects

* JS is often compiled/minified which can make debugging painful

* Not so performant. Can't do true concurrency

Post reply on HN