Better HN
topnewbestaskshowjobs
Log inSign up

aobdev

191 karma · joined Jan 27, 2022 (4y ago) · 92 submissions

Submissions

comment 3y ago · link · parent

I’m someone who spent a lot of time focusing on finding the most efficient tools, writing the most elegant code, using the most “pure” frameworks, etc. and I realized that this did very little to help me obtain my goals.

Unless your objectives are not commercial or will never scale beyond the ability of a single person, the overhead of human communication and collaboration will be enormous compared the inefficiencies of shuffling electrons and flipping bits with imperfect instructions. Sometimes this means using technically-inferior tools better than idealistic tools improperly to get the job done.

comment 3y ago · link · parent

Just pointing out that Pylance is a VSCode wrapper around Pyright, which is a static type checker with no primary linting features. The separate VSCode Python plugin however integrates with pylint, flake8, pylama, bandit, etc. and I agree that it is very good.

comment 3y ago · link · parent

I'm sorry to point out that the first 5.0 alpha came out in 2014 and still hasn't been released. When people talk about the ecosystem/battle-tested-ness/quality of express I think that unfortunately doesn't extend to anything other than the latest major on npm. It's not "modern" but it's still a good tool.

comment 3y ago · link · parent

I'm guessing the renders are not representative of what it will actually look like as the article states that "their initial filing does not provide us with much detail about exterior design". It also seems unlikely that this exact proposal will be approved and constructed as-is.

comment 3y ago · link · parent

Frequent backups that include node_modules.

comment 3y ago · link · parent

I don’t agree with the above sentiment, but Vue 3 is quite good.

It feels more “complete” to me than react in the sense that I don’t need to keep up with what’s going on with redux vs. alternatives, or what changes are in the latest version of react-router, or what’s going on with Next 13/server components, or update my webpack plugins or decide if I’m moving to vite. Long story short 95% of cases have an official solution.

Similarly, I don’t often have to look beyond the official Vue docs to fully understand how things work. React hooks are good enough but they don’t have the same approachability as Vue’s composition API.

comment 3y ago · link · parent

It seems crazy, but it’s true. Also consider that Vite is a wrapper around 2 tools that are impressive in their own right: esbuild and rollup (and the latter was created by the guy who made svelte!)

comment 3y ago · link · parent

I’m sure this is true and can be attributed to DST, but do we know if this would be worse than traffic fatalities caused by commuting in the dark during winter months without DST?

comment 3y ago · link · parent

Can you elaborate? I’m assuming things go wrong when people don’t get enough sleep but I’m otherwise unaware of the dangers of changing the clocks.

comment 3y ago · link · parent

Mortgages are typically issued as non-recourse loans. This may not be true for HELOCs or other risky equity loans, but usually your lender can’t seize your home unless you haven’t been paying monthly.

comment 3y ago · link · parent

USB-C?

comment 3y ago · link · parent

They serve different purposes. Prisma provides type safety between server and database, tRPC provides type safety between client and server. You’re most likely going to have some logic between those two channels that manipulates and makes those interfaces similar but not quite the same.

comment 3y ago · link · parent

Management at the now FDIC-controlled bank will estimate the value of SVB’s assets, such as loans and bonds, and give depositors a fraction of that value to be paid in advance of the sale of those assets. They do this to prevent the collapse of all those companies who were SVB clients, which would be bad for the economy.

comment 3y ago · link · parent

Just to be clear, are you talking about a file where each line is its own json object rather than the entire file being one large array?

If so, it’s easy in Python to do the following:

  with open(“file.json”) as src:
      for line in src:
          json.loads(line)

comment 3y ago · link · parent

Heads up to the author in case you’re here, you reference a tweet about Next.js but subsequently refer to it as “Nest”.

comment 3y ago · link · parent

Unfortunately the given examples (Next and Nuxt) are much slower than traditional template engines, even in "slow" languages like Python + Jinja2. This may not translate into financial cost at the scale of your average startup but it does have a measurable performance cost for each page load.

comment 3y ago · link · parent

If I understand correctly, it seems to be a cornerstone of Supabase’s Authorization features. https://supabase.com/docs/guides/auth/row-level-security

comment 3y ago · link · parent

Honestly that sounds like fear-mongering, Reddit wants to protect its interests by turning the public against section 230 reform.

comment 3y ago · link · parent

What makes this a bad argument against JWTs rather than a good argument in favor of using built-in features of the platform? I agree that any purported issues with JWTs are solvable, but if you don't need the benefits they bring over sessions, why use them at all?

I think the premise of the article, which I wholeheartedly agree with, is that for 95% of software projects developers should choose the simplest implementation necessary to meet the requirements. Sessions come for (almost) free with the framework and most browsers, but JWTs have an additional cost for the problems they solve, which are usually poorly understood upfront.

comment 3y ago · link · parent

I think the most secure approach is to store a random id in the database and to also sign it any time it’s exposed to the user (as a cookie or url sent via email). The first benefit is that you won’t be exposed to DoS attacks whereby you’re querying non-existent tokens from your database, and the second benefit is that illegitimate sessions can only be established by compromising both your database sessions table and your application’s signing secrets.

comment 3y ago · link · parent

I was about to say “but this one is!” and realized I had confused PostgREST with PostGraphile. If you’re interested in GraphQL, you can check out PostGraphile here: https://github.com/graphile/postgraphile

It’s interesting to me that PostgREST and Hasura are written in Haskell, but PostGraphile is not. Given the complexity in parsing arbitrary GQL queries I think I assumed that Haskell was a better fit for the job, hence the mixup!

comment 3y ago · link · parent

These passwords have to be encrypted so they can be retrieved later, right? I don’t think Argon2 works for that purpose.

comment 3y ago · link · parent

I hate that these are called models (probably because they extend pydantic’s BaseModel), but if they were called Schema or Serializers would this still be true? Typically what you see in a FastAPI project is a class that parsers the request body, and the same or slightly modified class that serializes the response back out after touching the DB. And this isn’t a new idea, because Flask+Marshmallow and DRF do the exact same thing.

comment 4y ago · link · parent

Slightly off topic, but you can chain your language selectors in VS Code settings so that:

    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[typescript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
Becomes:

    "[javascript][typescript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    }

comment 4y ago · link · parent

There's always such a mixed response when new web tooling gets posted here that I really can't tell if this is sarcastic or not.

Regardless, I like that this is fast and it is probably going to get a lot of adoption since it will be included with Next.js.

comment 4y ago · link · parent

Receipts for the personal items that the airline lost, not for the airfare. You need to prove how much your damages are in order to make a claim.

comment 4y ago · link · parent

They’re talking specifically about client-side hashing. You’re right that the system will hash the stolen hash, but only in cases where the system can’t be bypassed (which client side code always can be).

comment 4y ago · link · parent

Hey, I wanted to chime in and say that I too am underwhelmed with the support for async in Python libs. Coming from a node.js background, it falls short because you constantly have to think about whether async code is calling sync code, or vice versa, and whether you need an executor, threadpool, etc. Just a mess that gets in the way of productivity IMO.

However, things have been getting better, and in case you haven't seen it, AIORedis[0] appears to be the de facto standard for async in Python (a little better with 1,724,389 downloads this month). It's popular enough that it's been merged with the official redis-py driver[1].

[0] https://aioredis.readthedocs.io/en/latest/

[1] https://github.com/redis/redis-py/releases/tag/v4.2.0rc1

comment 4y ago · link · parent

The dual power adapter is in addition to, rather than instead of, MagSafe. The cable has the magnetic connector on one end and usb-c on the other. Dual ports just lets you charge your iPhone/iPad etc. at the same time.
1234