HNHacker News
TopNewBestAskShowJobs

bernawil

454 karma · joined March 7, 2013

submissionscomments
bernawil··on Modern C++ gamedev: thoughts and misconceptions

  The inclusion of lambdas has shaken things a little
I'm curious, do you consider lambdas as more or less "dumb"? Because I consider them the dumbest, simplest and maybe best way to do polymorphism. In a way, OOP's whole shtick was about not using them and instead extend stuff with classes.
bernawil··on Pretending OOP Never Happened
bingo. It's not "global state" what's wrong. It's global MUTABLE state.

OOP brought the terrible idea of coupling state and behavior, so of course "global state" would be wrong.

bernawil··on We at $Famous_company switched to $Hyped_technology
I cover this in my article titled "$HYPED_TECHNOLOGY considered harmful".
bernawil··on Secessio plebis
> and began to depend on Sicily and Egypt to produce the grain for Rome

Later in the fourth century there were lots of shenanigans around securing the grain supply for the capital which in that period had shifted to north africa. I don't think we can rule out soil degradation as the reason for the shifts in the productive regions across ancient history, like how Paestum turned into a swamp due to soil erosion.

bernawil··on A look at modern PHP
> PHP threads

Still, my understanding is that php-fpm spawns processes, not threads. What is "persistent" is the php-fpm daemon itself that's connected to nginx, but each request spawns a whole process which has to bootstrap your whole framework every time. That's the reason frameworks like symfony run almost mandatorily with something like opcache.

