HNHacker News
TopNewBestAskShowJobs

coutego

183 karma · joined January 10, 2022

submissionscomments
coutego··on Lisp-stick on a Python
Well, you need to think that LISP was a thing already before 1960. The only competitor at the time was FORTRAN. Even C was introduced more than 10 years later.

LISP had garbage collection and was designed for symbolic manipulation. Given that programs were just list of symbols, it was fully meta, from the beginning. This gave it a raw power that was decades ahead of time. Even nowadays, this malleability give Lisp languages the power to provide as libraries things than in most languages would require the modification of the language itself. For example, there is library for Clojure (a popular modern Lisp which runs on the Java and Javascript virtual machines) that adds type support. Think about that. Yes, I know. Mypy adds types to Python, but in the case of Clojure the language and runtime didn't need to be touched at for the library to work. You can basically do whatever you want as a library, because the core of the language is so powerful.

Another distinct characteristic of Lisps was the possibility to treat programs as living things you can just "talk to" through the REPL. Programs are developed in a more "conversational" way than with languages such as Java, Rust, etc. Some would say that this is a superpower and other would say that it's of marginal value. It just depends on the personal preferences.

Now, we are in 2022. Obviously, languages have evolved a lot and they are ridiculously more advanced that FORTRAN. Lisps don't have a clear killer feature that can't be found in some other languages and actually they normally lack some convenient things. There is no type system for Lisps that it's practical, convenient and with tooling support. That is a big disadvantage on an era where programs are big beasts normally done by several people mostly gluing together a bunch of libraries with big APIs that you need to explore somehow. Typed languages with accompanying IDE tooling (i.e. having a language server) offer a much quicker and effective way to develop than spending the day reading API docs.

Now, should you learn a Lisp in 2022? Well, I think there are some advantages of doing so. They have a lot of historical value and their simplicity and power are quite instructive, I'd say. Playing a bit with some Scheme (or Racket) can be very fun. If you are curious about Lisps and also functional programming, I'd suggest learning some Clojure. It's a very nice language and it really changes how you think about things, especially if you haven't been doing "hard" functional programming before.

Clojure general approach and concrete libraries as Reitit, Malli or Specter really can change how you look at things and give you a deeper understanding of other characteristics of your other languages of choice. It's a bit like learning some Japanese if you are a German or French speaker. It can help you understand, for example, how unnecessarily complex your verbal system is and how unnecessarily complex Japanese numbering system is. If you are a fish, it's difficult to understand what water is unless you get out of it. Maybe Lisps can be this breath of fresh air.

coutego··on You do not need inheritance with OOP
It's funny how times have changed. Spring used to be that (micro)framework that prevented your code to depend on anything framework related. And here we are now...

I have been avoiding inheritance like the plague since at least 15 years ago and enjoying the pleasure of working with Spring for the same amount of time, approximately. But nowadays looking at what people do with Spring makes me extremely sad. Every time I find people "injecting" things by using annotations I can just think "WFT? Haven't we learnt /anything/?"

coutego··on Monumental (if correct) advance in number theory posted to ArXiv by Yitang Zhang
Wouldn't Scholze be a counterexample to the thesis that young people can't do fundamental contributions?

I would say that it supports the idea that only young people are able to change the fundations of maths, while older people can still use the existing techniques to push the bord, specially on those super technical fields where experience and knowledge are an advantage.

