Earlier quoted context omitted.
`foo._a` accessible outside `Foo` but it makes code look gross and means you're doing something wrong. `foo.__a` accessible only inside `Foo` I think it works.
> `foo.__a` accessible only inside `Foo` It's not all that inaccessible. Try: class C: def __init__(self): self.__private = 'Is it private?' c = C() c._C__private Double underscore names aren't so much about access control (because access control isn't strongly enforced) as about limiting name collisions (by including the class name in the underlying field name).
Is Python the Future of Programming?
61–70 of 77 posts
Re: Is Python the Future of Programming?
#62Python is one of the simplest language you can learn. It is really nicely designed and executed. If simplicity is the goal, Python has that in spades.
It's NOT simple at all, see my comment above: https://news.ycombinator.com/item?id=17584388
Brainfuck is simple, but not simple to learn to do useful things in with.
Re: Is Python the Future of Programming?
#63Earlier quoted context omitted.
Lua is far simpler, and still easy to learn. Yet it's powerful enough to be used in "real" projects (e.g. Photoshop Lightroom).
Unqualified simplicity is useless metric. Brainfuck is about as simple as a language can be, and people can learn it in an afternoon.
Re: Is Python the Future of Programming?
#64Earlier quoted context omitted.
Lua is far simpler, and still easy to learn. Yet it's powerful enough to be used in "real" projects (e.g. Photoshop Lightroom).
Lua comes in quite high on the "Most Dreaded" list of programming languages and has 1-based indices in a world of 0-basing. Not exactly something I would recommend ...
Re: Is Python the Future of Programming?
#65Python is stupidly simple and that's the reason I use it for 99% of my work (netsec/forensics). I introduced my ex to it for her dissertation in astro-physics. It took her under a week to mainly self-learn and start writing scripts with numpy and matplotlib, and it was her first language. The code wasn't good by professional standards, but it did the job. I cannot think of any programming/scripting language which can…
NO, Python is not simple at all, especially nowadays with all the asyncio stuff and tons of new features in 3.4+. One can't even follow what's happening with the language. I don't understand where this nonsense is coming from. Probably ignorance? You might not know too much about it to understand how huge and complex Python is.
Re: Is Python the Future of Programming?
#66I have never got serious about python until very recently(I mean about one week), the more I dive into it the more I am convinced yes python is the future in the sense it does the below: replacing BASIC(i.e. good for beginners) replacing Java in colleges for intro to programming replacing matlab(ipython jupyter) replacing R for ML and big data great for web scraping replacing Perl and probably shell scripts for CLI s…
I think the one area that Python won't fit in is low level languages such as C/C++. I can easily see Rust taking over that space. Java is never going to go away, but let's hope Scala becomes more popular. Neither is C#. I'm not really sure where Go fits into the picture.
What Python is really good at, though, is gluing together/scripting C/C++ code. I've had a lot of success in my career starting a project in Python, and then dropping down to C or C++ for the high performance bits. As an example, I worked on a software-defined radio project with some errr... special requirements. All of the modulators etc were all written in C, and the bitstream generation/manipulation was done in Python. There was also a bunch of numerical processing bits (solving diff eqs with RK4) written in C++, parameterized by Python. The net result was that we could use a Python REPL to experiment and script the system, while handily using all of our CPU cores to their maximum capacity.
Re: Is Python the Future of Programming?
#67How are people writing large programs in Python? Isn’t the lack of compiler type checking making it difficult? And what about lack of access modifiers? People aren’t bothered by this? For programs less than 500 lines, I have no issues with Python, but it feels to me like Python just isn’t suited for large-scale programming in the way C#, Java, Go, or Rust are.
I think programmers often misinterpret what’s hard about building large projects. It’s not correctness it’s communication. A type checker will save you from small errors but well written and easily understandable code will save you from a lot more. Not saying readability is harder in c# java go or rust just that the type system doesn’t help with it that much.
Re: Is Python the Future of Programming?
#68How are people writing large programs in Python? Isn’t the lack of compiler type checking making it difficult? And what about lack of access modifiers? People aren’t bothered by this? For programs less than 500 lines, I have no issues with Python, but it feels to me like Python just isn’t suited for large-scale programming in the way C#, Java, Go, or Rust are.
Not as good as a real static type system with compiler, but still helpful for documenting the code and tools for static code analysis.
Re: Is Python the Future of Programming?
#69Re: Is Python the Future of Programming?
#70How are people writing large programs in Python? Isn’t the lack of compiler type checking making it difficult? And what about lack of access modifiers? People aren’t bothered by this? For programs less than 500 lines, I have no issues with Python, but it feels to me like Python just isn’t suited for large-scale programming in the way C#, Java, Go, or Rust are.