HNHacker News
TopNewBestAskShowJobs

kennu

1,388 karma · joined August 17, 2009

[ my public key: https://keybase.io/kennu; my proof: https://keybase.io/kennu/sigs/bm-VfH6HWwDjgZr0zDzsNdPm3OsY-FvYwsUTVq5ccsc ]
submissionscomments
kennu··on Kind of annoyed at React
These have not been an issue in my projects.
kennu··on Kind of annoyed at React
I think that would only make my apps much more complicated, and also more difficult to understand and to develop, since they would not rely on standard React API but some kind of outside integration. I don't really see the value.
kennu··on Kind of annoyed at React
Okay, but my point is that somewhere along the line there always is a useEffect() that reacts to something. Maybe it's in your own component, maybe it's in a third party component.
kennu··on Kind of annoyed at React
Yeah and then the router sends you property changes which you react to with useEffect().
kennu··on Kind of annoyed at React
You can overuse useEffect() for sure. But I don't know how else you'd react e.g. to the page query string parameters or component properties changing, when the rendered content depends on them.
kennu··on Kind of annoyed at React
React documentation lists a lot of other use cases for useEffect() than just that:

- useEffect is a React Hook that lets you synchronize a component with an external system.

- Connecting to an external system

- Wrapping Effects in custom Hooks

- Controlling a non-React widget

- Fetching data with Effects

- Specifying reactive dependencies

- Updating state based on previous state from an Effect

- Removing unnecessary object dependencies

- Removing unnecessary function dependencies

- Reading the latest props and state from an Effect

- Displaying different content on the server and the client

https://react.dev/reference/react/useEffect#specifying-react...

kennu··on Kind of annoyed at React
A couple of things make React extremely valuable to me:

- The functional programming model (State => UI) allows building very complicated interfaces in a very simple way, by defining dependencies with useEffect() and other hooks. It can take years to master it, but when you develop complex apps where all kinds of state needs to update when some other state changes, you really appreciate how simple it is to do with React.

- React is very backward compatible and allows you to migrate codebases to newer React features slowly over the years, while already using those new features in other parts of the code. (I still have some class-based components here and there.)

- There is a huge ecosystem of existing React components and tools you can use in your applications. They make it a very productive environment to get stuff done quickly. Frameworks like Next.js make it a breeze to develop and deploy static apps e.g. to S3.

- You can apply your existing React skills to React Native when you need native apps.

kennu··on Ask HN: What sub $200 product improved your 2023
Usually plain water is fine but sometimes you need a bit of extra electrolytes to rehydrate. I wouldn't drink too much of them though.
kennu··on Ask HN: What sub $200 product improved your 2023
MaxiNutrition Hydration Tabs. Much easier to drop into a glass of water than powder-form electrolytes (no messing around with a spoon etc). Also something to keep in your pocket/bag on a longer bar night. I can't guarantee the nutritional value being a nonexpert but at least the convenience is great.
kennu··on Audiobooks Are Books and They're Also Practice
Best way to keep your attention on an audiobook is to simultaneously play a game that offers repetitive tasks and requires no cognitive effort. For instance, mine/build stuff with Minecraft or clean objects with PowerWash Simulator. If the game has any plot or requires any reading or figuring something out, then you quickly lose focus on the book. But quite many games have "grinding" that you can do for a long time for this purpose.
kennu··on How to (and how not to) design REST APIs
To me it's a good goal. I want to keep things simple and minimize my work. It works very well with a document database like DynamoDB. Even if often there is a small translation going on, removing a few attributes or adding a few to achieve backward compatibility, but mostly passing them 1:1.
kennu··on Why You Should Write Your Own Static Site Generator
It's 2-3 hours for the first version. Then you want to add something to the website, and you find you don't have the feature for it, and need to spend another 2-3 hours. This repeats every time you're adding something and becomes a massive time sink. But if you don't mind, sure it's okay.
kennu··on How to (and how not to) design REST APIs
My point about arrays vs maps is based on the idea that you store the data in e.g. DynamoDB as the same structure as it is represented in the API. If you store an array in an attribute of the database item, you cannot update its contents in an idempotent way. Inserting or appending to the array multiple times (using the relevant DynamoDB functions) causes it to grow more and more each time. Whereas when you use a map object, updating a specific key in the object is an idempotent operation and has no effect when repeated.

I realise this is pretty DynamoDB specific. But there are also other points to be made against arrays, such as being forced to maintain their order in any kind of database, which can be quite bad for performance. When using a key value map object, there is no guarantee of the order of the items and users of the API will reflect this in how they use the API, relying on the object keys instead of array indices or array order.

kennu··on How to (and how not to) design REST APIs
The "v3/application/shops/{shop_id}/listings/{listing_id}/properties" structure is typically important for database partitioning when using e.g. DynamoDB. You have to include both the partition key and the sort key in the URL to access the database item. Otherwise the database doesn't scale out as intended.

I also disagree with the advice to always use Arrays instead of Map objects. It is very difficult to partially update Arrays in an idempotent way. When you use a Map object, you can update individual items in the object by their keys. That is why I think you should avoid Arrays in API data structures as much as possible.

kennu··on Should you use a Lambda Monolith, a.k.a. Lambdalith, for your API?
Typical usage is one Lambda per service. Then use switch (event.routeKey) { case 'GET /path: ... } to serve the different API Gateway routes attached to the Lambda. It doesn't have to be very complicated.
kennu··on Testing if a port can be reached, using built-in tools other than ol' telnet
Awesome, I think I had the same book in 1990s. Things were so simple back then, when the default approach to anything was to start writing some C code with socket calls.
kennu··on AWS Customers Cannot Escape IPv4
Worst for me is CloudFront not supporting IPv6 for custom origins. If you happen to run a lot of separate Fargate containers as origins, you have to enable public IPv4 addresses for them, and that will soon double the price of small confainers. Amazon needs to make their infrastructure actually support IPv6 before starting to charge extra for legacy IPv4 usage.
kennu··on Ask HN: What happened to Web3 startups?
> It's really not that hard to run a node, and could be packaged into common usage easily.

In my experience, it's not hard to run a node, but it can be hard to get it to sync with the Ethereum network, especially using older hardware. You need a lot of fast SSD disk space, and the blockchain keeps growing.

Also, nowadays you probably also want Polygon and maybe some other L2 nodes, since Ethereum's scaling strategy is based on layer 2 networks. And they need even more disk space..

kennu··on The UI of Hacker News Is Perfect
What really bugs me nowadays is lack of dark mode support on HN. Quite many websites Will autodetect it when I turn dark mode on on my phone, but for some reason HN refuses to do that. It seems like a no-brainer feature to autodetect it.
kennu··on The Prime Video microservices to monolith story
Many comments seem to miss the point that nowadays native AWS cloud applications are meant to be built by combining various AWS services using Lambda as the glue between them. It's not about serverless vs non-serverless: it's about using cloud services for the purpose they are each good at. In many cases you might actually have more IaC code than Lambda handler code, especially if you can leverage services like AppSync and Step Functions. The application is no longer a set of microservices; it's a set of CDK / CloudFormation stacks and the resources that they define, some of which might be microservices.
kennu··on FaaS in Go with WASM, WASI and Rust
I've been hoping to have WASM/WASI as an official AWS Lambda runtime for a long time. Ideally, it would be an evergreen platform that runs code forever once deployed. I'm pretty bored with updating Node.js versions every year or two to hundreds of Lambdas.
kennu··on Richard Bartle explains Web3's flaws at a Web3 conference. It doesn't go well
Based on the article, his critique and analysis of in-game NFT usage was pretty shallow and not very technical. I think there would be many ways to synchronize blockchain NFTs into game items, make them disappear from the game (with some delay) when the NFT is transferred to someone else, etc. I can imagine there would be many practical problems to solve, but real critique should be based on how someone actually tried to implement all this and failed. Otherwise it's really just an imaginary strawman argument.
kennu··on Some Ubuntu security patches are now behind 'Ubuntu Pro', a paid product
That's all nice, but I have more than 5 machines, so there doesn't seem to be a well fitting pricing option for this kind of home power users.
kennu··on Some Ubuntu security patches are now behind 'Ubuntu Pro', a paid product
Ubuntu Pro pricing (https://ubuntu.com/pro/subscribe) seems pretty weird for a power user with a few desktops and a bunch of servers at home. Apparently it would cost thousands of dollars per year to subscribe them all, and require strictly counting the number of devices used. If it was something simple like $99 for unlimited usage, I would probably subscribe right away.
kennu··on S3 will automatically block public access and disable ACL for new buckets
People who say this should have been done earlier, what is the use case where you considered this a problem? This was already the console UI default for manually created new buckets. Was it a problem with using CloudFormation or APIs to create buckets?
kennu··on Crypto’s Final Price Could Be Zero
On the Ethereum side, the cryptocurrency is used as an incentive for nodes to operate the global EVM (Ethereum Virtual Machine), which processes smart contract transactions. So one could argue that as long as the transactions have at least some value to some application, the cryptocurrency will also have non-zero value.
kennu··on Dwarf Fortress – randomly generated, persistent fantasy world
Nice to see there is a release date now! Wishlisted quite a while ago already, when no date was set.
kennu··on Amazon Alexa is on pace to lose $10B this year
I think that semantic discussion on what constitutes as "listening" is not as interesting as what it actually does with the signal received from the microphone. I posted a description of that in this thread earlier.
kennu··on Amazon Alexa is on pace to lose $10B this year
Safe assumptions are great for managing personal privacy, but in my view, one should be careful not to present them as facts in discussions. E.g. I use privacy shields on cameras to mitigate risk of eavesdropping, but I don't claim it's actually happening. People have also reverse engineered Echo devices and analyzed their network traffic, and when someone claims the devices are "listening to everything", I'm interested in whether the claim is really based on such analysis.
kennu··on Amazon Alexa is on pace to lose $10B this year
Amazon has a white paper on how it's supposed to work. According to the paper, yes, it's technically listening to audio, but storing it only in a temporary RAM buffer until it detects the wake word. I'm personally mostly interested in what gets recorded or sent to the cloud.

"Echo devices use on-device keyword spotting designed to detect when a customer says the wake word. This technology inspects acoustic patterns in the room to detect when the wake word has been spoken using a short, on-device buffer that is continuously overwritten. This on-device buffer exists in temporary memory (RAM); audio is not recorded to any on-device storage. The device does not stream audio to the cloud until the wake word is detected or the action button on the device is pressed. If it does not detect the wake word or if the action button is not pressed, no audio is sent to the cloud."

https://d1.awsstatic.com/product-marketing/A4B/White%20Paper...

← PreviousPage 3 of 18Next →