News for hackers. Stuff that matters.
Re:Python is becoming the world’s most popular programming l... by legostormtroopr on Wednesday October 10, 2018 @04:36AM (#18183060)
As a huge fan of Python, my go-to statement is that Python is the second or third best language for whatever you want to do.

Want to do web server development? Flask, Django, Tornado, etc... can do that. Probably not as concurrently as Go, but it'll do.

Scientific computing? Its no Matlab, but the syntax is easy and the time you lose in processing you make up for when developing.

Desktop computing? PyQT is pretty good. Electron may be faster to build with, C will be faster at runtime, but Python, even with Tkinter, is ok.

Functional programming? There are list comprehensions, map, reduce and filter. Not as good as Haskell or Lisp, but it'll do.

Python isn't the killer language for any of these really, but its good enough in almost all cases that you'll be very productive and can iterate to a good MVP quicker than with most other languages.

Re:Python is becoming the world’s most popular programming l... by dazzawazza on Wednesday October 10, 2018 @06:48AM (#18183629)
For me python's killer feature is readability years later.

I've gone back to websites and tools YEARS later and the code as quick to pickup and easy to modify.

35 years of programming and I've never met a language so well integrated with my mind.

Re:Python is becoming the world’s most popular programming l... by mazesc on Wednesday October 10, 2018 @07:46AM (#18183909)
Any language with static types should be easier to make sense of, though. I get it's faster to write dynamically typed code, but your point is specifically about reading code, which I can't follow.

Of course Python nowadays has support for static types too.

Re:Python is becoming the world’s most popular programming l... by weberc2 on Wednesday October 10, 2018 @09:17AM (#18184510)
I program in Python professionally, and I agree with your sentiment in general. Dynamic types hurt readability. Also, in general, Python is faster to develop with than most statically typed languages. There are two nits that I’d like to pick: the first and lesser is that Python’s static typing story is in an alpha stage. It’s not ready for prime time (but I’m cheering it on) and Python shouldn’t be considered as having a static type system yet.

The second is that I realized that Go is a statically typed language that is quite a lot easier to develop with than Python and other dynamic languages. It strikes a good balance between protecting you from mistakes while not making it hard to express your intent (most of the time, anyway). As I advance and become more concerned about my time, I find myself reaching for Go more often because the static type system has my back. I spend less time writing unit tests or iteratively running my code to make sure things still work. (People said this about Haskell and Rust and OCaml too, so I understand the skepticism dynamic language proponents have for claims like these). The deployment, dependency management, and performance stories are also quite a lot nicer in Go, and these are undervalued components of “developing velocity” as well, especially if you’re on a small team. It really changes the calculus for static vs dynamic language discussions.

Re:Python is becoming the world’s most popular programming l... by realharo on Wednesday October 10, 2018 @08:12AM (#18184069)
>I get it's faster to write dynamically typed code

I would dispute that, but I guess it depends on one's workflow. Different workflows work better with different kinds of type systems.

Re:Python is becoming the world’s most popular programming l... by deaps on Wednesday October 10, 2018 @07:44AM (#18183899)
> 35 years of programming and I've never met a language so well integrated with my mind.

That's a pretty good way to put it - and mirrors my feelings. I've been programming for 20+ years (with breaks here and there), and it took a while for me to find Python. But when I found it, it's like I finally found the language that my brain thinks in.

Re:Python is becoming the world’s most popular programming l... by tpaschalis on Wednesday October 10, 2018 @07:54AM (#18183960)
Personal anecdote as well, but I think you nailed one of the reasons I love Python.. It's the way the language was designed (PEP 20)

I had written some POC scientific code for my undergrad thesis, but the thesis was sidetracked for about a year or so due to real-life issues. When I went back, I could try and test things again in just a day or two, in comparison to much more detailed documented Matlab and C code.

- There should be one-- and preferably only one --obvious way to do it.

- Simple is better than complex.

Re:Python is becoming the world’s most popular programming l... by devxpy on Wednesday October 10, 2018 @09:56AM (#18184860)
I was just talking to my friend about how in python I can just write "and" "or" "not" instead of the symbol orgy in almost every other language xD
Re:Python is becoming the world’s most popular programming l... by sumofzeros on Thursday October 11, 2018 @11:15AM (#18194170)
You'd probably love COBOL too, it's closer to plain English than most other programming languages out there.
Re:Python is becoming the world’s most popular programming l... by skohan on Wednesday October 10, 2018 @09:22AM (#18184551)
I would seriously recommend Swift for this reason. It's the most self-documenting language I have worked with.
Re:Python is becoming the world’s most popular programming l... by mmargerum on Wednesday October 10, 2018 @08:17AM (#18184099)
This is also what i love most about go. The code is so easy to read and thanks to `go fmt` everyone's code is structured the same way.
Re:Python is becoming the world’s most popular programming l... by zimablue on Wednesday October 10, 2018 @04:40AM (#18183080)
It's the killer language in scientific computing I'd say, having used both Python and Matlab. The open source nature/libraries and being a more fully-powered programming language (expressive object system) make it better.
Re:Python is becoming the world’s most popular programming l... by dagw on Wednesday October 10, 2018 @05:03AM (#18183192)
As someone who does a lot of scientific computing in Python, I'd probably recommend learning Julia as the 'killer language' if scientific computing is the main reason you want to learn programming.

Pythons strength comes from being pretty good at scientific computing, and equally good at just about everything else.

Re:Python is becoming the world’s most popular programming l... by 3rdAccount on Wednesday October 10, 2018 @06:56AM (#18183665)
Was going to say that Julia might be the long term best open source replacement for closed source scientific computing (Matlab, Mathematica...etc). In some ways it is already just as good, but in others, it has a long way to go. From a speed perspective, it is top notch.
Re:Python is becoming the world’s most popular programming l... by zimablue on Wednesday October 10, 2018 @05:11AM (#18183222)
I haven't tried Julia, it sounds like it could be better in the long run but I'd be shocked if the ecosystem is equivalent already.
Re:Python is becoming the world’s most popular programming l... by ForHackernews on Wednesday October 10, 2018 @05:46AM (#18183352)
Luckily, you can call many Python libraries directly from your Julia code: https://github.com/JuliaPy/PyCall.jl
Re:Python is becoming the world’s most popular programming l... by dagw on Wednesday October 10, 2018 @08:42AM (#18184273)
Yea, PyCall makes it trivial to write a quick Julia wrapper around a python library. It's also really handy for porting python code to Julia. Start by wrapping all your existing functions with PyCall and then replace them one by one with Julia functions.
Re:Python is becoming the world’s most popular programming l... by sibinpthomas on Wednesday October 10, 2018 @07:25AM (#18183794)
Re:Python is becoming the world’s most popular programming l... by 3rdAccount on Wednesday October 10, 2018 @06:53AM (#18183646)
I was going to say "no" to embedded, but micro python and other projects work on some controllers I think.
Re:Python is becoming the world’s most popular programming l... by jononor on Wednesday October 10, 2018 @01:13PM (#18186893)
In the microcontroller it is good enough for hobby/proof-of-concept level things. Same as the various Javascript engines. Lua might actually be doable for some simple products. But a lot of embedded these days is on Linux, and then Python is pretty great.