peterthehacker

Joined 6 years ago

Karma
475
Submissions
169
Member since
Jun 12
Say hi: peterthehacker3 at gmail.com
View on Hacker News

Recent submissions

Comment · 5 years ago
Both mutate o. If you ignore the array returned by map then they’re equivalent.
Comment · 5 years ago
Look up any programming language popularity survey. Pure FP languages are substantially less popular, therefore less commonly understood and harder for the average dev to work with.

If FP was the norm, then you could make the same argument for OO.

Comment · 5 years ago
I think most programmers would disagree with you on this. Perhaps after enough FP experience the cognitive load that comes from the language’s constraints fade away, but I haven’t seen this in practice. FP is less commonly understood and harder for the average dev to work with.

> Come on, most of us are writing SAASes, APIs/backends and basic frontends here (yes, the rest of you do exist), and even for shitty O(n^2) algos, your n is probably in the 10-20 range. Your bad algorithm will not take down the server.

This isn’t related to the earlier point but I’ll bite. This thought process assuming “Your bad algorithm will not take down the server” is a recipe for bad engineering.

For example, we had a bulk action (1-500 records) in our API where the first implementation pulled all the data into memory and processed the data in the request. This ended up being disastrous in prod. It took down our server many times and was tricky to track down because the process would be killed when it maxed out memory.

The solution wasn’t to switch languages or anything. It was just to move the operation to our async worker queue and stream through chunks of data to avoid running out of memory. It cause a lot of headaches for devops that should have never happened.

While you’re right that there are many cases where n is not large, engineers must consider how large n can be or explicitly restrict n before pushing a bad algo to prod.

Comment · 5 years ago
> After spending years in functional-land, I find the for loop (and while loop) construct maddening; you have to maintain the state of the entire enclosing scope system in your head.

This is only true if immutability is enforced. In js you see map used to mutate variables outside the scope of the map closure all the time.

  const o = {}
  const d = [1, 2, 3, 4]
  d.map(i => o[i] = i**2)
Which is equivalent to this python.

  o = {}
  d = [1, 2, 3, 4]
  for i in d:
    o[i] = i**2
The cognitive load is the same in both. The strength of pure FP languages come from enforced immutability, but that constraint often adds cognitive load in other ways.
Comment · 5 years ago
> I've tried Python, hated the inconsistency of it

Can you elaborate on this? I’ve written in both Python and Ruby, but I’m not sure what you mean by this critique of python. I wouldn’t characterize either language as “inconsistent.”

Comment · 5 years ago
Tried with Elon and Gates, but both threw this error

  Error occured while trying to proxy: hf.space/
Comment · 5 years ago
> we, “the old folks,” just don’t get it

Zuckerberg is 37 years old, so he’d probably be lumped into “the old folks” category. Why would he get it and not us?

I’m, a decade younger than Mark, so idk if I’m young enough by your standards to get it, but my sister and her friends are in college and think this is all a joke. None of them are interested in putting on VR goggles, let alone joining the “metaverse.” None of them had heard of it until Facebook’s name change.

The Metaverse is a top-down Wall Street sponsored hype cycle. It’s not a matter of “old folks” not getting it. It’s Zuckerberg’s attempt to distract Wall Street investors and consumers from Facebook’s growing problems.

Comment · 5 years ago
Comment · 5 years ago
Comment · 5 years ago
Thanks! Very cool. I haven’t used couchdb in prod. I’ll read into this more.
Comment · 5 years ago
Comment · 5 years ago
> Whenever this topic comes up the conversation always centers around money or housing or other brute physical facts

That’s not what the article is about. It’s about bad governing and policing as the primary cause of SF’s homelessness problem.

> He[Michael Shellenberger] blames San Francisco’s woes on a culture of permissive lawlessness and a mistaken view of what constitutes moral policymaking. For example, many on the left believe the lax prosecution of laws is compassionate.

The article also mentioned that this is a problem that’s specific to SF and homelessness in the rest of the country is not as bad.

While I’m as much of a fan of philosophical rants about the decline of human civilization as the next guy, that’s not what the article is about. Also, some comments are unrealistically pessimistic

> The family is the center of a human’s life, and we’ve destroyed it… We look away from our families and attach ourselves to a reactionary “culture” that’s completely…

I see where you’re coming from, but many people’s lives are not like this. The world might be heading this way with all the challenges we’ve faced transitioning society online, but the internet is still very young. We can learn from our mistakes and build healthier social systems.

Comment · 5 years ago
Awesome! I wish you well too. I hope today is a better day :)
Comment · 5 years ago
So much flamebait. These kinds of comments aren’t good for anyone.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton