Live data from Hacker News

Why People Should Learn Python

iluxonchik.github.io

251–260 of 329 posts

Re: Why People Should Learn Python

#251

Is it just my feeling or are there languages which are preferred on HN? Indicators for languages which are liked by the HN community: - Positive stories get many upvotes and are instantly at the top of HN - Most comments are positive - Frequent coverage on HN about the language Indicators for languages which are not liked by the HN community: - Rants get many upvotes and are instantly at the top of HN - Most comments…

Surely measurable ? perhaps github stats are indicative - http://githut.info/

Anecdotally I would have expected Javascript to be near the top of hours being used.

Re: Why People Should Learn Python

#252

Earlier quoted context omitted.

Wordpress is horrible. Never going to touch that again (Senior PHP Dev myself) or anything else like it (Magento, Drupal,...). And yes there is a lot of horrible PHP code out there, writting by bad developers. I guess newer or not as accessible languages don't have as many bad devs as PHP/JS. But if you have good devs, I prefer a good PHP codebase to any other language that I have come across (I tried a lot of them).

Around 2001 I felt jaded with the industry and determined to do whatever was expedient to earn money. That meant using PHP, because that was purportedly the place to be at the time. I have never felt so uninspired by a language. My overwhelming feeling from the get-go was that it was a collection of libraries, which would be fine -- but why create a new language? PHP has the rare distinction among languages of not co…

2001 was 15 years ago. PHP looks completely different now. It looks very much like Java with -> instead of dots and a few differences.

Nobody sanes mixes HTML and PHP code anymore these days. Most people are using Twig for templating or at least something similar. Everything (decent) is object oriented these days.

So your views were correct 15 years ago, but have a look with fresh eyes and you will see something completely different.

Re: Why People Should Learn Python

#253
post #205
post #128

Earlier quoted context omitted.

Reasons to learn Python: Sklearn, tensorflow, pandas, Sqlalchemy, requests, Beautifulsoup, numpy, scipy, pulp. If you have a language that had equivalent libraries that cover all these domains I'd love to hear it. Until then I can build really cool stuff in Python very easily thanks to the amazing hardwork and generosity of these library creators.

If you have a language that had equivalent libraries that cover all these domains I'd love to hear it. R[1]. [1] https://cran.r-project.org/

Okay, but I'm not sure they wanted to go from python to R. The issues listed in the original post are definitely not fixed in R. And you lose out on python's ability to also be used for other things.

Re: Why People Should Learn Python

#254
post #226

Earlier quoted context omitted.

Since when did something need to have novel features or ideas in order to be productive? I'll counter that one of the main reasons PHP became such a used language (other than ease of deploy) is exactly the reasons you dislike it. There are multiple ways to do things - that coincide with the ways you do things in many other languages (which it steals from). You dont have to learn anything radically new to use it, and…

"Since when did something need to have novel features or ideas in order to be productive?" It doesn't. But if your language ideas are admittedly no better than the next guy's, what's the point?

It can be a combination of different things that exist somewhere but not in this combination.

For me PHP is like Java but with sane nullability. It's like python but it actually has interfaces so that I can do proper OOP.

Re: Why People Should Learn Python

#255

I just wanted to point out a bit of syntax from the article. I'm a huge fan of compact variable declaration if statements. The code from the article: if name in names: names[name] += 1 else: names[name] = 1 That can actually be written as just one neat, readable line: names[name] = names[name] + 1 if name in names else 1 It may not be as readable to some who are used to spelling it out as an if/else block, but I real…

Or just `names[name] += 1` if you're using a Counter.

Re: Why People Should Learn Python

#256
post #240

Earlier quoted context omitted.

Reduce doesn't have side effects, handles an empty collection, doesn't need to reference the index of the iterable, and self-documents the code as a fold. I find the last part nice because a loop or a Python comprehension would need to add a comment to explain what would otherwise be clear from the syntax. Here's an alternative example where I think it makes sense (checking if the size of all elements in a collection…

I don't think that does what you think it does: >>> reduce(lambda a, b: len(a) == len(b), ["a", "b", "c"]) Traceback (most recent call last): File " ", line 1, in File " ", line 1, in TypeError: object of type 'bool' has no len() It's trying to do len(len("a") == len("b")) == len("c"), which becomes len(True) == len("c"), and len(True) doesn't work. Some variations which do work are: len(set(map(len, ls))) == 1 len(s…

> I don't think that does what you think it does:

Heh, just proved my point. Reduce won't be missed.

Re: Why People Should Learn Python

#257

Is it just my feeling or are there languages which are preferred on HN? Indicators for languages which are liked by the HN community: - Positive stories get many upvotes and are instantly at the top of HN - Most comments are positive - Frequent coverage on HN about the language Indicators for languages which are not liked by the HN community: - Rants get many upvotes and are instantly at the top of HN - Most comments…

No D in your list?

/ goes to a corner to cry...

Re: Why People Should Learn Python

#258
post #226

Earlier quoted context omitted.

Since when did something need to have novel features or ideas in order to be productive? I'll counter that one of the main reasons PHP became such a used language (other than ease of deploy) is exactly the reasons you dislike it. There are multiple ways to do things - that coincide with the ways you do things in many other languages (which it steals from). You dont have to learn anything radically new to use it, and…

"Since when did something need to have novel features or ideas in order to be productive?" It doesn't. But if your language ideas are admittedly no better than the next guy's, what's the point?

It's easy, fast (both Development speed and Page Views), and can deploy anywhere with a few clicks? It has no novel concepts that require learning something new. It has a plethora of existing code, documentation, frameworks, and StackOverflow answers to solve almost any problem (albeit, not always correctly).

Its the lowest barrier to entry web language - and honestly, I'm ok with people writing shit PHP. It gets good Ideas out there quickly - allowing the business to grow without a focus on the Development. This creates opportunities for sharp developers to come in and work on proven ideas.

Re: Why People Should Learn Python

#259
post #74

Earlier quoted context omitted.

just to chime in on this, modern PHP is nothing like what people remember from the pre ROR days, i still use it to this day and the major frameworks and libs are really well written to the point i feel some are even over engineered and almost looking like Java (just take a look at the latest Guzzle PHP Library)

My day job is no longer to write code, but I have a couple of projects I work on at night, so take my opinion for what it's worth. I have one project that's mostly static content and a couple of calculator forms. On submit, I an ajax call to post to a PHP script, it returns a json object with some data, and I display it. When I see PHP getting ripped, I always wonder, what am I supposed to use if not this? I know thi…

Basically any other backend is equivalent. Javascript (on the backend), python, ruby, anything.

Not a knock on php on my part, PHP is equally suited.

I would have personally probably chosen Flask (python).

Re: Why People Should Learn Python

#260
post #226

Earlier quoted context omitted.

Since when did something need to have novel features or ideas in order to be productive? I'll counter that one of the main reasons PHP became such a used language (other than ease of deploy) is exactly the reasons you dislike it. There are multiple ways to do things - that coincide with the ways you do things in many other languages (which it steals from). You dont have to learn anything radically new to use it, and…

"Since when did something need to have novel features or ideas in order to be productive?" It doesn't. But if your language ideas are admittedly no better than the next guy's, what's the point?

Currently, with version 7.0, its implementation is faster than most other scripting languages.

That's one big important point.

Post reply on HN