HNHacker News
TopNewBestAskShowJobs

twhitmore

299 karma · joined April 22, 2019

submissionscomments
twhitmore··on Fast subtype checking in the HotSpot JVM (2002)
Cliff Click & John Rose on the JVM's subtype check -- achieving complete subtype checks in only 3 instructions and 1 memory reference, essentially all of the time.

Nice paper for those interested in language implementation & optimization.

twhitmore··on A tale of two particles: Not all radioactivity is risky or harmful
My understanding is that radioactive waste volumes & activity differ based on reactor type. Light-water reactors (PWR/ BWR) only burn 3% of the fuel energy hence leaving large energies as mid- and high-level radioactive waste.

Heavy-water reactors such as CANDU can achieve greater burn-up, can avoid enrichment, and even reportedly burn waste from PWRs as fuel. There are downsides but to my mind they seem small.

https://en.m.wikipedia.org/wiki/CANDU_reactor#Fuel_cycle

twhitmore··on Dynamic types have the potential to be more than "no static types"
Eclipse IDE (Java) can run your project, even if it doesn't all compile.

I expect this must be fairly common among IDEs with incremental compilers. You can run valid sections & gradually progress the complete correctness. No need for a dynamic language.

With static typed language, reliability and refactoring are easy.

I'm scripting some small scripts in Python this week but every time I come back to it, I am reminded how not actually very good it is.

twhitmore··on Using a framework will harm the maintenance of your software
I've had extensive experience on both sides of the fence -- working on apps within existing frameworks, and also maintaining custom frameworks & libs for apps using those. Unfortunately I find this article of very little value.

The author's claimed idea of "decoupling from the framework" is generally ineffective & impractical. It leads to extra layers of adapters & SPI with high cost and almost always zero value.

These sure add bloat & make the codebase pointlessly difficult to navigate, but are improbably unlikely to ever add value in allowing the framework to actually be changed.

Difficulties include mismatched abstractions, endless adapter layers, parameter types for methods also all needing to be abstracted, restricted capabilities, difficulty conveying behaviour/ dynamism rather than static values, and -- of course -- poor performance.

Results are severe choke-points hindering functionality, broken abstractions where stuff actually had to be done, and 90% of the SPI abstractions turning out worthless if you ever did try to migrate to another framework.

I'm an architect. I've seen people's non-portable abstractions so many times. The article's advice just seems so unlikely to help.

Pick a framework that offers long-term maintainability and lets you separate out your domain model & business logic, and just code directly in it.

Rather than railing against bad frameworks from limited experience (perhaps in rickety languages too), the author should perhaps spend some time to find a good one. Spring is fine for many purposes. The MVC is coupled at the front, but your domain model need not & should not be. Focus on that, which should be your business value.

twhitmore··on Ask HN: Why is Microsoft Teams still so bad?
As an architect working on maintenance & refactoring, I find regular value in being able to understand the context (issue tracker ticket) in which a commit was made.

Also more than mildly useful for devs doing porting work.

Commit comments are rarely substantive enough, and "asking relevant people" is nice but not an actual substitute for keeping meaningful records.

twhitmore··on Intel Hyperscan is a high-performance multiple regex matching library
Capturing is not supported. That eliminates many normal regex usecases, where you want to be able to capture & interpret the data.
twhitmore··on The self-fulfilling prophecy of React
The right abstractions?

React's functional components are a monument to concept over practicality, and the overall ecosystem is a hot mess.

Populating initial state should not be a difficult special case. Handling state changes should not be a choice of esoteric extras. These are just basic requirements of any reasonable application.

React got quite a bit right, and it seemed cool at the start, but at a certain point the enthusiasm for "concept" diverged from actual requirements.

twhitmore··on Who is the author “JC Shakespeare”?
I laughed at the authors CS Salad, B Noodles and C Fajita -- Google in that case having parsed a cafeteria lunch menu.
twhitmore··on Static site hosting hurdles
I agree -- the OP said space for all the separate HTTP response variations might be an issue, and "With a smart enough storage format all of these could be solved".

