Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

561–570 of 856 posts

Re: Ask HN: Why did Python win?

#561

Earlier quoted context omitted.

As a person who uses C++, I must say something that also applies, somewhat, to Java. We have all the cool kids like Kotlin, Rust, etc. However, when it is about finishing a project, beating C++ or Java ecosystems is almost impossible. Besides that, C++ has improved a lot over time. It still has its warts and knives but you can code very reasonable C++ with a few guidelines and there are also linters, and -Wall -Wextr…

The one thing Rust is getting right that I hope Carbon et. al take from it is using the type system to manage memory. not having to explicitly remember `free` in safe Rust code is amazing. Knowing that if my types are sound that memory will be managed reasonably is great. I also think that immutable by default, mutable by explicit declaration is pretty great. I do think there is a lot of room to add better ergonomics…

The amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so.

Besides that, in real life you end up having C in most of your software, so I am not sure how Rust behaves compared to well-written C++ with all warnings and linters on and using smart pointers. But my hypothesis is that they do not stay very far apart in safety.

There are many ways to achieve safety, and the most promising, IMHO, is the path that Hylo programming language is taking. It sticks to Generic programming and mutable value semantics.

The language base draws from Swift and it has very strong people behind that know what they are doing. For example David Abrahams and Sean Parent. This is an implementation in a language of many of the ideas from "Better Code" from Sean Parent. It has a very solid foundation.

Besides being a solid foundation for generic programming, value semantics, and concurrency, what I like the most is how much it simplifies the model by not escaping references all around and preventing unnecessary copies. This removes the (IMHO) mess that is to have to manage reference escaping constantly in Rust, reason why many patterns such as Linked lists are not even possible.

And Lists are not just an academic exercise, as I was told sometimes by Rust proponents. Linked structures (Inmutable linked structures actually) are important in scenarios such as TelCo backend where you need replication, fast moving of data and history versioning, rollbacks and so on.

Re: Ask HN: Why did Python win?

#562

Earlier quoted context omitted.

I was talking in the context of the Ruby/ Python/ interpreted language world of the parent post

if you're going off interpreted languages then PHP won. it's not as sexy or hot but it powers more websites than anytime else, or JavaScript which is also an interpreted language that is literally in every app so you could say it wins though I'd only count full stack js apps not PHP apps with a Vue frontend.

PHP certainly powers a lot of sites, but there seems to be a lot less code written in it. Maybe I'm just looking in the wrong places. I see tons of python job listings, very few php ones. PHP powers wordpress, and people use wordpress with a sprinkle of custom php it seems.

Re: Ask HN: Why did Python win?

#563

Earlier quoted context omitted.

It's hard for me to name a problem domain that doesn't have 3 different python packages doing the same thing three different ways, each more clever and less understandable than the last.

Why TF would you name an HTML parser BeautifulSoup?

I Googled it, apparently it comes from this https://en.m.wikipedia.org/wiki/Tag_soup

Re: Ask HN: Why did Python win?

#564
post #433
post #414

Earlier quoted context omitted.

Not just perl, but C/C++/Java as well. Ruby was a competitor to Java JSP development back in the day. And I remember when a lot of Java people jumped ship to Ruby. I moved from C++ to python over a decade ago and never looked back. Back then, the python jobs were scarce -- but based upon how I picked up the language, many of the typical C++ issues just disappeared -- and I knew it was going to become popular. One com…

MIT dropping SICP/Scheme for Python conicided with the general decline of education as an end in itself. Python is the VHS of computer languages. I couldn't believe it when I heard MIT dropped a language renowned for its elegant lambda implemenation in favour of a language in which lambdas were not only frowned upon but literally throttled. I think it says everything that MIT ditched Scheme and SICP at the same time…

I would argue that Python is the Betamax of computer languages, and C++ is the true VHS.

Fight me.

But seriously, Python is good. Don't let the perfect be the enemy of good, only computer science people can do this.

Re: Ask HN: Why did Python win?

#565
I've been trying to teach my daughter (11 years old) Python and she gets quite confused by the whitespace-as-indent construct. For example, it's not at all obvious when a block ends and you have to unindent / go back to a lesser level of indentation. Flower brackets (C, Java, etc;) or explicit ENDIF are much better. This course [1] is quite good for kids of that age.

And, oh. Just realized that self.name (object.variable) quietly retrieves the Class.name class variable (class "attribute" for the pedantic) :|