bernawil··on A look at modern PHP

  I once asked Rasmus about this face-to-face, during one of his presentations, specifically his thoughts about the pThread extension (https://www.php.net/manual/en/intro.pthreads.php), and he responded that it was not required in a web context, as web servers already have threads per request so its a mute point.
if each web server thread that serves a request ends up spawning a full PHP process then it's not a mute point.

  pretty hard to proceed with some code that works with a DB when the connection can't be established, so proceed with what exactly other than error handling? 
proceed with all the rest of the bootstrapping code in parallel instead of blocking and waiting for each.

  is a synchronous thread, as described above above. By design.
it's a synchronized full forked process. Because the runtime was written using memory unsafe C features from the start. By design doesn't excuse it being a bad design.
bernawil··on A look at modern PHP
Haven't been following php in years, but from back in the day I remember many different approaches trying to introduce threads and none could guarantee safety for the fundamental reason that the language itself is implemented unsafely. The runtime was done in C with unsafe features from the start. So process forking was the only sane reason to run php. I don't know how much of that is still true, though.
bernawil··on Remote Work Report
those arguments look just slightly in bad faith since they act like they're only competing for talent against local non-remote companies for every location when they're not. They're also competing against other remote companies, specially those that don't do location-based comp.

  Team members in low-wage regions being in golden handcuffs and sticking around because of the compensation even when they are unhappy.
Those people will be still be in golden-handcuffs until they find another remote job.

  A concentration of team members in low-wage regions, since it is a better deal for them, while we want a geographically diverse team.
Come on, you can still pay top dollar globally and hire evenly around the globe if that's what you want. It's just cheaper their way.

Honestly, the whole thing is just a huge rationalization. They could just have said "we adjust for location because we can".

bernawil··on Surgical mask brace creates a seal making standard masks comparable to N95s

  - this rubber bands make standard masks comparable to N95s!
  - and how do they compare, then?
  - mmmh, bad. Comparably bad.
bernawil··on Surgical mask brace creates a seal making standard masks comparable to N95s
come on, the way her ears bend and turn purple after she puts on those super tight rubber bands looks like they're gonna rip apart. I imagine as soon as the take was over she took it off fast, laughing about how anybody could try that thing.
bernawil··on SQL is a better API language than GraphQL – Convince me otherwise

  Most GraphQL servers you simply point it at a database and it automatically makes your entire schema, including tables and fields that shouldn't be exposed to end users, readily available.
You're arguing against auto-generated gql setups, not gql. And it's not even accurate. Anyone that makes that mistake in gql would make it in REST, SOAP or what have you.

Auto-generated REST setups are aplenty too, and lately auto-gen tools offer both gql + rest. PostgREST/PostGraphile. Hasura does both too.

bernawil··on SQL is a better API language than GraphQL – Convince me otherwise
The only extra work compared to REST is writing your query and mutations input and output types. But since any serious REST API nowadays includes swagger, it's actually even if not worse on REST.

Then it's all the same as of how much work. In the server, each REST endpoint is a gql resolver.

As of auto-generation regards: yes, gql maps great to a relational model, so you can save a lot of effort going that route. But you know, there's auto-generation for REST setups too.

bernawil··on SQL is a better API language than GraphQL – Convince me otherwise
So swagger is bad because "one request and I get your entire schema"?

> run any query on the client side" is a terrible idea

that's a big mischaracterization. A typed query language that lets you tailor your queries a la carte doesn't remotely mean the queries "run on the client side".

bernawil··on A Conversation with Alan Kay (2004)
If by secret weapon you mean a thing they used to make an irrelevant back office crud app in the 80s and now they occasionally contract maintenance work from some body shop that pays minimum wage, then sure.
bernawil··on IBM will offer free COBOL training
They probably had their own Banking industry in mind. This was in Argentina so YMMV. Back in 2010 i had friends in university looking for internships and first jobs and COBOL was a real prospect. A friend took a deal with accenture where they would give you a 2 month-ish course and then send you to consult for banks. I remember the whole "COBOL devs are retiring! salaries are gonna be huge!" which was likely to be true for the agency's rate but didn't trickle down to coders, they used to make as much as the lower rung of IT (QA tester, etc). Later in life I worked at a bank and met the fabled close to retirement AS400/Cobol developer. He didn't make more than any ssr developer with a modern stack in demand.
bernawil··on Don't Make Students Use Eclipse
Java is special since the whole compile/link/run loop is relatively slow and there's no REPL. In Nodejs or python you are expected to just run your code. Any error like a bad import/require statement you can correct quickly and re-run. Maybe even add/remove print statements while at it. And it's not just dynamic languages! You can have the same experience in Haskell.
bernawil··on PostgreSQL is the worlds’ best database

  I've literally never changed the database engine on a project
And some of us do it several times a day because we deploy to prod with Postgres but run testing and CI with SQLite.
bernawil··on How to manage HTML DOM with vanilla JavaScript only?
Did you mean something like this?

   const doThing = event => {
     input.value = event.value;
     input.focus();
     sound.play();
   }
   button.onclick = doThing
bernawil··on How UI-driven state increases accidental complexity
Not really. That looks much more like what a selector would output.
bernawil··on How UI-driven state increases accidental complexity

  In contrast, it doesn't happen with a denormalized, UI-agnostic state:
Isn't it the other way around? the UI-agnostic state IS the normalized version; the UI-aware state ready to be consumed is the denormalized one.

The choice is pretty simple to me: keep the State normalized, de-normalize it in selectors for consumption in the UI. Those selectors will look pretty much the same as the reducers you'd be writing anyway.

bernawil··on Turns out claims Airbnb was taking houses out of the rental market were right
> those houses that were already in use for Airbnb remained so

the lesson there is not to grandfather privileges if you want to actually fix something.

bernawil··on Has the bidet's time in North America finally arrived?
and we have proper "reverse shower" bidets, not those "porcelain seats with a tap" common in europe.
bernawil··on What If Andrew Yang Was Right?

  Wealth is accumulated income tax
That's only valid if you think "wealth" can only be a bunch of cash in a bank account you saved. You may own a piece of land that could even predate the government in some places. Or you may own a patent. That's "wealth" which is subject to different taxes to "income".

  so even if you expect an additional tax that grows at the same rate? 
I don't expect, anything I was just pointing a fact.

I live in a country that has experienced inflation over the last ten years and the reality is that income taxes have followed inflation but property taxes not, because the government doesn't update property book values as often. The result is that you can hold very expensive property while paying very low taxes. But this also happens in lots of other places: California and Proposition 13 come to mind.

bernawil··on What If Andrew Yang Was Right?
I don't get it. Asset prices track inflation like clockwork. What's even funnier to me is that taxes on wealth rarely raise as fast as asset prices!

If anything it's a tax on income.

bernawil··on $5000 per violation of price-gouging in CA
Most stuff is bought by scalpers and sold on the black market anyway
bernawil··on I Don't Use Classes
OOP has come to mean different things at different times. For a time, OOP definitely meant tightly coupling state and behavior. Same as inheritance, this practice seems to have been left behind some time ago.
bernawil··on I Don't Use Classes

  These functions accept state and other dependencies
That "dependencies" term is very loaded. You need to define if you call "dependencies" what the functions in your module take as argument or you're talking about those other modules your module calls.

  When I see a function, I expect it to be side effect free.
Why? though I think it's a commendable goal it's not a reasonable expectation from most languages.
bernawil··on Managed Kubernetes Price Comparison
What's a good recent example of hype-driven software? The only good example I can think of is MongoDB. All the other hyped techs in recent memory I can think of were all objectively good: Nodejs, Reactjs, Docker, Kubernetes, etc. In the same vein, I laugh every time someone brings out "javascript framework flavor of the month". That hasn't been true for 5 years at least.
bernawil··on We have to talk about this Python, Gunicorn, Gevent thing
Nodejs is single process, single thread and single core. Chrome used to run different tabs as threads of a process but that ended since Spectre and Meltdown. Back to single process since then.

  async IO creates a thread servicing that IO request
Nope. The event is a single FIFO queue implemented with libuv. It differentiates between sync and async function and basically goes around the queue running synchronous functions to completion every time it find one and async ones for a set time before switching to next one.
bernawil··on Warming Up to Unit Testing
Javascript doesn't "need" dependency injection because modules are objects, and you can mock those directly by replacing what they reference to. Very similar story in python. You could say people do DI in these dynamic languages without calling it DI.

Now Java and C# are different because they are compiled. You need a DI tool to do dynamic dispatch if you want to mock.

← PreviousPage 7 of 10Next →