I think he misses that storing HTML and having a webserver turn this into HTTP responses, might be exactly the storage format that solves this problem.

twhitmore··on Outcomes, Mistakes, and the Nuance of Error Handling
Failing and aborting the request/ user action is the general & correct response to an error.

Retrying is relevant for a specific small segment of callsites dealing with unreliable network or hardware interactions. This fact and knowledge of it should inherently be obvious at the callsite.

I do recognize a valuable distinction between predictable and unexpected errors. In business applications, I refer to these as "business" and "technical" exceptions. Business exceptions are caused by a violation of business rules in the called layer directly, and are potentially predictable & recoverable. Technical exceptions arise from lower layers, are beyond the bounds of encapsulation, and are not recoverable. It seems the Mistake vs Error concept maps to this. I'm not much convinced about nuance beyond this.

To be honest I think both Rust and Go have fallen into a mistake of forcing every operation -- the vast majority being unrecoverable errors -- to be checked. They should just be thrown as exceptions.

Lastly many of the author's examples sound like bad error handling to me. They lack context as to the client request. If something the client could directly understand & fix is broken, it should report a business exception aka "mistake". Otherwise it should report an error without expectation of recovery.

A link on the exception paradigm, using Java as a reference: http://literatejava.com/exceptions/checked-exceptions-javas-...

twhitmore··on Bookout vs. Toyota – 2005 Camry L4 Software Analysis [pdf]
Toyota vehicles were investigated in the 2000s for claimed "unintended acceleration" causing up to 89 deaths. This is an analysis conducted by Michael Barr finding potential flaws in the electronic throttle control system.

Michael Barr analysis: https://homepage.cs.uiowa.edu/~tinelli/classes/181/Fall14/Pa...

Some additional presentation from Prof Phil Koopman: https://course.ece.cmu.edu/~ece642/lectures/10_koopman_publi...

twhitmore··on SQLite or PostgreSQL? It's Complicated
Well, unless you care about disaster recovery or availability.

For most business applications used by more than one user there are usually some expectations that data will be retained and the application will be available.

twhitmore··on JVM Anatomy Quark #10: String.intern (2019)
It works 24/7, I guess. Reliability is the key -- it stays running.

It's got a vast array of third-party libraries available. It performs pretty well even in a low-latency environment.

Developers can spend time solving actual business problems, rather than waiting to compile, fooling around with memory allocation, templating problems & inefficient STL data structures, or badly handrolling data structures.

There is a little extra work to stay within a latency envelope, but there are definitely productivity boosts from just forgetting all the old C legacy and being able to work at a higher level of thinking.

Even better, use the JVM but try Kotlin as a language.

twhitmore··on The Grug Brained Developer
Microservices

grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too

That made me laugh. The microservices madness of the past decade is now starting to settle down to more mature understandings, but there are still a lot people biting off large testing, operational, and data transactionality/ reporting costs.

People often don't recognise beforehand the magnitude of extra complexity & associated productivity costs.

I've seen companies architecting 50 microservices with 50 separate datastores when they actually needed 5 midi services.. Then lose half their productivity trying to work with all this.

twhitmore··on How to write a Git commit message (2014)
Good question. The example message is adapted from a fast-moving innovation stream; it's an example of moving quickly and getting a lot of major work done.

In a more mature area, pace of work could often be slower and commits more granular. Until it's necessary to refactor/ reengineer things -- then commits are often larger again.

That's been my experience anyway, YMMV.

twhitmore··on How to write a Git commit message (2014)
Interesting topic. From my experience Headline + Bullet Points are far quicker to convey useful information, in a form that is terse yet easy to read.

For example:

----------------

improve Buffer Cache Management & logging

- change 'tryDrop()' to skip immediately, if lock unavailable

