|
Why I Start Python then always Stop
I like a lot of programming languages.
C# is my favorite, but I like C++, Pascal, C, Java, Kotlin (more & more all the time), even Swift (very Kotlin-like), TypeScript and I also like JavaScript -- even though it has a lot of annoying things like === etc.
I try to like Python, I really do. But there are a number of reasons that every time I start using it again I stop.
3) whitespace dependent. I've hurt myself with this where code fails due to having a tab where I should have 3 spaces or vice-versa. It's annoying. Just use some friggin' brackets.
2) global variables in file. If you define a variable in a file it is global to every function in that file. What!?! Yep. It's painful and confusing and a bad idea.
1) But the number one, knock-down, all-time biggest reason I just can't get past it is the use of double-underscores.
Yes, I'm a syntax snob.
It's just the ugliest syntax ever and I don't want to type underscores all the time!
It's so ugly to look at Python code. Here's a sample from official documentation:
class Mapping:
def __init__(self, iterable):
self.items_list = []
self.__update(iterable)
def update(self, iterable):
for item in iterable:
self.items_list.append(item)
__update = update
It's so ugly, so I just stop Python as soon as possible and go back to one of the good languages.
I was also wondering why Van Rossum (creator of Python) used underscores so much and there are some good explanations in this post. But there is no excuse, because other modern languages have not had to use characters like that.
Why does python use two underscores for certain things? - Stack Overflow[^]
|
|
|
|
|
On global variables in Python: it is misleading to say, without qualification: "If you define a variable in a file it is global to every function in that file." It is true that if you define and/or use a variable outside a function, it becomes globally visible to 'subsequent' code within the file. It is, however, treated as read-only outside its original scope unless it is specifically declared as global within a function definition. I can see that even the read-only visibility of such variables may be offensive to those to whom the thought of global variables is anathema, but I do not find it so.
|
|
|
|
|
So, in short, it is the Python way of the singleton pattern?
|
|
|
|
|
I think it issss sssstill a charming language.
|
|
|
|
|
Pythons have no shoulders ... so we know the loss of charm is not due to it's tee shirt needing a change, right?
(sorry, walked by a corner selling designer-pattern-printed neck/chin tubes yesterday and couldn't resist)
|
|
|
|
|
I see many people out there having little idea about python and saying that they know it's good for data science. Here's my 5 cent as a data scientist.
Python has some well-developed libraries for data science. Those libraries, like pytorch, are written in C++, and are indeed easy to use via pyton.
That being said, I started developing in pyton for a single reason that my younger colleagues didn't know other languages, and I needed to both have common ground with them and also to show that I am at least just as capable as they are on this ground. Those colleagues were at odds with understanding strongly typed language syntax, btw.
This, in my opinion, creates a vicious cycle. With more and more - and, hence, less and less qualified - human resources being pumped in the hot field of AI, those need to be trained fast on the most entry-level language possible, allowing for neural networks and stuff. For now it's python here. As more and more people in AI are now python exclusive, qualified developers focus more at delivering AI libraries for python.
Remember, those people often have trouble understanding the difference between a class and an object, so strong typization is a burden for them. Whereas I, used to work with demanding projects and trained in pure math, ended up strongly typing in python (which it allows for), otherwise loosing track.
On top of that, Microsoft screwed up with its C#-compatible CNTK library, dispersed its effort to include python support again, lost miserably to other libraries, and that's the last I've heard of it.
In Java, there is a pretty neat and viable alternative library Deeplearning4j that does all - well, most - things python libraries do, has neat syntax, uses Java 8, and is overall pretty satisfying. I prefer workig in it even though in general I despise Java for multiple reasons. I actually believe Deeplearning4j is one of the few reasons to like Java for.
|
|
|
|
|
when compared to Julia any language does have its share of disadvantages
|
|
|
|
|
I prefer Haskell, but I haven't been able to use it much lately.
|
|
|
|
|
Unity used to have boo a python scripting language. No one used it though as Unity also had C#. Me personally I prefer C#.
|
|
|
|
|
Blender uses python to script its objects. But I for now use Godot since they've included a whole C# support.
|
|
|
|
|
BASIC in most cases was rather useful...
|
|
|
|
|
It is somewhat "C-like" but doesn't contain interoperabilty means (even like #define preprocessor).
One cannot reuse his code!
Python is a nice toy. Not much more.
I'd better say "Python rapidly moves to its place in a language ranking list".
|
|
|
|
|
Many of the opinions expressed here take a rather narrow view of Python. As one person said, it's like a formatted scripting language. True: but that is a front end for a formidable power-house of resources. It's also a far more accessible scripting language than Perl.
I use Python to develop large programs that run AI and Fluid-dynamic simulations. My usual language for that was C/C++, but for me Python opens up the door to accessing massively parallel computing through CUDA and PYTorch. This I can do, in an object-oriented way, without fussing around having to learn CUDA (the modern equivalent of assembler code?). I can easily run 2D hydro simulations on my nVidia card, I can run complex Neural Net programs and, best of all perhaps, I can develop beautiful visualisations.
There are several things to regret about design choices in the language. In particular the use of text formatting (indents!) to delineate stretches of code rather than parentheses - that's crazy but I live with it. Upgrades come thick and fast: that's good of course, but does cause problems with backwards compatibility (as in the recent upgrade to Python 3.8).
But it's all free - the work of people dedicated to providing a fantastic programming environment.
Now programming is fun - maximally creative.
Many thanks to all those people.
Why make life more difficult than it is?
|
|
|
|
|
I never really got into Python, everytime I try something about it bores me. It seems to me that it would be good for processing lists which is possibly partly why it's so popular in AI: using numerical methods to update all those nodes seems well suited to Python (though I still prefer Java for this personally). Perhaps it just needs more jazzy tutorials to make it appealing.
|
|
|
|
|
"Best" includes how well easily it can be parametrized according to local formatting standards.
|
|
|
|
|
|
If you want your code to be pretty, why use JavaScript?
|
|
|
|
|
|
Maybe I should ask my employer about that.
Or even the company making that IDE (which as far as I know is itself written in Java), but with a lot of customizable dialogs written in HTML, handled by their ancient, built-in HTML interpreter lacking a lot of modern features, and providing no debug facilities beyond alert(). Since no standard browser is used for display, there is no "standard" debug options.
This solution was definitely not my first choice.
|
|
|
|
|
|
The "best", is the one that does what you want in all respects. But only you can decide which that is. What I think is the best may not do what you want.
|
|
|
|
|
The one where Lily James is my secretary fetching it.
|
|
|
|
|
I connect remotely to work via RDP and a win10 VM desktop.
I'm supposed to reset my password.
To do so I believe I have to send a Ctrl-Alt-Delete via on-screen keyboard.
It has worked in the past.
Now I get this cryptic informational warning / error...
https://i.stack.imgur.com/Fy98E.png[^]
To use the commands available when you press Ctrl+Alt+Del, click your user tile and choose an option. What!?!
NOTE: This is a complaint, not a question.
I have no idea what a user tile is and I've been using windows of all versions since 1991.
EDIT
Apparently a lot of people have no idea what the user tile is:
User tile, Windows 10. - Microsoft Community[^]
|
|
|
|
|
The user tile is found by clicking on the 'Windows' button in the taskbar. This will show the "Start Menu". On the extreme left is a vertical list of icons, the first of which is the "user tile". Click on that and the change password option will show.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Exactly. It would be the entry in the Start menu showing whatever icon represents the user.
|
|
|
|