Hacker News new | past | comments | ask | show | jobs | submit | rvr_'s comments login

In my experience most apps designed around relational databases will benefit from: - one-to-many and many-to-many mappings - soft delete - log tables / append-only tables - entity-attribute-value - meta columns (creator_id, timestamp, version, etc)

Beginning with them is way easier than patching afterwards


For the "play chess" example a state machine is the perfect place to begin modeling. Games, as a rule, are event-driven and are commonly coupled to a event-loop that triggers the transitions of the state machine. I think top-down decomposition has it's place, but the examples used to describe it should be given a little more thought.


I think the advantage of chess for something other than top down programming is that you're pretty much 100% what the API you want for the chess state machine is before you start. But how common is this?



No, it wouldn't be that. That can only prevent unload if it throws a native modal up (cousin of alert, confirm, prompt, etc).

I think what they must have done is push some URL to the history state, using the History API, to fuck with the back and forward buttons, enabling them to intercept when you navigate back, by having added an additional page in there, that you never visited, but that they can use to serve you this interstitial.

Just my 2c


I'm baffled any half decent site would use that. I expected some kind of new web/Chrome API.

That's a very "bold" choice of 538 if you ask me.


It’s not that, they’re pushing the “before you go” page to the history stack. https://developer.mozilla.org/en-US/docs/Web/API/History/pus...

You can see it if you right click the back button after navigating to the article.


Pointing out that the solution is not perfect is fine. It helps future maintainers, even if self. The worst offenders don't even realize the badness of their implementations, intriguing further adventurers of their code's true intentions.


My unpopular opinion is that you only forget what you have not learned and that you only learn what you do. The vast majority studies only to pass exams. So your situation is pretty normal.


This should be a crime, like selling spoiled food.


It's fraud, of course it's a crime


If they're knowingly selling fraudulent merchandise, that's interstate commerce fraud.


other than baby food/formula, it's not a crime to sell spoiled food (at least not in the USA)


Even in restaurants?


TFA is nonsense. Hard deletes should almost never be used, period. The application credentials should not even have permission to issue delete statements, thus reducing potential damage from bad actors. Things like ON CASCADE DELETE should not even exist. Anyone using them must stop and rethink their life decisions.


Truth is, our lizard brains are always forgetting the good stuff that happened but remembering every detail of some random shameful event nobody, except you, cares about.


Probably evolutionary: our brains have evolved into hardcoding those memories to avoid getting into that bad situation again.


Or, to put that another way: of what practical use is a memory of being content? It has no informational content to feed to your predictive model of the world.

Memories of unexpectedly getting rewards are quite salient, of course, because those train you to get more rewards.


School shooting is a memetic behavior, on the classical sense disseminated by R. Dawkins, not Internet's one.

Can we rephrase the problem as: how do a society gets rid of a bad meme?


Memes are international. American cultural hegemony is global. Evidence: I'm a Canadian and can name all members of the US supreme Court from memory and zero members of the Canadian one.

Memes do not stop at borders, and yet the hot zone for the school shooting plague is localized within the USA.

It's the cheap plentiful, underregulated firearms.


>I'm a Canadian and can name all members of the US supreme Court from memory and zero members of the Canadian one.

To be fair, the Canadian Supreme Court rarely does anything of everyday relevance to Canadians, much like all aspects of the political system except for which party happens to be in power (the exact identity of the PM is similarly irrelevant, though everyone knows who that is).


Please don't use this project as it makes no attempt to avoid the database file from being directly downloaded. Any sane PHP project (of witch WP is not one of) has it's index.php (and any user-facing stuff) inside a 'public/' folder, never exposing the entire project and relying on the webserver to secure things with .htaccess rules.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: