Using flat indentation for debugging code is also very weird, most editors like Visual Studio for C even auto indent the last block whenver you type semicolon or closing bracket. Nesting so deep you run out of screen space sounds like a problem with your code and not the enforced indentation.
Imports running code is possible but most high quality modules don't do this and it's considered bad practice. For finding modules and navigating in modules just install PyCharm and you get auto complete on all possible imports and can ctrl-click your way into them. People who grep through standard modules are not friends. It can be abused and i rarely seen it be.
C has Dictionary and List. Java has ArrayList. These are not strange names. And some third party modules have ugly names, so what, don't use them. Who searches and randomly installs packages based on names anyway? This is very normal behavior.
Valid complaint but i would say naming your module the same as another one is a bit strange. C has the same quirk btw. Not sure i see any obvious solution for it either.
The speed of a software is a part of a the high quality. So use it if you need it to avoid the too slow running time. The changes from CPython 1. It's rare for 3. The changes from 2. The main change was that unicode became str, and str became bytes.
I choose to keep around many versions of Python for ease of comparison. It's not confusing at all. Most text editors make it easy to use 4 spaces. Having 3 spaces somewhere isn't a big problem, and a linter will likely catch it. Adding debugging print's without indentation is an interesting idea. I just prefix all my debugging prints with "fred: ". Do not use from foo import - it confuses linters too much. This is what Google is for, where a unique name is easier to search for.
Searching on Pypi is generally a pretty painless way to find modules related to a topic. Yes, Python uses b'' for a byte string - like Rust.
Explicit type conversions are a defining aspect of strong typing. Python is pass-by-assignment. It's very much like pass by value, except that sometimes you pass a pointer by value.
If you change the pointer itself, nothing changes in the caller. If you change what the pointer points at, of course things are changed in the caller. This is nothing like using globals for everything.
Naming a script foo. One is, the nit you pointed out. Another is, it unnecessarily ties your script to being forever implemented in Python, even if you decide it should be rewritten in Rust. Last I heard, Debian recommended against this. It supposedly originated in the Perl world, where Perl developers felt that CGI scripts should have the language they were written in, baked in.
Answer: Just don't. So which language should replace python here? It is broadly available, there is a large community, it often allows to express things in a beautiful way due to nice concepts.
I am open for alternatives. You have no idea how to use the language properly, there are ridiculous and false accusations. Please stop using Python, especially stop talking about it! Despite that, python rocks in AI. And you may not like the indents, but on the other hand i see it rather like a school programming language, if you dont type nice you get blamed. Thats great to achieve clean coding. I love to go to kaggle. Python jupyter notebooks i love them wish more coding languages had something alike it.
Its seems to me you are primarily a C programmer that is very fond of its particular quirks and paradigms. List and Dictionary seem like pretty common terms, between Java, C , and Python to say the least. Similarly I believe the pass by object reference is also common to all of them.
I have also consistent style is much more beneficial in dynamic languages, but that using linters and style guidelines can be genuinely helpful in all languages. I have had very few issues with the version compatibility and Python has a very strong tooling around multi targeting packages through universal wheels and libraries like six, that ameliorate most of your concerns. If you stop trying to force the languages to your preexisting paradigms and allow your self to write the language in a way that is idiomatic I think you would find it much less frustrating.
I find that python for scripting, web back end, business logic is among the more productive options available. Embedded or Systems programmers should maybe consider something else. Good list. That said, I'll add a few of my own 1. Imports, you barely scratched the surface on this. Python's import system is an absolute mess. By default you get a single thread, and while some libraries like numpy are threaded rolling your own is a mess.
The multiprocessing module seems to be the go to, but largely unmentioned in the docs is that it can only handle functions that can be pickled. Sure, there are workarounds but it makes anything threaded seem like an absolute hack. Why should the language care how many spaces I put before a comment. At least this one's easy to fix. The docs. They're fantastic for the basic topics, but rather lacking on more advanced stuff.
On the same note, "advanced" in the title of any python tutorial seems to guarantee it will cover topics common to any second or third semester computer science course.
Reloading modified packages. This depends how an IDE is set up, but it's very easy to inadvertently end up with old versions of objects when packages are reloaded. The only sure way to know you have the latest is a complete restart of the interpreter. Similarly, objects require 'self' to be used throughout.
It's something you get used to eventually, but still annoying. That being said, Python is still the best tool for most of what I'm working on right now. Numpy is a fantastic tool - especially if you're used to matlab's arrays. The flexibility of python is fantastic, but it certainly has some rough edges. Hi Seth, Thanks for the feedback. I probably could have done a 12 item list, but I thought that 8 was enough. I had ruled out a few things, like performance.
Compared to bash, everything is fast. And try debugging the sudden delay from some languages randomly doing garbage collection while you're trying to capture all packets on a gigabit network. I do think that 9 is documentation.
The docs for PHP are absolutely fantastic. Python is good for basic concepts, but most third party libraries just suck at docs. The whole thing about threading I actually view this as a feature of the language regardless of whether it sucks or not.
They've had 30 years to implement real thread support. I just assumed that the language developers don't want it. I've read some of the comments that people have left at Reddit and news.
There's a lot of negative expected , but a surprisingly large number of people agree with some or all of my gripes. Different items seem to strike a chord with different people. I get a kick out of the people who say things like " 2 is just whining" and someone else says "I agree with 2 -- pip is a mess! Does TensorFlow install under Python3. It works under 3. But here's my issue: if the language really requires an IDE to be properly written, then shouldn't it include a default IDE?
As far as I can tell, every IDE is a third-party addition for working around the syntax limitations. And then there's all of the people who have suggested different virtual environments for keeping the different versions straight. Other people complained about how screwed up the virtual environments are.
However, I think they're missing the point: why do I need to have separate environments for different projects? And maintaining different environments means more things to maintain. The whole need for virtual environments is just a workaround for Python's design limitations. Wow, I sure went off on a tangent.
Anyway, thanks for the feedback. Python hates you back. A lot of efforts just to slay a language; perhaps you should write one better. It sounds like you're afraid of something new. Hello Matthew Naidar, Python was created in December That's nearly 30 years ago. Technically, it's 29 years ago. It's not "new". If it were "new", I would give it a lot more leniency and consider the issues to be growing pains.
Python is nearly 30 years old and it has no plans to move out of it's mother's basement. It should stay in its mother's basement, IMO. My first encounter with Python was Anaconda, back in Horrible crap. No comments, space delimited, the whole insane "dictionary list" bs for a simple key-value hash.
It gave me bad TCL flashbacks. Plus, the python2 vs python3 thing still drives me nuts. Also, why does it have to import a regex library? Perl comes with it built in,, FFS. I started writing a comment but it got out of hand, so I made it a post instead: [quote] Well, the original article wasn't all bad, but the author got a lot of things wrong about Python. I can understand getting frustrated about a thing and not wanting to pick it up and actually understand more because you're so frustrated with it, but I hope the author 1 reads this reply and 2 understands Python enough to gripe about the real problems with Python.
I'm totally fine with people disliking Python for the legitimate problems that Python has, or even because they really just like to have static binding on their variables or even, like Rust, at least static binding until it's explicitly rebound to a new type and they really hate that Python does that! But I do get bothered when people dislike a thing and they're mostly or entirely wrong about the thing they dislike!
That's just silly! No clean object orientation: I will never understand why len, map etc. Totally counter-intuitive. Stacktraces: totally unreadable. Terrible regular expression library: take a look at Ruby and see how that can be smoothly integrated. Why is join not a method of array-like types? No other language does it this way. Iterations: not cleanly implemented and not a reasonable object hierarchy. See Java!
Python goes the other way round and we must now read from right to left. Why not have map for all iterable types? No functional style: why can't I call sort on an array-like type and get the sorted array? The only option is to sort in place. The Python infrastructure and libraries are fantastic and code is highly optimized.
The API though is often not elegant pandas, numpy and fosters more of a hacking attitude towards programming than a clean design. I am always surprised that Python is praised as a fantastic entry-level programming language.
I wonder if people supporting this have worked with languages which sport a really clean and consistent design. Although e. Ruby is much slower the design of the language AND of the standard library is so much better that it's really beyond comparison.
Regarding your last point, you can sort a collection using the built in function sorted. That said, I think most of your points boil down to personal taste. IMO the len function is important enough to exist as a built-in function and generally has more consistent behavior than other languages Ruby, for instance has Enumerable size, Enumerable length, and Enumerable count each of which may not implement the same behavior depending on the class its mixed in to.
Python 2 is still supported for bug fixes, so old code will continue to run reliably. There is just no back porting of Python 3 features to Python 2. It is just that Python 3 evolves now and Python 2 in in maintenance mode. You are also mixing different aspects: if apt get does not offer you the python version you want, than this is an issue of the linux distribution, not Python itself.
So in your case Ubuntu sucks, not Python. And there are the mentioned tools like pyenv and virtualenv to handle Python installations pretty well. The critics of syntax sound for me like "Python and its eco system is not c-ish enough so I don't like it. In Python you can solve things more efficient than in C, but the other way around Python can perform bad for tasks where C shines.
I appreciate this discussion a lot, and I am aware Python has good and not so good features but you should try to separate criticism about the language from the interpreters and from the community and from linux distributions. It is free language, none of you paid to develop it. And you will get some support. Complaining about something free is like saying you dont like the sun, as UV causes cancer. Get back into your Tesla and sing praises of the great car maker.
Wow, did you just read my old blog entry on "Open Source Sucks"? I mean, you just nailed reasons 1 and 3, with inferences to 4, 5, and 6. This is complete garbage and you know nothing about programming. You should have used R, after R, all naming and syntax and conventions of Python seemed pretty accurate and guessable for me. The GIL issue or feature is stupid. The inventor could not handle true multi-threading well, then just used a stupid GIL to ignore it.
Almost all modern languages support true multi-threading, but python cannot. Don't talk about multi-process, that's another thing also supported by other languages. My gripe with python is the culture of duck typing. Because that way lies madness. How am I supposed to know what an object can do? Check its type? Good luck with that if someone has souped the object up!
Heck, python makes defining types optional to begin with. Static type checking is vital to productivity. The earlier an error is caught in the development process, the less orders of magnitude it costs to fix it.
Going from compile time to runtime is at least one order of magnitude. It also makes it a pain to reason about the code programatically. Code completion gets ugly. Efficient implementation at runtime gets ugly. Remember shadow classes in javascript engines? In short, duck typing was a mistake. Not just in python, but as a concept itself. I'm a Perl5 fanboy, but I'd like to point out that package nomenclature is a general complaint common to a lot of OSS.
What does LWP Perl do? What does capybara Ruby do? It's not immediately obvious what these packages do, from just the package name. Of all the issues you mentioned what troubles me the most is the pass-by-object-referrence thing. Has anyone every responded to this criticism with a reasonable justification? I don't mind python, but I certainly don't like it. Try to do something trivial like have a pytest test script print a string or "trace" the execution of a python script i.
Wide Applicability Another essential feature of this language is that it is widely applicable. Engineers, scientists, and mathematicians broadly use it.
Memory Management Python has a vast library with memory management capabilities, and this makes it stand out from the other programming languages. It includes a private heap containing all Python objects and data structures and a built-in memory manager to maintain this private heap. Straightforward and Speedy The Python community provides rapid and practical support to users as well as the fast adaptation of code.
Some experts like to give Python the moniker, "ready-to-run language" because it only requires simple code to be executed. Enhancing and testing code is much more comfortable with Python. Asynchronous Coding Asynchronous coding uses a single event loop to complete a job in small intervals.
Python is very useful for writing asynchronous code because it is easy to write and maintain. It doesn't require any complex research contentions, deadlocks, or any other complexity. This is one of the main perks of Python as no language is perfect, and sometimes development requires diverse language functionalities that are impossible to have in one language.
Moreover, it offers reliable process control features and implementation of internet data formats and protocols. Further, Python helps users in processing markup languages like XL, executes through the same byte code on advanced operating systems, and can be utilized as a scripting language.
That was quite an exhaustive list of the plus points that Python has. But let's not see only one side of the coin. Let us be fair and also cast a glance at the minus points of the language in the next section. Primary Disadvantages of using Python Along with several pros, Python has some restrictions in the areas of performance and security.
The following are some significant disadvantages of using Python. Slow Execution Speed Python is an interpreted language, which means it works with an interpreter, not with a compiler. I have heard someone actually suggest this. I am not saying that everyone should learn the easiest language either.
I think the language you choose to start with should be one that will help you achieve your goals. Assembly could be a good choice if you are interested in how a cpu works but most potential programmers are not that interested in the cpu.
How hard it is to learn should be a factor in your decision. But you should learn towards easier languages because it will make the path less steep and you are less likely to give up.
I personally learned python first and it taught me how to think properly and how I can use the operations given to accomplish what I want I had no issue after that switching to Java and it was significantly easier to switch vs learning python.
I understand where you are coming from. My first language was C and when I started learning python it was such a joy to learn because of how simple it was compared to C.
Like what you said, learning a tougher language might be better in the long run and I'm glad I learned C first. I think about this when recommending a first language to someone.. But if I say something like C they might find it difficult and gave up soon so I would rather suggest something like python which they are more likely to stick to.
I also felt the same! When jumping to Python, even though it was weird at first, everything felt like "Oh, it's that simple? But I get what you're saying, and, in their defense, C is a pretty hard looking language, I felt like it wasn't as intuitive as other languages, so maybe recommending a middle-ground would be a better option.
Of the top of my head, you could always recommend Java, C or even JavaScript, or rather TypeScript, if you want them to think more about object types and future-proofing code in general.
I was starting to understand it then I decided to practice some python. I've completed about 7 or 8 programs without much direction. I do believe trying to learn Javascript actually helped me fly through python even though I don't consider myself a competent programmer yet. I do believe that starting with something harder is more beneficial. It's as everyone says, do the hard part first and you'll feel better when doing the easier part later!
Similarly, I also started with python. The thing that bugs me the most is probably the missing semicolon.
For sureeee! I started with Java, so that was natural for me, but the opposite happened, writing curly brackets everywhere ahaha Well, I still do that when switching from JavaScript to Python. They do what you think they do. They are rarely used. Aimen Zairi - Nov 7. Sasa - Oct Rosano - Nov 1. ThemeSelection - Nov 8. DEV Community is a community of , amazing developers We're a place where coders share, stay up-to-date and grow their careers.
MikeUt 6 months ago root parent next [—]. You can assign a new value to math. You can assign new values to those 'constants' defined in config files. If a value must not change for the lifetime of a program, you are unable to enforce that constraint, leading to bugs. Wrong and wrong. Well, the first is at least something one can discuss though wrong.
The latter is straight-up BS. Google never pushed Python, much less hard. Guido working there did nothing for Python either. Python was already on its way up before Google was a thing slowly ovetaking Perl , and was further pushed with Scientific Computing, Data Science and ML -- all of which have nothing to do with Google.
0コメント