HNHacker News
TopNewBestAskShowJobs

hackandtrip

243 karma · joined October 4, 2017

Backend Python/C++, occasionally devops with Terraform
submissionscomments
hackandtrip··on The Dropout – The Story of Elizabeth Holmes
Who knows if a potentially well-made and viral show will put the light on the amount of money that VCs are investing in startups, and new regulations (good or bad) may appear
hackandtrip··on Show HN: Koda, a typesafe functional toolkit for Python
Can't you 'compose' together the various errors inside the `Failure` and inspect it at the end of the pipe?
hackandtrip··on Show HN: Koda, a typesafe functional toolkit for Python
Good luck checking for `None` equality and indent your code like 5 times... a sort of railway programming[0] avoids the awkward checks for values, making functions work with higher order types.

0: https://www.greenbird.com/news/railway-oriented-programming-....

hackandtrip··on Show HN: Koda, a typesafe functional toolkit for Python
A similar "framework", very robust and used in production systems, is dry-python's one[0][1].

The approach taken is a bit different I think, since they rely heavily on `mypy` plugins to reach type safety and functional constructs otherwise impossible to get, without runtime inspections.

0: https://github.com/dry-python 1: https://github.com/dry-python/returns

hackandtrip··on Boyfriend-alert – A light based alert system
+1.

As software engineers I think we should explore more the part of our skills that can create things that are not useful per-se, but creative and funny, such as the best gifts (at least for me) are

hackandtrip··on Pydantic
Love FastAPI for lot of concepts that it helped to make mainstream, such as typing-based-validation, but its documentation is lacking.

I love the tutorials, but an API reference is just as important; I may not want to check out long tutorials about things I already read, but check a detailed description of each function would be super helpful - other frameworks such as Sanic have it.

I think it's in the roadmap, kudos for that, and hope that it will get a few more maintainers to speed up the process

hackandtrip··on Pydantic
Are those alternatives faster according to benchmark?

In my experience, the bottleneck is either: - JSON parsing and dumping; the solution for me is ORJSON, fantastic wrapper to use fast JSON serialisation for most common fields, and also datetime. - Validation - if you choose to validate your data, pydantic can indeed be slow... But it's not Pydantic the problem, but the validation that you apply to your data.

