3,755 karma · joined June 7, 2015
Style may also include naming, documentation requirements, recommendations regarding function length, etc.
My “favourite” bug is that when you import a markdown document, if you have a piece of inline monospace text that starts with a hyphen, the hyphen will disappear. So, something like this:
Use the `-v` option to enable verbose mode.
Will render like this:> Use the v option to enable verbose mode.
A-a-and that's how you get a lot of confused people wondering, if your documentation just sucks.
If you want a much more annoying example of inconsistency in the initial language design, look at the behaviour of nil and closed channels:
- sending data to a nil channel blocks forever;
- receiving data from a nil channel blocks forever;
- sending data to a closed channel causes a panic;
- receiving data from a closed channel is fine: you receive the zero value, forever.
I can understand the logic behind the last two (sending to a closed channel is an error in program logic, and closing a channel is a common idiom for broadcasting completion of a task to several goroutines), but the first two are just a massive footgun, and, in my opinion, should cause panics instead.
> 7.24.3.2 The calloc function
> […]
> Returns
> The calloc function returns either a pointer to the allocated space or a null pointer if the space cannot be allocated or if the product nmemb * size would wraparound size_t.
Was there any reason for that? Were the CPUs not powerful enough, or were the compilers not quite there yet? Or did it have more to do with the business side of things?
That does raise an interesting question though. If one wanted to create a command-line tool (or, rather, toolset) as comprehensive as curl, but with a much smaller API surface, how would they go about it? Sure, some of these flags are just shorthands, and some of them could be removed entirely (-o → stdout redirection), but that still leaves a lot of options.
The reason I'm curious is because may future SQL database implementations will most likely use the standard at least in some capacity, so it'd be nice to know, how future-proof and DBMS-switch-proof a schema using these could be.
[1]: https://www.postgresql.org/docs/current/rangetypes.html
[2]: https://www.postgresql.org/docs/current/features-sql-standar...
I guess with timeseries you'd have something along the lines of:
user | time_range | status
======+==============+=========
1 | [2018, 2021) | ACTIVE
2 | [2019, ) | ACTIVE
1 | [2021, ) | BLOCKED
Where the PK is (user, time_range). (The time_range field being shortened to just year here for simplicity's sake.)In PostgreSQL you can use the tstzrange[2] type. You could also only store one of the timestamps, but that would come at the cost of more complex queries.
[1]: https://en.wikipedia.org/wiki/Sixth_normal_form#Examples
[2]: https://www.postgresql.org/docs/current/rangetypes.html
https://fouronnes.github.io/cppiceberg/
(Entries are clickable.)
https://github.com/AdguardTeam/AdGuardDNS/blob/master/script...
https://github.com/AdguardTeam/AdGuardDNS/blob/master/script...
There's some mess in there, but if you only need a list of analysers and examples of usage, these should be enough.
Back when I used to write Ruby, lack of static analysis was a serious problem. I've been able to add Rubocop later, but it's not exactly on the same level as staticcheck, to say nothing about Prusti from the OP.
With that said, the “patch” I've used back when I was in a similar situation was actually to care about the “smaller” things in my work. That is, things that aren't unimportant but are often overlooked. I don't know what job you have, but as a developer, I was able to start experimenting with how we do testing and deploys, improve documentation, think about how I would refactor the codebase if I had the chance. That gave me “internal autonomy”, so to say. Making sure that my skills that can't really be developed would at least not degrade. That helped a lot when I finally quit and found a job with much more autonomy. Finally being able to “do it right” while also having the way to “do it right” right there with me.
Apart from a false-flag operation by Putin to have a casus belli to start a war with NATO?
Normally, that would be suicide. But Putin has already proven that he, to put it diplomatically, does not see the world the way most sane people see it.
About 43 %, according to [1].
> Is there any chance manifest v3 will lead to enough users abandoning Googles Chrome […]
No. Google Chrome is pretty much in the same position as Internet Explorer used to be. It's the default browser in the most popular mobile OS and the first thing people install on their PC (or get it installed by someone else). Mozilla can barely play catch-up with all the complex web standards pushed by Goog&co., to say nothing about adding killer features that could bring enough users back from Chrome.
Modern web browsers are rapidly approaching the YouTube territory. That is, becoming a technology so complex that only a multibillion-dollar conglomerate can really maintain it without losing money.