Better HN
topnewbestaskshowjobs
Log inSign up

Scriptor

1,852 karma · joined Nov 10, 2008 (18y ago) · 533 submissions

Github: http://github.com/Scriptor
Submissions

comment 9y ago · link · parent

You can hide a loop behind a function call in Go, Python, really any imperative language.

What makes map different is that it separates the looping mechanics (incrementing, initializing and appending to the collection) from the actual computation we want to perform on each element. It's just separation of concerns.

comment 9y ago · link · parent

map doesn't do any magic behind the scenes, it goes through a sequence exactly once.

Can you given an example where map might increase algorithmic complexity like that where the imperative version would not?

comment 9y ago · link · parent

Maps are explicit transformations of data. For some, making the business logic explicit is simpler.

comment 9y ago · link · parent

Gitlab's team is worldwide. YP seems to be someone in EU time, which right now is UTC+1.

That would mean that the incident happened around 11pm or midnight in YP's local time.

comment 9y ago · link · parent

The functionality was polished and sexy.

The UI was clunky and the epitome of what happens when programmers design. Everything was jam packed into the screen so that it was immediately obvious what kinds of things you could do or how to go about what you wanted to do. It introduced a lot of concepts all at once, causing an unnecessary learning curve.

comment 9y ago · link · parent

https://learnxinyminutes.com/docs/powershell/

comment 10y ago · link · parent

I'm assuming Person is a record constructor, is isValid here a field in that record or another function?

comment 10y ago · link · parent

That's because your code assumes those convenience functions exist while the parent's code writes out the anonymous functions.

The direct translation of yours' to Clojure would be:

    (filter valid-person? (map init-person names))
Meanwhile, the direct Haskell translation of the parent comment is:

    filter (\p -> isValid p) (map (\n -> Person n) names)

69.

AWS IO Performance: What’s Bottlenecking Me Now?(engineering.theladders.com ↗)

6 points · by Scriptor · 10y ago · discuss

comment 10y ago · link · parent

The Mayan script used a similar approach where logograms could be complemented by phonetic elements.

comment 10y ago · link · parent

He's a geochemist, not an archaeologist. Racial issues aside, there have been many instances where a scientist in one field tries to make sweeping statements about another field. In most cases they lack a deep understanding of the other field and are unaware of mountains of evidence that otherwise contradict what they say.

comment 10y ago · link · parent

I'm not a high-status authority and I was still able to connect emotionally to the human ones. Or, at the very least, each line contributed to a consistent mental picture or idea.

comment 10y ago · link · parent

Yep, the human poems would often refer back to an idea or word mentioned before. The computer poems read like something from a good markov generator.

Actually, you can kind of reverse engineer the algorithm behind Sonnet #2. It seems like they first pick a bunch of related words that rhyme (drawer, door, floors, apartment, wall) and then build up the line backwards. The problem is that even though the words are related, the actual lines don't form any single cohesive image.

comment 10y ago · link · parent

Luckily for us, computers are slightly more sophisticated than drills and we can incorporate sane safety checks with relative ease. In this case people are just asking for an explicit flag in the rare situation when they do want to delete everything.

comment 10y ago · link · parent

Everyone I know uses Messenger for group conversations.

Anecdotes can go both ways. As far as I've been able to tell, WhatsApp is most popular outside of the US.

76.

Things every React.js beginner should know(camjackson.net ↗)

412 points · by Scriptor · 10y ago · 237 comments

comment 10y ago · link · parent

Agreed, the benefits of type safety are often thrown around but this is sort of what type safety looks like. Yes, as the author says it makes things "annoying to develop". This is because the developer now has to read the docs and be aware of this invariant for the particular component they're using. They'll go, "Damn, guess I can't use a list here," and fix their code.

However, let's say later down the line a new engineer comes in and is tasked with a bug fix. If they're using Cycle.js and see an array, they might think, "Oh, I can easily solve this by adding another element to this one-element array." Without any invariants they'll run into subtler bugs and errors trying to figure out what went wrong.

But with the invariant, if they tried to jam an array there they would immediately get an error and know what's wrong.

This isn't something that will crop up in a simple one-day project like the author was creating with his coworker. It's instead a great example of how a little annoyance can make future maintainability way easier.

comment 10y ago · link · parent

The author even anticipated your parent comment's argument and used Elm for this very reason. He seems to make it reasonably clear where Elm's approach is different from that of Cycle.js and still both are preferable to React/Reduct.

comment 10y ago · link · parent

True, although the harshness of Ice Age Europe varied over time. It wasn't some hellish landscape but a thriving ecosystem with all sorts of wildlife and other food sources.

The difference is that Neanderthals had hundreds of thousands of years to adapt to the environment of Ice Age Europe. They had even evolved actual physical adaptations to help them with the cold.

But the humans who moved into the Arctic only had a few thousand years at most to adapt, if that. Neanderthals certainly weren't dumb and primitive, but as you said they were narrowly focused. Modern humans were able to rapidly adapt their lifestyles and technology to allow them to thrive in extreme environments such as the Arctic.

comment 10y ago · link · parent

They weren't ape-like idiots, but nonetheless newly arrived Homo Sapiens used noticeably more sophisticated tool-making techniques. This is one of the ways archaeologists are able to distinguish Neanderthal sites from, say, Cro-magnon sites. It is also thought that modern Homo Sapiens lived in groups much larger than Neanderthals did.

comment 11y ago · link · parent

Looks like the story some time ago. Especially with emotionally charged stories like this, people always tend to misremember or warp the details and not realize they're doing so. I'm sure the general gist is right, but I always get a little suspect when someone describes eye-rolls or how someone sounded sarcastic. Those are exactly the sorts of things that we remember differently as time goes on.

comment 11y ago · link · parent

It'd be easy enough to check for that by having a control where you interview people without using the extra storytelling-lie-detection methods.

comment 11y ago · link · parent

Can you give some details about Imba's diffing?

comment 11y ago · link · parent

Sensational title. The actual stone age was called such because humans were actively modifying and creating new stone tools.

comment 11y ago · link · parent

Actually, HN lets you edit titles and URL's after they're already submitted. There might be limits on that, though. Check for an 'edit' link.

comment 11y ago · link · parent

The URL is entered wrong. Remove the /# from the end and that should fix it.

comment 12y ago · link · parent

> Catholics murdering them with terrible savagery

I see what you're trying to get at, but you make it sound as though the Islamic world was brutally traumatized by the Crusades. The savagery was no more terrible than any war of that time. And they didn't really "seal themselves off from the world". They did, however, seal themselves off from Europe culturally and intellectually. Politically and economically there was still plenty of engagement.

What the Crusades did do was to further hamper the adoption of European ideas in the Islamic World. While the Crusaders were happy to adopt both goods and knowledge from the Middle East, Arabs and Turks saw little reason to embrace any European customs and ways of thought. The Crusaders were invaders in their own lands and for that reason alone a typical Arab's perception of Europeans would've been much worse than a typical Frank's perception of "Saracens".

Amin Maalouf gives an example towards the end of "The Crusades Through Arab Eyes" (decent book, by the way, though I liked "Arab Historians of the Crusades" better). As the Crusades progressed and Europe entered the high middle ages peasants in the West started to gain more rights and privileges as the feudal system continued to weaken. However, none of this was seen in the Middle East, where local lords ruled their holdings with an iron grip and peasant rights barely improved.

88.

Understanding how Haskell uses the stack(well-typed.com ↗)

1 points · by Scriptor · 12y ago · discuss

12345
18