hackandtrip··on Favor real dependencies for unit testing
Well, I strongly believe in testing all the queries/transactions (for example the repository pattern is super helpful to separate concerns and allow you to test only what concern your queries and the DB); but those are tested separately from the workflow of your service, if we are talking about unit tests. Why? Because otherwise either you write a gaziliion of tests, or they are unreliable. As an example, if you have in the service you wanna test various code paths, and your queries have paths of their own (what happens if you don't retrieve any object? if some property is null? and so on), I just think it gets messy quickly.

My solution is to test things separately, at least in unit tests. Obviously, this has pitfalls (it's easy and fun to write green tests, so not always tests respect the interface of the components and they don't get red even if something is wrong); but that's where integration testing come into play.

Have a few code paths where you touch multiple external services, and you want to test that everything actually works? Create integration tests that use either a fake or the actual service in a `staging` environment, take 10x time to run, but test the path that is most important for your logic. Obviously, if you many unit tests, you will have way less integration tests, but they serve different scopes, and one cannot substitute the other!

hackandtrip··on Favor real dependencies for unit testing
Great article, not the first time I read this argument against the usage of mocks; I never understood though how to solve the problem of the explosion of the path that must be tested (usually exponential).

As an example, consider a single API that uses ~3 services, and these 3 services have underneath from 1 to 5 other internal or external dependencies (such as time, an external API service, a DB repository, and so on). How can I test this API, the 3 services, and their underneath dependencies without exponential paths to test - I want to be able to cover all the paths of my code, and ensure that my test only tests a single thing (either the API, the service, or the dependency interface); otherwise, it is not an unit test.

I always felt like that these type of tests without mocks works super-nice in nice situations without any external, or even complex but internal, dependency; otherwise, it becomes very very hard to test ONLY what I want, and not all the dependencies underneath.

Mocks allow me to stub the behaviour of a service/dependency that I can test in a separate fashion, covering all the paths, and ensuring that each unit test covers a single unit of my code, and not the integration of all my components.

hackandtrip··on Gunicorn
Note that Uvicorn still recommends to use Gunicorn for production use, with the Uvicorn worker class implemented for Gunicorn.

https://www.uvicorn.org/#running-with-gunicorn

hackandtrip··on We do not break userspace (2012)
I may be an average corporate backend dev, but if anyone I work with would react in this way after any kind of mistake I did, I would report the situation / leave immediately.

Honest feedback is surely key to keep quality, innovation, and skills high - the thread has indeed a few lines of honest feedback (don't break user-space, wrong error) and the rest are just insults. I am pretty sure it goes against the Code of Conduct [1]

1: https://www.kernel.org/doc/html/latest/process/code-of-condu...

EDIT: Just saw 2012, I guess CoC was not in place back then

hackandtrip··on Show HN: Kommit – Web app to help you follow through with NY's resolutions
Very interesting, thanks for the clear answer!

Love the fact that you make it easier for the customer to get a refund through your process, than through the refund one; I do not work in this space and offering free refunds for my product could be very destructive, but it makes 100% sense here.

hackandtrip··on Show HN: Kommit – Web app to help you follow through with NY's resolutions
Kudos for the donation to charity!

I wonder how the other for-profit in this space keep their business running, considering the amount of disputes that must come from users.

For example, I know that Stripe is very strict on the disputes percent[1]...

1 - https://stripe.com/docs/disputes/measuring#:~:text=Dispute%2....

hackandtrip··on Ask HN: Moving from tiny websites to serious tech skills?
After ~2y of professional experience, I don't think that there is huge hard skill gap between non-professional and professional devs.

The biggest thing is understanding that you may work on a single tool in ~10/100 people, so you must develop and work with other people in mind. So, modularity, enforcing code clarity and writing good tests, understanding product decisions and so on... Personally, I learnt this stuff on the job pretty fast - still newbie, but can autonomously solve medium/complex projects without senior help, which should be a base goal.

Larger-scale technologies is mostly larger-scale organization - just apply to one of those and I am sure you'll catch up fast

hackandtrip··on The 20 best gadgets of 2021
Any thoughts from HN about gadgets that made their life (either work or social) significantly better in 2021?
hackandtrip··on Ask HN: Who is the Joe Rogan of coding?
I find Changelog podcasts (https://changelog.com/podcasts) very high quality.

Some examples:

- Richard Hipp (SQLite creator) (https://changelog.com/podcast/454)

- Co-founder of Cockroach Labs (Massive scale and ultra-resilience)

hackandtrip··on I Got Fired from Amazon as a Software Development Engineer
100% agree on this and that's my point.

Was that code merged without any review? If so, that is a recipe for disaster. Why no unit tests, integration tests, QA? What was the speed at which the outage was resolved? If a sane deployment strategy is in place, I'd hope that no big damage was actually done; if the error budget was burning fast, there should be some manual/automatic rollback.

tl;dr they may have been a key factor in the outage, but it seems like it is a symptom of a deeper hole in the process.

hackandtrip··on I Got Fired from Amazon as a Software Development Engineer
The fact that an individual can bring production down is 1000% a problem in the process; outages should not attributed to single commits but to a series of problems in the process. Just saying this since the number of times someone being production down should not be cause of shame or firing
hackandtrip··on HashiCorp – S1
Did not know it existed, extremely cool indeed! By skimming it I still think Pulumi might have a better Dev UX, but surely Terraform is still catching up
hackandtrip··on MangoDB: An open-source MongoDB alternative
Any performance benchmark? I know it is hard to compare, but I do wonder if it is actually already faster than MongoDB.
hackandtrip··on PostgreSQL 14
Any suggestions to learn and go deep in PostgreSQL for someone who worked mostly on NoSQL (MongoDB)?

From the few days I have explored it, it is absolutely incredible, so congratulations for the work done and good luck on keeping the quality so high!

hackandtrip··on Is catching Covid now better than more vaccine?
I had a similar experience, with 10-12 days of mild symptoms (up to 40°C fever), but the general feeling of tiredness and the infamous "brain fog" stayed for 3-4 weeks (it's not completely gone yet).

Definitely one of the worst sickness I've had, but both me and especially my parents (60+) had no respiratory problems and didn't need urgent treatment.

I was waiting for my second dose when I got it and my parents were vaccinated, but still I don't get how we can count on treating it as a flu and just get the virus, considering the lack of knowledge on long-term effects.

hackandtrip··on Tutorial sites treating FreeBSD like a Linux distro
This is so true and my experience completely checks out with it.

I started trying out Linux with the usual Ubuntu / Linux Mint distros, but I got so confused by the lack of structure and understanding of what is the correct way to do things - aka what I wanted to understand with Linux, for personal knowledge.

I moved to arch, and ease of use came free: everything you'll ever need is basically on the wiki, no weird PPA to add, nothing on sketchy tutorial sites - just the wiki. Definitely suggested for beginners (yeah the installation can be a pain but it's minimal compared to the advantages)

hackandtrip··on Challenges and opportunities for better nutrition science
I skimmed the contents, but I don't get any alternative to the standard calories counting.

It's the only way to quantify the intake without revolutionising the food industry packaging, or am I missing something?

hackandtrip··on Apple Mail randomly becomes the frontmost application in macOS
It happens A LOT with non-GSuite Gmail accounts (personal GMail accounts) too!
hackandtrip··on So you want to write your own CSV code (2014)
Some fast implementations in C++?

In particular, I tried in the last weeks to work on a OpenMP / MPI driven CSV parser, but surely accounting for new lines inside quotes can be a pain the ass, I'm wondering if there's a go-to implementation or model to implement that.

hackandtrip··on Ask HN: What's your #1 productivity hack?
I think productivity enhancements are really tightly coupled with the domain and type of activity you are doing.

For example, as a university student, I noticed that timing the number of hours I pass on each topic is useful for 1. understanding if I'm doing too little and fixing it 2. getting the idea where I'm spending most of my time and trying to adjust accordingly

On the other hand, if the work is more project-based, I find it more difficult to track time since I find myself switching more often to different things - a solution I'm employing is writing a little todo list every morning on what I want to work on and it's working a little better

hackandtrip··on NHS rejects Apple-Google coronavirus app plan
Will iOS - iOS Bluetooth communication be ok with those new API? Wasn't a major problem with other frameworks the iOS Bluetooth turning off for battery capacity?
hackandtrip··on So you want to be a compiler wizard (2016)
Thank you for the references - I'll take a look.

Awesome jobs by Rust to keep something like that (hopefully updated too), since the lack of updated information usually is the bigger barrier of entry for contributing/working on stuff like that. I struggle to find something similar and in-depth for clang, but I guess the bigger complexity makes it more difficult.

hackandtrip··on So you want to be a compiler wizard (2016)
What about something more specific for production-grade compilers?

The majority of people those references will learn toy-compilers, that are surely important but a completely different league than production-grade compilers, e.g: LLVM.

Talking specifically about LLVM, does someone have their go-to references to start and have a sense of the infrastructure, or even some specific reading about a part of the (huge) infrastructure?

← PreviousPage 2 of 6Next →