24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions
https://www.bitecode.dev/
Email: contact at bitecode.dev
comment 5y ago · link · parent
Yet we still don't.
I do think it's possible that softwares will be built more and more by automatic tools (shopify, wix and wordpress are good examples), but 80% is a tad optimistic.
comment 5y ago · link · parent
It's so simple any little script can interact with it in seconds, instead of having to craft complex SQL or import your wrapper. You can call redis from the weirdest places, like from the inside of an nginx config file. You needn't even a compiled driver if that matters.
It's easier to get it to perform. It's possible to get great perfs with PostgreSQL, but you just got them for free with redis. Very hard to screw up. Read, write ? N+1 ? Batching ? Who cares, it will be fast no matter the concurrency or the load.
Sure you can expire with Postgres, but having done so in practice, it's way harder than it looks to get right. With redis, you don't have to care. Set a cache, set a lock with a timeout, store data your are not sure you need. It will all disapear.
Redis is not just key/value. You have sets, so ensuring unicity is a piece of cake, no constraints to define, then insertion to check against. And of course, you have sorted sets, which you are kept ordered at insertion by any number you pair the value with, such as a timestamp/score/index, and truncate by range for extra magic.
And then you have bonuses like hyperloglog which you need an extension for in Posgres. Super handy for stats.
Finally, you have streams, which for most apps will fill the gap for a timeserie database or a way to store your app logs. All that with a 2ms latency at 10k/s requests. None of my projects ever needed more than 1K/s though, even one with 1M users/month.
You have all of that with a dead simple install and basically no maintenance.
In fact, redis by itself consume almost no resource, it's not even worth it to not have it in your toolset. I just install it by default on all my projects: I never regretted it, there is always something it can do for you. It not now, just wait a bit, it's costing you nothing, and something will come up.
So no, let use Postgres for what it's great at, which is being a robust all purpose database. Redis is a fantastic complement to it, not a competitor, just use both.
Unless you are google size, there are little chances you will reach a stage where you need to migrate from any of them.
It's part of those tech that are just too good to be true, like SQLite or Python.
My only regret is that it doesn't exist on windows.
P.S: if you need caching and can't afford redis on a small python script, use Disk Cache, it's awesome: http://www.grantjenks.com/docs/diskcache/index.html
comment 5y ago · link · parent
It would be a win / win, you gain the strength of J, K and APL for array processing, without the weakness of them for anything else.
And just like with regex, you'll get fat disclaimers in doc telling you to not get carried away too much as it can quickly become unreadable.
comment 5y ago · link · parent
First, it's just faster. Offline apps are an order of magnitude faster and the speed is stable.
Secondly, data is way easier to backup. I don't trust any provider with important data. Your account can be banned, or you could be locked out. There are outage, data corruption, human errors from people you share data with...
Then there is the no internet part. Internet at home can go off for many reasons, you may be abroad, in a plane, in a tunnel, in the country side. Or internet could be slow, unreliable, behind an agressive proxy, etc.
That's why i use thunderbird and not a web mail, dynalist and not the competition, mp3 and not spotify... That's why i keep osmand next to waze and torrents next to netflix.
Last week internet went down in accounting. They took the day off, because they used office 365. Great for them, not so much for the work to be done.
comment 5y ago · link · parent
If you use react or vue, you can plug components precisely anywhere on the page, you don't need to take over the page entirely.
In fact, with vue, you can even put the template in the HTML directly, and just hook the logic on to it, angularjs v1 style.
comment 5y ago · link · parent
Still, I'm thinking that as it improves, it's going to show that doctors are not that good at their job on average, and that's going to be fun to watch.
comment 5y ago · link · parent
It's lossless, besides, the API is much nicer.
comment 5y ago · link · parent
- you can use list[] instead of typing.List[]. Same for dicts or sets.
- you will be able to use bool | str instead of typing.Union[bool, str]
- mypy has saner default, is better supported by IDE and is way faster
- a lot of edge cases are now covered, including protocols for duck typing, vartype, etc.
- fantastic libs such as pydantic, fastapi and typer make using them a ton of fun
comment 5y ago · link · parent
Django-Rest-Framework does that with view + serializer + validators.
A more recent example, with a leaner and cooler implementation is FastAPI, where type hints are also use to declare validation on your end point, while a model is used for serializing the response.
comment 5y ago · link · parent
Even the fact it's using python to declare your tasks is not a problem: it's basically a function signature and a mapping, nothing you can't master in 5 minutes, and certainly simpler than make files DSL. Also easier to get right and debug.
The problem is the fact you need python to install it and run it, which non python dev will rightfully not care to do.
comment 5y ago · link · parent
Pydoit is the sweet spot for most of my use cases:
- it scales up (graph of deps, file watcher, etc) but above all, it scales DOWN (simple stuff are dead simple)
- it promotes a declarative task definition
- it embraces the shell yet let you use python if you need to
- it gets out of your way and doesn't try to rule your project. It just runs what you want and disapear.
- the doc is nice
The biggest drawback is that you need to pip install it, which means non python devs will avoid it. I wish it was provided as an stand alone executable