- move BufferCache logging to a separate logger

- attach BufferTrim.Unsuccessful -> Preemptive Flush of oldest buffers

--------------------------------

Having worked in many codebases & internal docs, I've found narrative significantly less efficient to read & write.

In commit messages, far too many developers skip almost any detail as to what they're changing & why -- the slowness of narrative formats may substantially contribute to this. In docs (Wiki etc), narrative encourages developers to ramble about minor technical details while omitting all high-level context.

Headline + bullet-points bypass a lot of struggles with narrative by allowing a simple headline and then, well, cutting to the point.

This also illustrates a informed personal preference -- studies find lowercase English words faster to scan/ comprehend.

See: http://literatejava.com/git/how-to-write-a-good-git-commit-m...

twhitmore··on Domain Driven Design Reference (2015) [pdf]
The interesting thing is that DDD identifies & distils most (not all) of the patterns I'd seen used or had to crystallize myself, over the past say 15 years of application development.

Key aspects like building a domain (business) layer, separating this from the DAO layer, speaking domain terminology, clearly defining entity identity (it's not a hash/ equals on Customer Name), encapsulating meaningful domain operations into domain entity & value types, orchestrating fine-grained data into larger aggregates, and orchestrating major business processes as 'services' are all great patterns.

What kind of pitfalls or gotcha moments are you running into? I would think the patterns above should suffice for business applications ranging up to moderately complex.

twhitmore··on How to balance between delete compliance and backups
It just moves the problem, to how do you delete the keys & manage backups of the keys.

You have to backup the keys, since a system outage would otherwise leave you unable to function.

My shot from the hip: encryption/keying is irrelevant except for highly sensitive data (credit cards, crypto wallets). Plain deletion from production databases should be sufficient, backups should be "at arms length" but otherwise should not need to be treated specially.

Another shot from the hip: System outage & RPO loss of a requested deletion is an act of God and no worse (indeed probably less important) than losing the other business transactions in that time period. I don't see special handling being needed for deletion.

twhitmore··on Generics can make your Go code slower
You can run high-volume business and mid-level infrastructure (messaging) systems day-in day-out in Java, and struggle to see more than 0.1% CPU needed for garbage collection.

The light-bulb idea here is about reliability, security and productivity. Managing memory manually a la C/ C++ is a proven disaster in all three respects.

Maybe ten or fifteen years ago GC was costly, but these days it's highly efficient and not incomparable with programmatic allocation.

twhitmore··on Hooks Considered Harmful
I think these insights capture very clearly why "hooks" are a problem rather than a solution.

Hooks are the kind of complex technical idea, which some developers (a certain Mr Abramov) find interesting.

However "complicated and interesting for navel-gazers" are normally rather negative characteristics in tools. Tools which are "reasonably simple, predictable, easy to reason about and easy to compose" are far more productive.

twhitmore··on No-JavaScript Fingerprinting
Agreed. It's not a "fingerprint" at all as in most cases, it won't be remotely unique.

For example: every user in the world with the same screen size, browser & platform will get the same result. For desktop it's window size rather than screen, but coarsely bucketed.

Thousands or millions will share the same fingerprint. It seems somewhat unrealistic to ascribe much advertisement or tracking value to this.

twhitmore··on Deep diving into the thread pool: a debugging story
You might want to ask yourself some questions about the technology platform you're building on.
twhitmore··on Motorists have been stranded on a major interstate in Virginia since last night
MMP elections, or STV with multi-member districts, result in a broader diversity of parties being elected -- not just two opposing parties.

This allows coalitions to form around shared interests, and results in 1) politics being more representative of what voters want, 2) more moderate politics avoiding wild policy swings, and 3) politics being more constructive.

It really gives a huge quality improvement of politics moving from a binary to a plural system.

twhitmore··on The argument against clearing the database between tests (2020)
Good article. Data & state are hugely important for testing, and it's good to see others engaging with the reality of these.

