Live data from Hacker News

Economics Nobel laureate Paul Romer is a Python programming convert

qz.com

41–50 of 74 posts

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#41
post #13

I'm surprised there seems to be have been no HN discussion on this years Economics prize. Or are my HS search skills lacking?

Maybe part of the problem is that unless you delve beyond layman level (and maybe even if you do?) economics is close-coupled to political views, and those start wars- so we tend to steer clear on this board.

The dismal science has earned the name many times over: no one wants to read a long-winded epistle on the relationship between bond yields and non-farm employment in Alabama between 1993 and 1998, and that's where a lot of the interesting parts of econ lie.

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#42

I'm surprised there seems to be have been no HN discussion on this years Economics prize. Or are my HS search skills lacking?

Likely because there aren't too many Economics majors on this forum (I am, BTW). From what I've seen on previous HN posts on economics topics, the discussion veers towards "Economics isn't a real science" variety, with the majority of the posts going back on forth on that comment, rather than the actual topic of the article.

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#43
post #7

> he tried to use Mathematica to share one of his studies in a way that anyone could explore every detail of his data and methods. It didn’t work. He says that Mathematica’s owner, Wolfram Research, made it too difficult to share his work in a way that didn’t require other people to use the proprietary software, too Sometimes I wonder where Mathematica would be if it were open sourced lets say in 2010. It had such a…

I loved using Mathematica in college. It was the first programming language I ever really used to make some cool things. I wish it was more accessible. I think one of the requirements of my dream job would be a work place that uses Mathematica. It's really fun reading through "code golf" challenges where other languages take 10-15 lines for something that Mathematica has a built in for.

Did you just say "code golf" and Mathematica in the same sentence?

Then you will love these. I own like 10 copies, which I give to people for their birthdays: http://adereth.github.io/blog/2017/11/02/playing-with-wolfra...

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#44
post #7

> he tried to use Mathematica to share one of his studies in a way that anyone could explore every detail of his data and methods. It didn’t work. He says that Mathematica’s owner, Wolfram Research, made it too difficult to share his work in a way that didn’t require other people to use the proprietary software, too Sometimes I wonder where Mathematica would be if it were open sourced lets say in 2010. It had such a…

I loved using Mathematica in college. It was the first programming language I ever really used to make some cool things. I wish it was more accessible. I think one of the requirements of my dream job would be a work place that uses Mathematica. It's really fun reading through "code golf" challenges where other languages take 10-15 lines for something that Mathematica has a built in for.

[deleted]

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#45
post #29

Earlier quoted context omitted.

What are these "stupidities" that bother you? Personally, I use Python a lot for anything related to data science. No language is perfect, but I'd say Python has a lot less deficiencies and warts than most other mainstream languages, and it's extremely well suited for tasks in data science and related fields such as machine learning. The main issue with Python is that its default platform (CPython) isn't very efficie…

Here's a classic: def a(arg = []): return arg a([1]) #==> [1] arr = a() #==> [] arr.append(1) a() #==> [1]

That's slightly surprising, but I wouldn't call it a wart. A proper wart is something that bothers you even after years of using the language, not something that surprises you a couple of times as a beginner, but then ceases to be a problem - or indeed, in this case, has some good uses.

The obvious alternative in this case would be to reconstruct the default value. This doesn't work very well with the language's evaluation model - since the function definition is only evaluated once, and it's very inefficient and in fact surprising to perform later re-evaluations.

Furthermore, this behavior can be useful. If you don't want it, you just use `None` as the default and then assign in the function body. However, if you do want it, there would be no other way to get it, and no similarly easy workaround.

Finally, had there been a consensus of it being a wart, it would have been removed in Python 3.x. It wasn't.

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#46
post #24
post #23

Earlier quoted context omitted.

While I think this is a good thing, an additional requirement is needed. The published notebook should be sequentially executed by an automated tool. Users can execute commands out of order and have artifacts from deleted commands. Without verification, you can be publishing notebooks with bugs in them that you don't see until you re-execute them.