Hate how dynamic languages bend over backwards to not report an error. I would much prefer the "inconvenience" of having to compile my program and then be told what all is wrong at compile time. Sad that this is now popular. The language is very adhoc in general.

1. https://www.udemy.com/course/real-world-programming-for-kids...

Re: Ask HN: Why did Python win?

#566
post #229

Earlier quoted context omitted.

>New users wonder how to call functions. They form an intuition ("use parenthesis"), but it's unreliable. "Oh, parenthesis are optional--oh, parenthesis are only optional sometimes". print f"are you {sure} you need parenthesis to call a function in python" >Python is much more boring in this respect, users are more likely to form accurate intuitions. is defining a class the same as defining a function? What about fun…

> print f"are you {sure} you need parenthesis to call a function in python" This example doesn't call any functions. The print statement was removed in Python 3 and turned into a function, so you do need parentheses to call it and the example above is a syntax error. Python 2 (which had a print statement instead of a print function) didn't support f-strings. And f-strings, unlike JavaScript's template strings, are no…

With the exception of properties, of course.

Re: Ask HN: Why did Python win?

#567
I agree with you. I even remember it. It was Ruby or Python. Rails or Django. I tried both and liked Ruby and Rails better. Maybe if I knew back then it will be number one language I would go for it for the sake of career. But I still think that Ruby and Rails are better, and are my daily driver.

Re: Ask HN: Why did Python win?

#568
post #414

Earlier quoted context omitted.

Not just perl, but C/C++/Java as well. Ruby was a competitor to Java JSP development back in the day. And I remember when a lot of Java people jumped ship to Ruby. I moved from C++ to python over a decade ago and never looked back. Back then, the python jobs were scarce -- but based upon how I picked up the language, many of the typical C++ issues just disappeared -- and I knew it was going to become popular. One com…

C++ and Python are not competitors. Sure both are Turing complete so you can implement anything in either. However if you should is a different question. Python is very difficult to maintain when you program goes over 100k lines of code, while the static type system of c++ is good for millions. C++ compiles to fast binary code, while Python is typically 60x slower for logic (though often Python calls a fast algorithm…

As painful as the Python package system is, C/C++ is so much worse.

I remember trying to compile GTK+ on a solaris system a decade ago, and remembering how terrible it was to even to get it to compile.

You're really deluding yourself if spending your time in compiler dependency hell is so much better than python.

Re: Ask HN: Why did Python win?

#569
post #224

Earlier quoted context omitted.

R will still have a solid place in industrial pharma for a long time (even as python growths, R growth will continue. R is pretty tightly intertwined with the process of processing and submitting data from clinical trials to the FDA, much to SAS's chagrin. Personally I think we have to accept that R, Python, Java, C++, and Go are going to be with us for the rest of our lives. I would expect PHP, Ruby, and Perl to go…

Are you from the future? R is making progress to replacing SAS in pharma, but has a long ways to go. Here is an article from last year[0] patting themselves on the back for making a R submission to the FDA. There are oodles of existing processes where data has to be formatted just so because that is how SAS does it. Nobody wants to rip up and re-validate that code until they must. [0] https://www.r-consortium.org/blo…

The trope about SAS being required is pretty old... people trotted that out when I last worked in pharma ~15 years ago. The FDA specifically released an article saying that R is perfectly acceptable for submission https://blog.revolutionanalytics.com/2012/06/fda-r-ok.html

Please don't spread the SAS FUD. I work in Pharma and talk to the statisticians all the time.

Re: Ask HN: Why did Python win?

#570

Earlier quoted context omitted.

The one thing Rust is getting right that I hope Carbon et. al take from it is using the type system to manage memory. not having to explicitly remember `free` in safe Rust code is amazing. Knowing that if my types are sound that memory will be managed reasonably is great. I also think that immutable by default, mutable by explicit declaration is pretty great. I do think there is a lot of room to add better ergonomics…

The amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so. Besides that, in real life you end up having C in most of your software, so I am not sure how Rust behaves compared to well-written C++ with all warnings and linters on and using smart pointers. But my hypothesis is that they do not stay very far apart in safety. Th…

All this may be true (I'm not the strongest C++ developer in the world, relatively limited exposure), however the Rust memory management via the type system feels natural once you wrap your head around it. That idea is really good. I always hated dealing with `delete`, `free` and `malloc`.

Being able to offload all that busy work to the type system is just nice. There are definitely ergonomic improvements that could be made around this.

All the rest? I'll leave that to someone else to talk through, as I'm no expert here.

Post reply on HN