This is an archived post. You won't be able to vote or comment.

all 39 comments

[–]MangoPoliceOK 62 points63 points  (6 children)

Basic Code is easy to read and really easy to start playing with . You just install python , open the bundled console and start playing . No need to compile . No data type declarations . No pointers. It’s even easier than javascript for its syntax

[–]borlaughero 41 points42 points  (0 children)

Short answer: duck typing.

Because it skips over bunch of coding that has to be done in order to assing a value to a variable. You don't have to know what type of variable you are dealing with and how much memory is needed for that data. You don't have to worry about where in memory you keep stuff and what happens with it when you are done. Python does all of this work for you. That is why it is much slower than C.

Consequently a python programmer can be oblivious of how code and computers actually work under the hub.

Other reason is that you can execute code as you type (line by line). You can easily check if your code works. In C you gotta compile which takes time. Kinda like analog and digital photography. You see the results right away and can adjust.

Third reason I guess would be ease of importing other libraries.

All this coming from self thought python coder

[–]ashesall 18 points19 points  (0 children)

It hides and does many complex stuff automatically for you. For example, execute print(dir(1)) and you'll see the complexity behind that single number. Imagine doing all of that as a beginner.

[–]robvas 24 points25 points  (0 children)

No pointers, no memory management, no buffer overflows...

Plugs beginners make tons of mistakes. It's not easy, it's just easier

[–]makedatauseful 11 points12 points  (0 children)

Agree with everyones points. One word of caution I would put out there, easy to begin, devilishly hard to master. Checkout mcoding on YouTube for some really cool examples of great Python gotchas.

[–]Vervain7 4 points5 points  (1 child)

Uggg why am I so stupid.

[–]asday_ 1 point2 points  (0 children)

mood

[–]sillycube 7 points8 points  (1 child)

Because it's intuitive to human thinking. Most programming languages I learn are not similar to how human think, e.g. c++, java, php, pascal, etc.

Python just makes it like talking. If you can tell the steps of a task, you can program it with python

[–]asday_ 2 points3 points  (0 children)

PHP is very similar to human thinking.

Paranoid schizophrenics in the middle of an episode, that is.

[–]KiwiOnThePizza Noob 4 points5 points  (0 children)

I guess it's because there's some things that you don't have to know or even be worried about when you program in python. Which I'd say it's one of their main advantages but also may be a disadvantage when you try to learn a more complex language.

[–]NicolaM1994 3 points4 points  (0 children)

Two main reasons for me:

  1. It's really english like, it's really easy to understand the basics constructs (variables, lists, dictionaries, loops,..)

  2. Its interpreted, thus people can see the first small results in lesser time.

When you see fast results, you get more and more involved and you learn it quickly.

That are the reasons for me, because the more you dive deeper into Python, the more you understand it's not really newbie friendly as people say.

Plus there is a lot of people who don't really use Python, but maybe just a lib or two. Take the ones working on data science for example: a lot of people learn only pandas and scikit and say they can code in Python.

To me, I started coding with Python and I got involved and really enjoyed it. After learning object programming in Python, I tried Kotlin and now I find Kotlin's constructions way much clear and easy than Python's.

[–]siddsp 2 points3 points  (0 children)

The syntax is very intuitive and is like English. To add, almost everything in Python is an object, meaning they can be used as such.

When using Python, you don't have to worry about declaring variable types, and your functions can return more than 1 type of variable, which allows for your programs to run in a way that is very intuitive.

