Earlier quoted context omitted.
That's because the use case for classes appears when the information needed to understand the program exceeds the programmer's working memory. At some point, you need some way to make something into a black box whose innards you do not need to understand when not working inside the black box. Languages which do this badly do not scale well. This is a hard problem. We have, at least, structs, classes, objects, traits,…
For the Python typing system. If you mostly code alone, you have the options to force yourself to enforce it, which would benefit the future you.
In defense of complicated programming languages
61–70 of 379 posts
Re: In defense of complicated programming languages
#62def bark(dog_dict): print("WOOF!" if dog_dict["weight_kg"] > 25 else "Woof") rex = {"name": "Rex", "weight_kg": 35} This code is actually better, but it would even be better with structs and traits https://gist.github.com/rust-play/ceb5a292a22e55e27d56a83253... We separate the concept of a Dog, the concept of something that barks, and the actual implementation in this case We also don't immediately print it, but just…
Missing the point. If you read just a little farther, you get that extra apparatus has a purpose that is opaque to beginners, that just adds confusion.
Re: In defense of complicated programming languages
#63Earlier quoted context omitted.
You've never seen tutorials written that way because roughly nobody but you learns programming languages from the bottom up. There is just no demand. By the way, where can I read a D tutorial from the bottom up?
> You've never seen tutorials written that way because roughly nobody but you learns programming languages from the bottom up. I am indeed a unique snowflake.
Re: In defense of complicated programming languages
#64"Classes would still exist, but as implicit patterns." Classes are not a design inevitability, but just one way of managing state. Languages that mostly avoid mutable state don't tend to have object systems, for instance.
Type classes and ML functors are also a way to do polymorphism and dynamic dispatch on data structures. So which languages are left without object systems?
The difference between them are important to some people. And that's why they will argue for that.
Re: In defense of complicated programming languages
#65I remember first encountering classes. I simply could not understand what they were from reading the documentation. Later, I picked op Bjarne's C++ book, read it, and could not figure out what classes were, either. Finally, I obtained a copy of cfront, which translated C++ to C. I typed in some class code, compiled it, and looked at the emitted C code. There was the extra double-secret hidden 'this' parameter. Ding!…
Re: In defense of complicated programming languages
#66A language with a short learning curve is like a toolbox that’s nearly empty. You quickly run out of ways it could help you. We should optimize for experts, because that’s where each of us is going to spend most of his career.
Re: In defense of complicated programming languages
#67A language with a short learning curve is like a toolbox that’s nearly empty. You quickly run out of ways it could help you. We should optimize for experts, because that’s where each of us is going to spend most of his career.
Re: In defense of complicated programming languages
#68For now I wrap my data objects as a json and use rabbitMQ to message the json to all the other running .py's
I heard about async and want nothing to do with it thank you.
I do understand the need to maintain a mental model of the code so I gave based everything on Sherlock Holmes novels.
Re: In defense of complicated programming languages
#69> In video game design there is a saying: Show locked doors before you show a key This is something I've tried putting into words many times. I'll try to solve a problem and get to know its challenges deeply. Then a tool is introduced that brings it all together. In these cases, I seem to quickly get a full grasp of the operation and essence of the tool. I wish education was based around this principle. A bit like wh…
That's because the use case for classes appears when the information needed to understand the program exceeds the programmer's working memory. At some point, you need some way to make something into a black box whose innards you do not need to understand when not working inside the black box. Languages which do this badly do not scale well. This is a hard problem. We have, at least, structs, classes, objects, traits,…
Mypy is also not 1.0 yet.
You can still find bugs in advanced use cases i.e. when you are mixing inheritance, generics, data classes...
The new type system is both flawed and also a godsend for python developers.
Re: In defense of complicated programming languages
#70> In video game design there is a saying: Show locked doors before you show a key This is something I've tried putting into words many times. I'll try to solve a problem and get to know its challenges deeply. Then a tool is introduced that brings it all together. In these cases, I seem to quickly get a full grasp of the operation and essence of the tool. I wish education was based around this principle. A bit like wh…