Jupyter notebooks are ultimately just a text file, which can be version controlled, verified (via the VCS or independent hashing), and if necessary - digitally signed in a cryptographically secure manner. Given that Git is already secure, I'd say all the researcher needs to know is basic usage of Git. Version controlling the notebook satisfies all the requirements you mentioned: prevents accidental distortion, is ver…

It's not just tracability and security that's the issue, though. It's an issue of reproducibility. When I give you a notebook, how do you 'run' it to verify my calculations? You can't just press "run", because I might have executed the cells out of order, or deleted cells which later cells depended on. Version control doesn't solve this problem. Good practice might solve it, but it turns out that researchers are stunningly bad at following a strict top-to-bottom execution of notebooks. And who can blame them? The non-linearity of notebooks is one of their features. But when it comes to reproducibility and just the basic mechanics of sharing code, we definitely need a better solution.

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#47
post #24
post #23

Earlier quoted context omitted.

While I think this is a good thing, an additional requirement is needed. The published notebook should be sequentially executed by an automated tool. Users can execute commands out of order and have artifacts from deleted commands. Without verification, you can be publishing notebooks with bugs in them that you don't see until you re-execute them.

Jupyter notebooks are ultimately just a text file, which can be version controlled, verified (via the VCS or independent hashing), and if necessary - digitally signed in a cryptographically secure manner. Given that Git is already secure, I'd say all the researcher needs to know is basic usage of Git. Version controlling the notebook satisfies all the requirements you mentioned: prevents accidental distortion, is ver…

You forget that a typical Python Jupyter notebook will import a dozen Python packages.

Versioning that it's still a major problem in the ecosystem.

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#48

I use Python and it's OK, but I find a lot of the breathless hype around it as a language a little baffling as there are more than an average number of stupidities in there. However this piece is really around exploiting the amazing infrastructure that has built up around Python that empowers mathematical and statistical research, which is fair enough.

>I use Python and it's OK, but I find a lot of the breathless hype around it as a language a little baffling as there are more than an average number of stupidities in there.

There's fewer stupidities than languages like javascript or perl and it ends up being more practical than languages like haskell or ocaml.

One of it's unappreciated facets is that it's good at language interop. Instead of trying to be all things to all people (e.g. like go) it just makes it easy to interop with C where you need speed and focuses on being a good high level language.

I think the surprise surrounding its popularity is indicative of the fact that few people really understand what makes a great language.

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#49
post #29

Earlier quoted context omitted.

What are these "stupidities" that bother you? Personally, I use Python a lot for anything related to data science. No language is perfect, but I'd say Python has a lot less deficiencies and warts than most other mainstream languages, and it's extremely well suited for tasks in data science and related fields such as machine learning. The main issue with Python is that its default platform (CPython) isn't very efficie…

Whilst that is true, for data science related things I end up using Pandas (and Numpy) often which are fast. So most of the heavy lifting is not done by python itself.

So what? Pandas and numpy are still use with Python code using their APIs. The implementation details are not something the users care about. They write Python.

Re: Economics Nobel laureate Paul Romer is a Python programming convert

#50
post #45

Earlier quoted context omitted.

Here's a classic: def a(arg = []): return arg a([1]) #==> [1] arr = a() #==> [] arr.append(1) a() #==> [1]

That's slightly surprising, but I wouldn't call it a wart. A proper wart is something that bothers you even after years of using the language, not something that surprises you a couple of times as a beginner, but then ceases to be a problem - or indeed, in this case, has some good uses. The obvious alternative in this case would be to reconstruct the default value. This doesn't work very well with the language's eval…

>I use Python and it's OK, but I find a lot of the breathless hype around it as a language a little baffling as there are more than an average number of stupidities in there.

There are many warts that will never go away simply because they're embedded so much within the culture of the language and because undoing the wart would break so much working code.

I love python and I've used it every day for 15 years but there are core parts of the language I hate with a passion.

If in 3.9:

* "if x" started failing with an exception for most non-boolean values of x (e.g. lists, strings, numbers, etc.)

* strings stopped being iterable by default

then I'd be celebrating, but I know it's never going to happen.

Post reply on HN