243 karma · joined Oct 4, 2017 (9y ago) · 160 submissions
comment 4y ago · link · parent
Imagine a code without `if result is not None` basically!
33.
The Dropout – The Story of Elizabeth Holmes(youtube.com ↗)
1 points · by hackandtrip · 4y ago · 1 comment
comment 4y ago · link · parent
0: https://www.greenbird.com/news/railway-oriented-programming-....
comment 4y ago · link · parent
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
comment 4y ago · link · parent
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
comment 4y ago · link · parent
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.
comment 4y ago · link · parent
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!
comment 4y ago · link · parent
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.
comment 4y ago · link · parent
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
44.
Ask HN: Any New Years' Resolutions?
1 points · by hackandtrip · 4y ago · discuss
comment 4y ago · link · parent
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.
comment 4y ago · link · parent
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....
comment 4y ago · link · parent
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
comment 5y ago · link · parent
Some examples:
- Richard Hipp (SQLite creator) (https://changelog.com/podcast/454)
- Co-founder of Cockroach Labs (Massive scale and ultra-resilience)
comment 5y ago · link · parent
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.
comment 5y ago · link · parent
comment 5y ago · link · parent
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.
comment 6y ago · link · parent
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)
comment 6y ago · link · parent
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