Live data from Hacker News

Ask HN: Why use Python or similar?

news.ycombinator.com

61–70 of 72 posts

Re: Ask HN: Why use Python or similar?

#61
post #60

using System; public class Hello { public static void Main() { Console.WriteLine("Hello, World!"); } } vs print "Hello, World!" Everything is just simpler in python and ruby.

Assuming size of a pretty normal simple program is 10k LOC. Lines required to get an entry point of program, Python: 1 (0,01% of such program), C#: 7 (0,07% of such program). Worry about the things that matter, the number of lines required to get to an entry point is not one of them. Neither is printing to the console. And to be fair, if you are doing python seriously you would probably also have an ´if __name__ == "…

> Assuming size of a pretty normal simple program is 10k LOC.

This is a pretty big assumption, no pun intended.

Re: Ask HN: Why use Python or similar?

#63
post #60

Earlier quoted context omitted.

Assuming size of a pretty normal simple program is 10k LOC. Lines required to get an entry point of program, Python: 1 (0,01% of such program), C#: 7 (0,07% of such program). Worry about the things that matter, the number of lines required to get to an entry point is not one of them. Neither is printing to the console. And to be fair, if you are doing python seriously you would probably also have an ´if __name__ == "…

> Assuming size of a pretty normal simple program is 10k LOC. This is a pretty big assumption, no pun intended.

You can remove or add one digit if you want, the example is equally silly :)

Re: Ask HN: Why use Python or similar?

#64

Generally speaking, the Python community believes the strength of Python is in its culture, which can be summed up by the Zen of Python: http://www.python.org/dev/peps/pep-0020/ . Python also recieves much praise for being easy to learn, readability, productivity, expressiveness, and its library support, namely NumPy and SciPy (Python is often used in scientific computing for this very reason). Aside from this, Pytho…

I have to disagree with the last part of your post. Some languages are actually better in quantifiable ways; for example, shorter development time, better performance, etc.

Re: Ask HN: Why use Python or similar?

#65
But when I look at performance Python is not near C# or Java

For most websites out there it doesn't matter. Facebook ran on normal PHP (similar performance to Python) up until the point when they had 500 million users and were forced to make some changes.

Instagram and Pinterest are powered by Python. Unless your site is bigger than those, you'll be fine running Python.

And I can't seem the find features of C# in Python

Python has a huge ecosystem of libraries. Maybe you just don't know where to look?

Re: Ask HN: Why use Python or similar?

#66

Generally speaking, the Python community believes the strength of Python is in its culture, which can be summed up by the Zen of Python: http://www.python.org/dev/peps/pep-0020/ . Python also recieves much praise for being easy to learn, readability, productivity, expressiveness, and its library support, namely NumPy and SciPy (Python is often used in scientific computing for this very reason). Aside from this, Pytho…

I have to disagree with the last part of your post. Some languages are actually better in quantifiable ways; for example, shorter development time, better performance, etc.

But no language is best in every case. Putting skills into language agnostic pursuits means you can use whatever is objectively best as needed, ideally you'll have already used it.

Re: Ask HN: Why use Python or similar?

#67
post #60

using System; public class Hello { public static void Main() { Console.WriteLine("Hello, World!"); } } vs print "Hello, World!" Everything is just simpler in python and ruby.

Assuming size of a pretty normal simple program is 10k LOC. Lines required to get an entry point of program, Python: 1 (0,01% of such program), C#: 7 (0,07% of such program). Worry about the things that matter, the number of lines required to get to an entry point is not one of them. Neither is printing to the console. And to be fair, if you are doing python seriously you would probably also have an ´if __name__ == "…

"Worry about the things that matter, the number of lines required to get to an entry point is not one of them"

Getting started on prototyping ideas is most of my life. I rarely use the code I write.

Re: Ask HN: Why use Python or similar?

#68
post #15

One thing that I really like about Python is the interactive style of development that it encourages, at least for me. I tend to do Python development in emacs with source code in one buffer and a repl in another buffer, building my program up slowly and evaluating bits of it as I go along. This style of development works very well for me. There are other languages where you can do development like this but (and plea…

Smart comment, the very accessible REPL can inject some fun into development.

Re: Ask HN: Why use Python or similar?

#69
Because you have to type less code when writing Python. No braces, dynamic typing and so on. Programs are half the size or less than C# code. The less code, the less chance there is for screwups, the less time it takes to grok and the less work it is to refactor. That's why Python wins every time.

Re: Ask HN: Why use Python or similar?

#70
Python and Ruby are great because they have pragmatic communities which strive to produce simple and easy-to-use frameworks and libraries. This is also reflected in the languages, which are easy to read and write, and keeps things simple. Look at libs like rails, Django and pyparsing. These all acheive complex tasks in simple manners, while keeping turnaround time to an absolute minimum. Python has an awesome std library which accepts differences in platforms, countrary to the Java API which tried to find the middle ground. This makes python awesome as a scripting language and integration tool.

On the negative side, Ruby and Python threading sucks, since they both have global interpreter locks. And they lack static typing.

Post reply on HN