HNHacker News
TopNewBestAskShowJobs

elboru

1,552 karma · joined November 8, 2010

;
submissionscomments
elboru··on Testing Without Mocks: A Pattern Language
There's a middle tier, broad tests in the sense of not mocking local dependencies but only external (slow) ones.

Many developers mock every dependency in a SUT, even if they own the dependency. I like the idea of broad tests that run-in memory (no I/O interaction).

I think Ian Cooper does a great work explaining it in this talk (he talks about TDD, but I think the main idea applies even if you write tests after code): https://www.youtube.com/watch?v=EZ05e7EMOLM&ab_channel=DevTe...

elboru··on Testing Without Mocks: A Pattern Language
I think one of the biggest issues is the definitions we use.

Some developers would define mock in the wide sense, as any kind of double to replace a dependency. Other developers have a narrower definition, as doubles that verify interactions with the dependency (interaction testing https://testing.googleblog.com/2013/03/testing-on-toilet-tes...).

In this case, the author mentions mocks and spies, therefore he's referring to "interaction testing". In other words, tests that verify that the dependency was called in the "right" way. If you own those dependencies, and later you refactor them you'll also need to refactor any test that used "interaction testing". Refactoring becomes a tedious and sometimes difficult task.

If by mock, you simply mean code (written by you or by a "Mock" library) that replaces a dependency to get the right data inside the SUT for the test, but that it's not attached to the dependency implementation, then most of the issues are gone.

elboru··on ChatGPT won’t replace search engines any time soon
Same feeling, the other day I spent just too much time trying to find a chart comparing Messi against Ronaldinho. I mean two of the greatest players ever, how is it possible that I couldn’t find a good page, tons of SEO garbage pages.
elboru··on Americans duped into losing $10B by illegal Indian call centres in 2022: report
It’s dangerous to draw lines. Where should we draw the age line? 80? 70? 60? I know people in their 70s with better cognitive abilities than the average middle age person.

In that case, let’s ask for cognitive tests to gain the right to vote! Unfortunately there will be people who will never be capable of passing the test even during their 20s or 30s. Those who cannot pass the test could be less capable thanks to the environment (poor neighborhoods, poor education, bad childhood, missing one or two parents, exposed to toxic chemicals during pregnancy) or simply less lucky in the genetic side.

Are we ready to take away the right to vote from old people even if they are more capable than you and me? If not, are we ready to take away the right to vote from less privileged people?

elboru··on User Interface Design: Rules of Thumb
Junk apps have taught me that a spinner that takes too much time could be an indication of failure though. The user will be inclined to refresh or close the app.
elboru··on Paul Graham is leaving Twitter for now
Elections?
elboru··on Yerba Mate – A Long but Current History (2021)
This is it. I hated it too the first time I tried it. Then I watched a couple of videos and the experience was totally different.
elboru··on Interface Ideas for Chat Apps
The phone mock they used seems really outdated. Maybe this article is a few years old?
elboru··on Emergency SOS via satellite
“Available to average people” that’s what amazes me. I remember when I played with an iPhone for the first time. It was an amazing device, but I thought it was a luxury device for rich people only. A few years later smartphones got a lot cooler and cheaper, to the point where it actually helped spread the internet to sections of the population that weren’t able or didn’t want to use a PC.
elboru··on The Golden Rule of Personal Finance
As a kid I felt my family was “poor”. My uncles and aunts had bigger and nicer houses/cars than my parents. My cousins had really cool toys and they rarely got a no when they wanted an expensive candy. My foolish child mind saw all that and thought we were “poor”. What I didn’t know was that my parents had bigger salaries than their relatives. They just didn’t give a damn about expensive stuff.

Later in life the same relatives struggled really bad when their incomes decreased, and they weren’t able to afford the lifestyle they were used to.

My family in the other hand never really went through economic struggle (at least it was not apparent to me and my siblings) even when my father lost his job and took him 6 months to get a new one.

My parents now live in a really nice house but they still have the ugliest and oldest cars ever lol. But that always reminds me to not fall for expensive stuff just because I can afford it.

elboru··on Ask HN: Advice that changed your life?
Not a hardware guy. But I guess you can turn on modules individually before everything is done.
elboru··on Ask HN: Advice that changed your life?
Funny enough I haven’t encountered bigger a-holes than the bullies in my childhood.
elboru··on A lot of what is known about pirates is not true (2017)
I guess we’re heading in that direction.
elboru··on A lot of what is known about pirates is not true (2017)
Isn’t it weird that pirates are a kids thing? I wonder if 3 centuries in the future kids will watch narco cartoons.
elboru··on Write better error messages
When I was a jr dev, getting exceptions was a synonymous of ”me messing something up”. Null exceptions were specially annoying, so the naive approach is to check for nulls and avoid the code that will cause the exception. And it “works”! You don’t get exceptions and your code keeps running. It’s just when you need to fix difficult bugs while you go through logs when you understand the value of having the right exception with the right message. And you learn to love them and start caring about them.
elboru··on Focus is saying no to good ideas
And thanks to monk studiousness, hundreds of classical books were preserved during the dark ages, after Rome fell. We also got a lot of technology preserved and actively invented by them.
elboru··on The curious case of Norway’s demon wall (2021)
> none of the stereotypical figures associated to demons like stars, 666 numbers, or inverted crosses are seen in the photos

Those are modern, pop culture stereotypes. The inverted cross and the pentagram are centuries old catholic symbols (not associated with demons).

elboru··on I don’t believe in sprints
> Sprints are really just a form of pressure

I’ve felt the opposite. My team switched from “Scrum” to “Kamban”. Then after a few months the sensation of having an endless pile of cards, without a time frame, felt overwhelming.

In the other hand, having a short lived cycle used to help me manage my time. If for any reason one day I was not able to accomplish much, I knew I still had a few more days to compensate. The same was true for the opposite, I could be really productive a few days and then I could relax for the rest of the sprint.

That workflow really worked for me. With Kanaban I feel the pressure to always be “productive”, because I don’t have a clear reference on how “relaxed” I’m (or not), during the week or month.

Maybe I just need to find a different reference. I guess my point is that sprints don’t necessarily mean pressure for everyone.

elboru··on The Sounds of CDMX
Thanks, yes, I meant shouting. I’ve lived in both gated and non-gated. And gated neighborhoods are significantly more quiet.
elboru··on The Sounds of CDMX
Big parties late at night in residential areas, vendors shooting while passing by, then dogs barking at them, delivery men in noisy motorcycles, then dogs barking at them again. I guess that’s why gated communities are trending in many Mexican cities now days.
elboru··on What's SAP, and why's it worth $163B? (2020)
I love to read this kind of articles. The kind that clicks in your mind right away.

Experience probably has already taught you some of these ideas, but you hadn’t invested the time to reason about them and putting them together. Then you read an old blog post, from two decades ago, putting all those ideas into words and it simply clicks in your mind.

Thanks for sharing the link.

elboru··on The end of the manual transmission is near?
I don’t have any data to back this, but my guess is that a big portion of those who prefer stick will also prefer gas vs electric.
elboru··on Shazam turns 20
Sometimes, I like to stop and think about all the amazing things that we can do with our phones and that we take for granted.

What I do is to imagine myself finding a smartphone in elementary school (90s kid). These are a few things that would blow my mind:

- Having a digital global map, with multitouch, that can show me where I am in that map. I can search anything and find reviews from virtually anywhere in the world. I can zoom and see my actual house. I can use street view.

- I have access to any song I want.

- The phone can listen to a song and it can tell me the name of it (then I can listen to it again)

- I can play video games with much better graphics than my N64

- I can watch movies and TV in there.

- I can video call

- I have a digital assistant

- I can find any answer online

- I can buy anything online

- In the future all this technology is not just for the rich, virtually anyone can buy a smartphone.

elboru··on I have complicated feelings about TDD
One of the biggest issues with our industry is the ambiguity in our definitions. The author mentions “unit tests” as if it was a well defined term. But some people understand “unit” as a class, other understand it as a module, others as a behavior. Some TDDers write unit tests that would be considered “integration tests” by other developers.

Then we have TDD itself, there are at least two different schools of TDD. What the author calls “maximal TDD” sounds like the mockist school to me. Would his criticism also apply to the classical school? I’m sincerely curious.

If we don’t have a common ground, communication becomes really difficult. Discussion and criticism becomes unfruitful.

elboru··on How do palm trees survive hurricanes? (2017)
Mexican near the border here, same.
elboru··on Ask HN: Have you ever inherited a code base you thought was well done?
I once inherited an old ASP.NET Web Forms code base, I was a solo developer at that time.

I hated it, on my young and inexperienced eyes “everything was a mess”. It didn’t follow any good practice. The code didn’t have any layer, most of the code was written in the view and it didn’t follow the DRY principle, it had just a few libraries to share some code, so there was a lot of repetition.

Of course, I started “improving” it. I chose a layered architecture, I wrote several generic classes to implement the repository pattern, since I was a solo developer it took me a while to migrate big pieces of code to my new implementation.

Bugs came and went and I started noticing something. Even though my implementation was “beautiful”. I hated to fix bugs on the new and “improved” code base. To debug I had to jump around a lot. The bug was always hidden. And sometimes my changes could affect other places in the code base so I had to be really careful. In the other hand fixing bugs in the old implementation was pretty straightforward and it rarely broke other places.

The project came to an end. The company bought a CRM that had more features so they shut the old code base down.

All my efforts to improve the code were a waste of time. They wasted my time, not only because it was not going to be used in the future, but because even if it lived longer my changes added unnecessary complexity to the code base. This complexity made it difficult to work on a really simple project, it made it fragile and it was simply not fun.

I learned a lot. I don’t judge code bases anymore. Now I can see the benefits of “ugly” code.

elboru··on SMS phishing is way too easy
What about the FedEx one? I cannot count the number of times I’ve seen companies or even government offices using complicated and scammy-like URL names.

It’s difficult to know if URLs are legit or not. HTTPS used to be a good enough indication of legit URLs, but not anymore.

You could also think on googling the company. But those ads that look like real search results are well known to include scam websites!

I’m a developer and I find it difficult to distinguish some URLs. Now imagine how difficult it can be for grandpa or really any person out there that doesn’t know about these kind of scams.

elboru··on Getting humanity to bounce back faster in a post-apocalyptic world
The idea is not to build a car just after you are out of the bunker. But it seems like this book would be helpful for a ton of useful things:

> thorough text covering not just cars, but their constituent parts--and their constituent parts' constituent parts--all the way down to the materials. It has wonderful tables of data on the properties of various materials (from advanced plastics and alloys to leather, paper, and common fluids) accompanied by clear and precise mechanical diagrams

elboru··on Apple Passkey
I don’t actually know how many Reddit accounts I have for this reason.
elboru··on Teach your kids poker, not chess
No, total beginners have all their mental power focused on trying to find patterns between the cards on the table and the ones they have on their hands, while trying to remember all the combinations of poker hands. They also need to pay attention on which turn is next and how much they need to pay to keep playing and figure out if it’s worth it, they also need to learn the common poker language, a lot of things going on for a beginner. Once you have all that in memory it becomes easier, your processor power is free from those memory tasks and you can start reading people’s intentions.
← PreviousPage 4 of 16Next →