coutego··on New EU law could force Apple to allow other app stores, sideloading, and more
No reputable company can afford to do that (as they can't in Android).

As for security, etc. nobody will force you to install any third party store (as they don't in Android). Very likely, >99% of people won't install any other store than Apple's, yet they will get the benefits of breaking the monopoly in form of reduced prices, since Apple's premium will have to be determined by the market rather than by extortion.

coutego··on Brexit: Rejoining EU takes record 14-point lead in latest poll
That ain't happening. EU would not take UK back in, much less with all the exceptions/concessions they had got from EU over the years. They had all the advantages of being in the EU while not being bound by some key obligations.

From the UK point of view the prospect of rejoining is even worse. How would anyone explain the UK public that they would be applying again for EU membership? "Hey guys, so we got out of the EU, got all this shit, lost the advantages we had and now we propose to rejoin in worse conditions and with a worse economy because of the economic damage caused by getting out of the EU (who could have expected that?)". That is not a winning argument to convince UK citizens to votes 'yes' on a EU membership application referendum...

Failing to rejoin UK could try to stay in the European Economic Area (EEA), à la Norway, or even in the EU Customs Union. This would in principle make a lot of economical sense and, in fact, the UK has all along only been interested in the single market and nothing else. But this solution is politically even worse, because it would come with the obligation to follow all the rules of the EU single market without having a saying on them, since they would not be participating in the EU democratic institutions (no seats at the Parliament or in the Council). Norway (and Iceland) doesn't lose a lot by being in the European Economic Area by doing this, since they are a small country and the power they give up is very small. But this is not the case at all for the UK. They are a big country and a big economy. It's not conceivable they would be giving up a significant chunk of sovereignty ir order to joint EU institutions while completely giving up their very significant voting rights.

UK is not rejoining the EU at the very least in the next 10 years. And even later than that, the only situation they could rejoin is if the differential of growth between the UK and the big EU economies (France, Germany) make the UK economy to significantly be left behind, which is exactly what happened in the 60s/70s and what forced the UK to joint the EU in the first place. It was obvious at the time that continuing being outside would cause the economy of the UK to continuing underperforming the economies of the EU and that is what is bound to happen now.

It's sad that UK left, but it is what it is and now they must find their own way.

coutego··on Which programming paradigm had the most impact on you as an engineer and why?
In chronological order:

- Pure functions

- TDD

- OOP

- DI

- FP idioms

- Inmutability

From these, the most important is DI. Separating the set up of runtime dependencies between parts of the software from the logical dependencies is a total game changer.

I'm curious about Erlang, which I didn't try yet, since it seems to capture almost everything in one language. Pure functions, inmutability and FP idioms on the micro level with strong OOP and separation of logical from runtime dependencies on the macro level.

coutego··on Clojure 15th Anniversary: A Retrospective
I made some toy projects and a mid sized one in Clojure, so I'm far from an expert, but tried Clojure seriously.

What you point out is exactly what I think is the main drawback as Clojure (any dynamic language, really). It gets very tedious to waste so much time refactoring code and in the increased number of unit tests you need to write in order to avoid this from happening.

Personally, I think the lack of types in Clojure (and other dynamic languages) has another major drawback in that it doesn't allow you to easily express (and take advantage of) useful abstractions. In typed languages I got used to first write a "skeleton" of the application / library / module as a set of interfaces (traits, protocols, whatever expresses contracts in your language) and then develop and tests the implementations mainly independently. I find this extremely productive, in actual terms of amount of functionality per unit of time.

In Clojure I find myself doing diagrams or writing down data structures, etc. because there is no practical way of doing that in the language itself. Yes, I know protocols, types, spec, malli, etc. but they are not nearly as clean and useful (IDE help, etc) as let's say Typescript types.

I find this lack of expressiveness very frustrating, because I love Clojure otherwise. Persistent data structures are a game changer and the power you can get from a very small, generic API is mind blowing. And the data oriented paradigm, where everything tends to be expressed as data structures which are trivial to operate on, is simple conceptually and very powerful. I even got to like the syntax a lot. Once you get used to it, it's extremely clean, elegant and even clear (!).

Being as it is, though, I'm not sure that I would chose Clojure for a large project, even if I was the only one working on it. My brain needs typed languages as soon as I have more than 200 likes of code, it seems.

coutego··on Why Canadians Can't Bike in the Winter (But Finnish People Can)
Not really. Those activities are externalised to the best bidder. Cost are high because private companies can't make it for less work _and_ because safety standards are quite high in the West (and even then you get some bridges collapsing and killing people here and there).

If you want it "cheap" then you need to apply second world standards and accept people getting regularly killed under crumbling infrastructure.

Yes, yes. I know about the money that is "lost" in bribes, etc. but that's not because the administrative state is inefficient but because politicians are greedy. In fact, one reason for externalising so much to private companies is to make it easier to get bribes or nice posts after finishing public office.

coutego··on Anti-royal protesters are being arrested in the U.K. as 'Not My King' tag grows
> It does not seem like having a "fuck imperialism" sign should ever get you arrested in a country that is supposedly one of the closest allies of the US.

Hmmmm... /s?

coutego··on Ask HN: Are you part of the Great Resignation, if so what's your story?
I don't know whether this is typical, but in my case I had 3+ years of living expenses in savings and no mortage anymore (*), so I decided to stop working for 1-2 years and just enjoy life.

In 2020 I was thinking in buying a bigger house at some point, but COVID made me realize that I can be very happy with a more modest lifestyle and that it's just not worth sacrifising my health and joy to have more money in the bank and/or a fancier house when I die. It seems obvious, I know, but it took a global pandemic for me to realise it ¯\_(ツ)_/¯

(*) I decided years ago to live well below my means and only buy a property if I could pay off in less than 8 years, rather than a fancy house that would require me to take a 20-30 years morgage. Best decision of my life.

coutego··on John Carmack: Best Programming Setup and IDE – Lex Fridman Podcast Clips
And a very good health. Doing this sedentary job for long hours and not getting issues is very difficult, unless you use most of your free time doing some sports or other intense physical activity or you have very good genetics.
coutego··on The Gödel Metric
Yes, there is such tradition. I remember one of my maths professors at the uni 25 years ago complaining about "those people that "use a model to develop their results and then hide the model when publishing them".

I think that there are multiple reasons, not only trying to be "fancier". One important one is of presentation style. Some traditions (for example, Bourbaki) insist in conceptual purity and minimalism, presenting the most abstract concepts in its distiled form. Hiding "unnecessary" details is an objective on its own in that tradition.

coutego··on A Pragmatic Guide to Getting Things Done
I had a similar experience and concluded that the most important thing is to learn to drop as many things as possible.

If the list are getting too big it just means we are trying to do too much. The objective should be to trim those list down as much as possible. Too many someday/maybe things? Well, time to decide to move them to never/surely not category (i.e. delete them or put them in the "won't do" category).

Too many things in the TODO/Next/...? Well, it's time to think whether they absolutely need to be done. If they really, REALLY do, do they need to be done by you? Delegating, asking someone to do them or just externalizing them to some service can be a possibility.

Focusing is not as much about deciding what to do as to decide what not to do. I know, they are logically equivalent things, but the main issue is that most of us are not psicologically well prepared to accept that we just won't do many things we would like to do, so we invent complex systems to keep track of what we won't have time to do and unnecessarily stress us in the process. Learning to just let go is one of the most useful things I learnt in life.

coutego··on Toying with Kotlin's Context Receivers
In my first programming job I was working on a financial application in VB6 where there were two global variables that were used to pass extra parameters. If there was something to pass which was not on the signature you would just leave it on the first variable. Sometimes that variable was already used to pass something to the current function so you would use the second one. I kid you not.

Why all this nonsense? No idea. When asking people looked at me as if I was some kind of purist. They didn't seem to even understand this was not a good idea.

Now I find myself 23 years later, after having long left all that imperative crap, getting TDD, Spring and all those niceties just to find people to come back with dynamic variables as if they were a good idea instead of a needed hack when you don't have something better. I guess next trend will be factories and singletons. I just don't get it. It's very sad.

coutego··on Toying with Kotlin's Context Receivers
+1 for "insane".

I'm honestly baffled by all this context nonsense in Scala, React and now Kotlin. Twenty years ago, Spring (among others) showed us how to do proper wiring of separate elements in a clean way. Everything was simple and crystal clear (if a bit verbose). Programming became mostly additive (rather than multiplicative) in complexity and programs could easily be broken down to pieces easy to understand and implement.

And now we are back pass parameters to functions off-band like in the times of VB6? Seriously!?

Get off my lawn...

coutego··on AltTab – Windows alt-tab on macOS
Thanks so, so, SO, much for creating this!
coutego··on Welcome to the era of the hyper-surveilled office
They only drifted "leftwards" after 2008 when they started lobbying for governments to bail out banks. Once this was done, they went back to "orthodoxy".
coutego··on Meta Rescinding Offers Now
This reminds me of the famous quote from Yogi Berra: "Nobody goes there anymore. It's too crowded."

Now seriously, there is indeed such thing as being a victim of one's own success.

coutego··on What’s Behind the Naming of TBD54566975?
> but his immense stupidity definitely did more harm than help.

Difficult to say. It is now accepted that the management of the Greece crisis and, in general, the 2008 crisis by the EU was horribly wrong. So much so that it almost destroyed it. The reaction to the COVID crisis in 2020 by the EU was exactly the opposite that in 2008, because of the lessons learnt back then. Those lessons became obvious in part because of the "noise" of people like Varoufakis or Paul Krugman, who explained at the time why the EU strategy was a mistake and what should be done instead. Time proved them mostly right.

Varoufakis' rock star attitude and insistence to stick to economic theory discussions when debating with people who were just trying to cut their own losses, rather than finding what was the correct thing to do for the common good, was probably not a winning strategy. Nevertheless, from the economics point of view (not the realpolitik point of view) it now looks he was right.

coutego··on Impressions from a first-time Mac user
Having bought my first Mac some months ago, I fully share the conclusions. Being able to install Linux in this hardware (assuming everything worked as well, including sleep/wakeup) would be ideal.

I have one very big item to put on the 'Bad' list not mentioned in the article: key shortcuts, especially those for text manipulation. I'm reading and writing emails and documents all day long. I need CTRL-LEFT (ok, SUPER-LEFT) to do the right thing and move one word at a time. Having to switch to ALT-LEFT for that is killing my productivity in MacOS /and/ in Linux and Windows (because my muscle memory is gone). It's extremely frustrating.

coutego··on Does the EU's ban on RT also ban Tor?
> except in Germany

It applies everywhere. Germany and Poland courts said that they interpret this principle is against their constitutions. The consequence is that they need to either:

- Change their interpretation of their constitution

- Change their constitution

- Leave the EU

It's a basic principle of participation in a Union. Germany's or Poland's case is the same as if a State of the US decided that some federal law or the US constitution doesn't apply in that territory because their constitution prevails or that the state supreme court can overrule the decisions of the US supreme court.

The EU case is much easier than the US, of course, because EU Member States have the right to unilaterally decide to secede. So they can always just leave if they really don't want to comply with EU laws. They have no excuse whatsoever to whine about them.

coutego··on Lenovo ThinkPad x Snapdragon: Fanless ARM ThinkPad X13s offers long battery life
But it might run Linux. I could take the hit in performance if Linux run perfectly (including hibernate, etc).
coutego··on Ask HN: Am I Misunderstanding TailwindCSS?
I think that the issue at play here is basically the same than the debate about FP vs OOP for systems architecture. One tries to encapsulate information, by distributing it, while the other tries to completely separate both.

These are differennt strategies leading to different paradigms. Looking at one from the point of view of the other will make you think they are using obvious anti-patterns and just getting it comoletely wrong. But this is somewhat an illusion, because they are in fact trying to achieve different things (or the same things with different strategies).

Classical CSS is like FP. It insists in completely separating information (HTML) and operations (CSS). This works well when you have a priory knowledge about the totality of your HTML and its internal structure. Therefore, it works well in small/simple systems or systems with a simple structure (blogs, ...). This model is favoured by designers and developers of "simple" systems (the ones with an a priori known structure).

Tailwind and similar frameworks focus in encapsulation and composability. As OOP, they make it easier to compose modules developed by different teams with little coordination between them without risking too many conflicts. They are designed for modularity and scalability. Therefore, this model is favoured by developers using component based JS frameworks like React and targetting very big systems (like FB, Amazon or any similar complex systems).

I think that, depending on the context, one paradigm can be more appropriate than the other, but it makes little sense to say that one is right and the other one is wrong as a general statement.

coutego··on Words known better by males than females, and vice versa
Not really... Not when they are the subject of the sentence instead of the direct object.
coutego··on Finding the average of two unsigned integers without overflow
Exactly. I saw the title, thought "I wonder what other way there is to do this than the obvious one of pre-dividing by 2" and then opened the article and saw that the trivial way to do it was covered by a patent.

Wow! Just wow...

coutego··on Why static languages suffer from complexity
That's exactly what I did, because I felt that I was just too sure that typed language were just superior to non typed languages without actually having proper experience.

I learnt Clojure, to the point that it's now my favourite language and the one I use for many things. Nevertheless, I still think that typed languages have two advantages that make them a more practical option for most situations:

- It's easier to evolve your code. This includes refactor but also normal program evolution through aggregation.

- It allows to express abstractions in pure code, rather than in documents or comments.

The first advantage requires little explanation. The second I think is more difficult to appreciate without enough experience with typed systems and an interface oriented programming style.

How these two things are important for a given person is difficult to say. I have come to the conclusion that it relates a lot to how your brain works. Unfortunately, mine can only track 3 or 4 things at the same time, so I need to abstract away anything else than the little piece of code I'm working on and get the compiler to worry about how things glue together.

I need the comfort of getting the compiler to help me change my hats and be able not to think about anything else that the concrete piece of code I'm working on and the interfaces of the other parts it uses. When I don't have this possibility, I miss it even more than the comfort of programming using inmutable data structures that Clojure spoilt me with. I think need to seriously try Scala 3 at some point, since it seems to combine inmutable data structures by default with an advance type system (although the lenses libraries I've seen look like an abomination in comparison with Clojure's update-in and company, not to mention the absolute elegance and triviality of the implementation of the latter: https://github.com/clojure/clojure/blob/clojure-1.10.1/src/c...).

So I would second your recommendation and encourage people trapped in dynamic language echo chambers to try for a year something like Typescript or Kotlin to appreciate other ways of doing things in languages with practical type systems. Perhaps some of them will discover that it suits them better or help them better understand why they prefer the dynamic style.

coutego··on Why Multitasking Is Unproductive and What to Do Instead
In my experience, what you need is to have a system to keep track of multiple things and be able not to multitask, but to be able to do things in a serial way. It's just much more productive and enjoyable.
coutego··on Who Uses To-Do Lists?
Every (long term) successful person I have met used todo lists.

Having a system to do things is like having good form when playing and instrument (or some sport). You can get quite far without getting the basics right, but then you hit a limit you can't get past it without fundamentally changing things. You can even get injured very easily (literally in sports, burnt out on a desk / management job) or you can just slowly become dead wood over time.

Changing how to do the fundamentals is more and more difficult with experience and age. Once you hit a plateau (or you are already overwhelmed and incapable of coping with things) most people will not be able to start re-learning to do things from scratch neither accept the hit on their productivity for a significant amount of time until they manage to do things on top of the new system.

My advice to those of you who are still young: do count on your immense energy and raw (intelectual) brute force if/as needed but please dedicate a conscious amount of time to deliberately develop a system which is sustainable and can grow with you as needed. You will need to rely on the expertise of others who have already gone very far, in the same way you need to trust your tennis trainer in how to use the racquet. You won't find out by yourself whether you are holding it wrong until you have already hurt yourself. So go and find some system like Getting Things Done or similar, learn it, use it and practice, practice and practice. If you look for role models just search for those people who are very productive in an apparently effortless and natural way. Those are the ones to learn from.

coutego··on Ask HN: How to learn about text editor architectures and implementations?
I was on the same boat many years ago, when I co-founded Monodevelop, a port of #SharpDevelop to Mono. I started by porting the text component, which was the core of the text editor itself.

There was a book explaining the implementation of this IDE:

https://www.amazon.com/Dissecting-C-Application-Inside-Sharp...

I think you might find it interesting for what you are trying to do, even though it's a bit old.

← PreviousPage 2 of 2