I had key responsibility for a very large software system (10M LOC) which was highly configurable; everything was data-dependent, both for product configuration and the actual accounts being tested.

Others had tried building test datasets using in-memory DBs, but the cost of maintaining these test datasets had already exceeded their value without even achieving 10% test coverage.

Rather than avoiding the database we took the architectural choice to acknowledge it, leverage the already-available standard configuration datasets, manage & minimize the degree of changes committed (test in transactions & rollback wherever possible), and manage & minimize dependence on pre-existing account state.

Within six months we were able to achieve a level of coverage & reliability where >60% of bugs were detected promptly on being introduced. Prior to this they had taken 3-5 days before end-to-end testing had confirmed detection.

Use of a database in testing is not completely easy, but sometimes it can be the most efficient solution to the problem at hand.

twhitmore··on T-Wand: beating Lucene in less than 600 lines of code
Interesting. I can't say Lucene gives great results for relevance on a large database, eg. Confluence.

However there is a large space between algorithmic assumptions and what "relevance" actually is to the user. This article may improve, but my feeling is -- both for search and for the article -- that more context is needed.

twhitmore··on Performance Deficits in Apache Cassandra
Author here. Thanks for reading! As well as these DBs, we also evaluated Kafka and a document database (CouchDB, it seemed awful).

For messaging, the Commit Log and Log-Structured Merge Tree storage in Cassandra should have been near ideal. Commit Log gives durability, LSMT gives automatic compaction -- important for the pending work store, where you delete entries once work is completed.

The domain here is healthcare; due to legal requirements & existing product architecture, deployments and databases are usually per-customer rather than trying to scale the world on a single cluster. For these scenarios Postgres and Cassandra should both be (have been) highly suitable.

The Postgres ecosystem is very active these days, and offer options for further scaling. Aligning with Postgres already looks like a 5x scalability improvement over the prior datastore, and AWS Aurora and Citus Data both offer avenues for further performance if we ever needed.

twhitmore··on The database ruins all good ideas
Exactly. Consistently and reliably storing business data is something that actually turns out to be important in the real world.

If you can't actually retain your business data, it really doesn't matter how many "good ideas" or fancy deployment strategies for the presentation tier you have.

twhitmore··on DeepMind says reinforcement learning is ‘enough’ to reach general AI
While I am agnostic as to the advantages of RL over simpler ML, some basic structural concerns seem to apply here. The potential concern is that if RL works, the very best factors for learning are likely to be potentially dangerous.

The best environment for learning is the richest -- ie. unrestricted access to be the entire Internet/ or the world via the Internet.

The best reward function is quite likely to be reproduction. If the researcher allows moderate action but attempts to limit reward functions, at a certain level they may find the AI has found a better reward.

If the claimed advantages to learning of richer environments & richer action capability are even somewhat true, researchers are likely to be strongly incentivized to pursue such risky structures.

twhitmore··on UUID, serial or identity columns for PostgreSQL auto-generated primary keys?
In datamodelling, tables can often be categorized by lifetime. 'Business Relationships' eg. customers, suppliers, products have a fairly long lifetime; whereas 'Business Transactions' are created on a much higher frequency.

I'm generally fairly comfortable using int for business relationships, and bigint (long) for transaction data.

For performance, insertion speed often seems to be dominated by 'commit latency' to sync to the disk; rather than by record size. I would agree that record size affects table scan, but for many datamodels keying may often be a relatively small proportion compared to the size of text fields and other data.

I like to model keyspaces to work for 200 years, for the largest forseeable market growth, times at least a factor of 10 for safety.

twhitmore··on My Personal Creed of Employment
It means identify & fix the specific problems of the existing asset, rather than foolishly trying to rewrite.

Source: Much experience with surgical refactoring/ re-engineering/ rearchitecture.

Plus observation of the after-the-fact results of many less experienced teams "writing" or "rewriting" software.

← PreviousPage 2 of 4Next →