Earlier quoted context omitted.
If you add a new value to an enum, or a new argument to a method, you have to know all the places where you do switches on the enum or call the method, which is hard to do without static types.
Why couldn't you just search for where that enum is referenced and add the cases?
Cold Showers: For when people get too hyped up about things
191–200 of 243 posts
Re: Cold Showers: For when people get too hyped up about things
#192Earlier quoted context omitted.
SQLite is incredible. If you are struggling to beat the "one query per second" meme, try the following 2 things: 1. Only use a single connection for all access. Open the database one time at startup. SQLite operates in serialized mode by default, so the only time you need to lock is when you are trying to obtain the LastInsertRowId or perform explicit transactions across multiple rows. Trying to use the one connectio…
How do you handle access from multiple worker processes? Some languages/frameworks handle have poor multi-threading performance and must be deployed in a multi-process setup (e.g. python webapps). Or is it not a good fit for sqlite?
database.db SQLiteAgent localhost HTTP JSON MyPythonWebApps
This exercise would also encourage development of a concise and generic schema for storing your business data (presumably because changes to the above JSON contract would be time consuming).
Re: Cold Showers: For when people get too hyped up about things
#193Earlier quoted context omitted.
My favourite part is how they: (a) built their own transaction/caching/replication layer using Blockchain no less. (b) paid SQLite team to add a number of custom modifications. (c) used expensive, custom, non-ephemeral hardware. Now you could do all of this or just use an off the shelf database that you aren't having to write custom code to use and if you choose a distributed one e.g. Cassandra will be able to run on…
This really isn't a fair take on the situation. (a) They implemented a very boring transaction/caching/replication layer that is like any other DB except they borrowed the idea that "longest chain" should be used for conflict resolution. (b) They worked with upstream to get a few patches that were unique to their use-case. Once you're in deep with any DB this really isn't that uncommon. (c) They used a dedicated (lol…
1U of cohost with 100mbps in a cheap Eastern European DC will cost a few hundred euro per month... and my info is a few years old. It's more expensive now.
It is very specific case, that we should not extrapolate to mean it's general use case.
AWS/GCP/Azure are still a better places to start for most people.
Re: Cold Showers: For when people get too hyped up about things
#194I love that sqlite article. It seems like "everyone" is certain that sqlite can only be used for up to a single query per second, anything more and you need to spin up a triple sharded postgres or Hadoop cluster because it 'needs to scale'. I love being able to show that study, if you properly architect your sqlite system and am willing to purchase hardware, you can go a long long way, much further than almost all co…
Why choose sqlite over MySQL on a single server (e.g. small vm instance)?
Re: Cold Showers: For when people get too hyped up about things
#195Earlier quoted context omitted.
Is SQLite likely to be faster than postgres? In terms of ease of use / admin overhead I consider them mostly equivalent. I thought the main problem with SQLite was it was slow tih concurrent writers. Whereas the "bigger" SQL databases have code that allows concurrent writes.
WAL mode is how you address this problem with SQLite. See: https://www.sqlite.org/wal.html "Write transactions are very fast since they only involve writing the content once (versus twice for rollback-journal transactions) and because the writes are all sequential. Further, syncing the content to the disk is not required, as long as the application is willing to sacrifice durability following a power loss or hard reb…
Re: Cold Showers: For when people get too hyped up about things
#196We software engineers are still more like alchimists rather than chemists. That list reminds me of [1], which rants about this state of affairs and [2] that puts many beliefs to the test. [1] https://youtu.be/WELBnE33dpY [2] https://www.oreilly.com/library/view/making-software/9780596...
The issues are us - the developers. The machine code is mostly fine...
Re: Cold Showers: For when people get too hyped up about things
#197Earlier quoted context omitted.
Please don't use weak/strong to denote type systems. Those terms are highly subjective and even non-technical people would quickly form an opinion about which is better. (Strong is good, weak is bad.) Static/dynamic is more accurate and less opinionated terminology.
They are not the same, at least according to the definitions I'm familiar with. Static/dynamic is whether type checking is done at compile time or run type. Strong/weak is how flexible the language is with type conversion. Another explanation: https://en.hexlet.io/courses/intro_to_programming/lessons/ty...
As in:
Static typing - 1 == "1" is false (Python style, integer isn't converted to string for comparison)
Dynamic typing - 1 == "1" is true (PHP style, integer or string may be converted)
Re: Cold Showers: For when people get too hyped up about things
#198I wish it would be possible to have better studies for that. I believe that static typing has huge benefits as software scales. I also believe that the type system of TypeScript is actually stronger in practice than the Java or C# one (despite theoretical weaknesses). It has the right tradeoffs (e.g. structural equivalence, being able to type strings, being able to check that all cases are handled, etc.) It would be…
In my personal opinion (based on personal observation) static typing helps to become more lazy and trusting since it enables features such as autocomplete, type hinting and so on where one basically gives away understanding of detail. Don't get me wrong! I love being lazy and trusting because it allows to leverage more code than I'd be able to produce on my own, but usually it's also the source of many of my own mist…
I want my code to be clear and with certain expectations fulfilled, rather than a mystery in front of me. I'm not there to learn what could be passed into my functions - I'm there to create functionality.
Re: Cold Showers: For when people get too hyped up about things
#199There should be a section about the benefits of cold showers.
Re: Cold Showers: For when people get too hyped up about things
#200Earlier quoted context omitted.
SQLite is incredible. If you are struggling to beat the "one query per second" meme, try the following 2 things: 1. Only use a single connection for all access. Open the database one time at startup. SQLite operates in serialized mode by default, so the only time you need to lock is when you are trying to obtain the LastInsertRowId or perform explicit transactions across multiple rows. Trying to use the one connectio…
Are you living on another planet? Are you seriously suggesting people replace SqlServer or MySQL with SQLite? If you can come to my company and replace our 96-core SqlServer boxes with SQLite I'll pay you any salary you ask for.
What people are conveniently leaving out is they wrote a serious wrapper around it that makes it very similar to other conventional large scale systems like MSSQL or MySQL: https://bedrockdb.com/