Better HN
topnewbestaskshowjobs
Log inSign up

hellofunk

9,428 karma · joined Jul 10, 2015 (11y ago) · 3,276 submissions

John Bellick, Mexico City
Submissions

comment 8y ago · link · parent

How much of the book requires Erlang or focuses on that language's features, and how much can be generalized to other languages?

comment 8y ago · link · parent

> My big regret with Python 3.0 is that the scoping rules in list expressions changed to prohibit modification of variables in surrounding scope. This degraded the utility of list expressions. The work around is so long-winded.

Can you elaborate? I'm not sure what this is referring to.

comment 8y ago · link · parent

That would be quite terrible, if in fact 50K years from now there was such a thing as computer code.

844.

In 5 states, richest Americans live in a “new Gilded Age”(cbsnews.com ↗)

155 points · by jb1991 · 8y ago · 195 comments

comment 8y ago · link · parent

My Macy’s account was hacked just this week. I got an email that my shipping address changed, and I logged in and saw several hundred dollars worth of pending items in the shopping cart.

comment 8y ago · link · parent

> setup handled via a curl-to-bash of mine gets me exactly back to where I started, down to the sessions..

Wow. I'd love to know more about that.

comment 8y ago · link · parent

Valid point. Going into space, by comparison, is time-tested and a solved problem. You will know exactly what to expect from the start.

comment 8y ago · link · parent

The older I get, the more I realize that the ultimate factor in programming productivity is how readable the language is, or how readable the typical idioms and usage of that language are. There are a lot of really awesome languages, but they are tremendously difficult to read your own code, let alone someone else’s. You can find languages that are very expressive while you’re writing the code, but that code will be read much more often than the time you spent writing it, both by yourself and likely by other people.

For this reason alone, I can really see why python has been so enormously runaway successful.

comment 8y ago · link · parent

> does not mean that millions of others have not been impacted

"millions"? Let's not spout hyperbole here. You can't say that without some backup.

comment 8y ago · link · parent

I would definitely not put NYC and Chicago in the same category for no-car friendliness.

I spent many years in NYC and only knew 1 person who owned a car.

By contrast, when I lived in Chicago, I was the only person without a car.

comment 8y ago · link · parent

I tried living in Chicago without a car… I wouldn’t say it is as optional as you suggest.

comment 8y ago · link · parent

> By July 2019, the bitcoin network will require more electricity than the entire United States currently uses. By February 2020, it will use as much electricity as the entire world does today.

comment 8y ago · link · parent

You said:

> Python uses `TRUE-CASE if COND else FALSE-CASE`.

And this is wrong -- this is not how Python if statements work.

comment 8y ago · link · parent

Conventional if statements in Python do use your preferred form of `if COND then TRUE-CASE else FALSE-CASE`.

What you are talking about is a different kind of expression, similar to a ternary operator. It is not the same as if...else

comment 8y ago · link · parent

I met an Elm dev once, who even after two years, had not used it or even knew how.

comment 8y ago · link · parent

> The experience of Guido, and it's one that I share, is that too much functional tooling drives a style that favors expressive writing at the expense of ease of reading.

This is absolutely dead on accurate. As a Clojure developer, using one of the most expressive -- dare I say, artistic -- programming languages ever created, I can say that I am totally in the zone writing code which is elegant and terse and really packs a punch, does clever things.... and then just a few days later, it is very hard for my own brain to parse my own code and figure out what it does.

For each line of code you write once, it will be read dozens of times by you or others. Code is for reading. Languages that get this right make things a lot easier for everyone.

comment 8y ago · link · parent

What is "node => ", is that valid Python? I'm new to the language and have never seen the => syntax before. The docs for 'map' don't show it either.

comment 8y ago · link · parent

Can anyone comment on the quality of these DataCamp courses?

comment 8y ago · link · parent

It’s not that you’re unclear, it’s that it is irrelevant to the discussion, as you were talking about a fairly trivial and unrelated language feature — and it is also a feature that exists in many languages, hardly unique to python.

comment 8y ago · link · parent

Most or all C++ compilers support the restrict keyword, therefore it can be used in the C++ language, even if it is not officially in the standard.

comment 8y ago · link · parent

Whose comment are you responding to? It seems you agree with my comment about pattern matching and switch cases.

comment 8y ago · link · parent

What you are talking about has nothing to do with short circuiting.

comment 8y ago · link · parent

I agree that null/nil/None is one of the worst programming constructs ever invented [0] and deserves more attention than if statements.

[0] https://www.infoq.com/presentations/Null-References-The-Bill...

comment 8y ago · link · parent

It is a fairly well-known fact that -- most of the time -- fewer lines of code translates to fewer bugs and decreased maintainability costs.

Moving from 11 lines to 1 line is, for me, vastly superior readability. And anyone who has been programming for a couple years at least would have no problem parsing the order of operations and precedence between && and || (logical 'and' is always higher precedence than logical 'or' in every language I've seen), but parenthesis are a trivial addition if desired.

comment 8y ago · link · parent

I'm curious, what about "x && y" is "python-style" ?

It's been in nearly all languages, and for decades before python existed.

comment 8y ago · link · parent

> especially the same pattern of branching in several places - then you should certainly consider replacing that with polymorphism

As a first step, I'd say better to just isolate the branching in one place, as a separate function, rather than immediately jump to polymorphism which could have high refactoring costs in some cases (even if it might eventually be worth it).

Because premature abstraction is just as bad as premature optimization.

comment 8y ago · link · parent

I don't consider this style of pattern matching to be semantically different than ifs or switch cases. There's literally no "if" but they are fundamentally similar to having a single function with a switch/if inside for the "doing something".

Most pattern matching in languages is basically souped-up switch statements much of the time. Note that pattern matching is not one of the solutions mentioned by the author.

1
282930
110