The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Significant indentation? And tabs / spaces are not equivalent? So you can have two identical looking lines of code but they compile differently? There is no charm here, just confusion and stupidity.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
Yeah, ending a code block by reducing the indentation one step is a really horrible nightmare and prone to errors, especially when you press ENTER around in your text editor. I would stick to languages that use curly braces.
The thing is that lots of people live with the misconception that Python is suitable for general problem solving, of arbitrarily complex problems. Scripting languages are meant for scripts, for managing a process (such as the building of a software system). It startet with Job Control Languages, developed into Unix sh and all its derivatives, or .bat files developed into PowerShell. You may see scripting languages such as Python as a further developments of shell concepts.
You would never try to solve a complex problem as neither a bash nor PowerShell script. Even with further development of those concepts into Python (and its functional relatives), scripting languages are not suitable for complex problem solving.
Lua is easily embedded in a C/C++ application, and that works also in the opposite direction, it is easily extensible using C/C++ libraries.
So, my first plan was to embed Lua in a C++ application (and write numerous C libraries for low level tasks). Eventually, I found no real need for the C++ code.
"In testa che avete, Signor di Ceprano?"
I hear it is a great language for data analysis, etc.
I know a couple of people using it for big data and similars and they just say it is the best, I have never used it though so I can only say what I was told.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
I completely agree...
I grew up on a PDP-11 running RSTS/E using Basic-Plus (The Predecessor to VAX Basic).
Most of the OS Tools were written in Basic-Plus. I could do anything in BASIC. It was pseudo-compiled (Bytecoded), and was the technology Microsoft "borrowed" to get instant compiling of BASIC for Visual BASIC.
Was it perfect? No!
Was it extensible? YES! In fact, we had MEMORY MAPPED Files that Worked like arrays, you index the file as File[X] to get a fixed block read of block X. You declared the block size when you opened the file. We used this for lightning fast Hash Lookups.
Extensible? We had to modify the OS to add "sys" calls to a jump table. But we could do it.
Now, BASIC allowed DLL calling in windows. And Python allows wrappers of compiled code.
Finally, to me the MOST POWERFUL piece of an interpreted language is the ability to EMBED it as a scripting language inside of an Application to let the end users extend it.
I wrote applications inside of Word and Excel for people. It broke my heart when I went to embed VBA inside of my application, and ran into MSFT Licensing (OMG Draconian). So we used a different scripting engine that was free and based on Pascal. It worked... But I would have loved for the product to have the Power and Libraries of Python!
What does charm have to do with anything? We used to argue if using a scripting language was really programming. Python has its uses, it is like any other tool. If it does the job for you, use it. Example: While troubleshooting a network issue, I wrote a quick syslog server script that sorted through all the crap going through our firewall. When done, deleted. Was that charming? I think not. Was it useful? For me it was. It is also good for doing POC on IoT stuff. Then rewrite in Object Oriented Assembler.
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
Why I Start Python then always Stop
I like a lot of programming languages.
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:
def __init__(self, iterable):
self.items_list = 
def update(self, iterable):
for item in iterable:
__update = update # private copy of original update() method
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.