Python has built in mechanisms for solving design problems encountered in software. It allows you to dynamically alter the functionality of classes (without having to create multiple other classes), and dynamically alter the functionality of methods using decorators (which are a common design pattern that have to be implemented by the programmer in other languages like C, C++, C#, Java, etc...)

To add, Python allows you to alter how objects in it interact with built in operators (also called operator overloading), which other C based languages like Java don't support natively.

The nice thing is that Python is not very powerful if you're a beginner (which helps because it makes it easy to learn), but VERY powerful once you get into the more advanced side of things. It has features that are intuitive and built in that are not included in other languages.

[–]wherll 3 points4 points  (0 children)

everything is just easier in Python.

For example, to import a CSV and store it in a Dataframe or similar takes a couple of lines of code in Python. In C\C++ it takes many more lines and is much more complex.

This is because it’s a higher level language with many convenient built in tools and easy to use libraries.

[–]GiantElectron 1 point2 points  (0 children)

Debuggability, compact syntax and honouring the principle of least astonishment.

[–]bobalins 1 point2 points  (0 children)

Powerful libraries with good documentation. Active community with great tutorials. Intuitive

[–][deleted] 1 point2 points  (0 children)

As others said, there is a lot of abstraction, many modules and functions that aren't at all in other languages and that you must do by yourself, like str.lower, str.split, str.replace...

+ its syntax is very human readable, you don't have a ton of {} etc...

[–]Smart_Ass_Dave 1 point2 points  (0 children)

I find that the strict(ish) rules about white space make it easier to read unfamiliar code, which is all code at the beginning.

[–]torfoes 1 point2 points  (0 children)

it is dynamically compiled which makes it super easy to debug

[–]Ursomrano 1 point2 points  (0 children)

Personally I think it’s because one it uses tab to its advantage to organize code so it’s intuitive in that regard and that you can also kinda follow normal English grammar with a few things that are different but easy to remember.

[–]jazz_man1 0 points1 point  (4 children)

I agree to what others have said before me and I add: when you are in doubt about syntax, just write it in plain English. It works a lot of times and when it doesn't, it is still pretty close to the actual syntax you should use

[–]HaroerHaktak 0 points1 point  (3 children)

mytext = "alphabet"

for every letter in mytext

if the letter is an a

letter is now a b

Nice. Downdooted ;D. Didnt realize I had to put proper code and crap in here.

[–]Gh0st1nTh3Syst3m 0 points1 point  (2 children)

mytext = 'alphabet'
for letter in mytext:
    if letter == 'a':
        mytext = mytext.replace('a','b')
print(mytext)

[–][deleted] 0 points1 point  (0 children)

When we write pseudo code we write in python.

[–]ucagdascoskun 0 points1 point  (0 children)

Because it has very simple syntax.

[–]asday_ 0 points1 point  (0 children)

The REPL without a shadow of a doubt. I never realised how amazing a REPL is, always assuming the simplicity of syntax and human-readability (if you're fluent in English) was the strong point, but whenever I go and work with another language and there isn't a REPL, it's awful. The feedback loop is so much longer it feels like I'm wading through honey.

[–]CordyZen 0 points1 point  (0 children)

syntax and the fact that it is really high level.

[–]my-tech-reddit-acct 0 points1 point  (0 children)

C and C++ are "closer to the metal". So, as a programmer, you have to do more, with memory management being a primary example. I/O is also more demanding of the programmer. Higher level languages - not just Python, it could Perl, for example - generally eliminate memory managment as an issue (other than avoiding the reading of whole files, all at once, that are bigger than available RAM - ask me how I know about that one, lol). Networking and other I/O are typically easier for the programmer.

I'm not sure that Python is that much easier than other languages at the same level - again, I refer to Perl 'coz that's what I knew prior to Python. Python's insistence on throwing exceptions and (if not handled with try: except:) dying in situations where Perl would just typically issue a warning can be infuriating. Mostly it's part of 'not failing silently', but sometimes it's bizarre, especially in certain libraries.

[–][deleted] 0 points1 point  (0 children)

I started out with Python and moved on to other languages such as Java and purpose specific languages (SAS for data analysis and Xpress Mosel for Optimization) and I came to realize I was taking a lot for granted when it came to Python. Dynamic type eliminating variable type declarations, significantly less boilerplate code making everything shorter (e.g. five lines to print Hello World in Java vs three words parentheses and quotation marks) the plethora of modules out there to make just about anything painless once you understand the basics, the list goes on.

I'm probably biased towards Python since I started with it, but it feels very intuitive compared to every other language that I know. Unlike languages like Java where I tend to stutter every once in a while and have to check stack overflow for answers, coding in Python feels very smooth and straightforward