• Welcome to Autism Forums, a friendly forum to discuss Aspergers Syndrome, Autism, High Functioning Autism and related conditions.

    Your voice is missing! You will need to register to get access to the following site features:
    • Reply to discussions and create your own threads.
    • Our modern chat room. No add-ons or extensions required, just login and start chatting!
    • Private Member only forums for more serious discussions that you may wish to not have guests or search engines access to.
    • Your very own blog. Write about anything you like on your own individual blog.

    We hope to see you as a part of our community soon! Please also check us out @ https://www.twitter.com/aspiescentral

Help with Python

Boogs

Aₚₒcaₗyₚₛₑ ₛₒₒₙ!
V.I.P Member
Objects in Python are an impovisation... I can't recall now, the way they're implemented has terrible loopholes. A prankster could easily exploit it, for example, you can manually change fields of any object you have access to and Python won't disallow it. The way Python works is also very incoherent sometimes... I used it for a long time. It's good for quick scripting, but it has many drawbacks. I would also advise against learning it as the first programming language, as it has dynamic typing and you completely skip memory management, which doesn't teach crucial programming skills. Java or C# would be better in my opinion. C and C++ can be a tad difficult, but they're a must-know.
Not too sure what you mean. Frankly I haven't touched it for at least 20 years (prob 30) and I diodn't do much, just used it for a job that required it, so can't remember much more about it. But it's very popular in certain communities, including science and maths etc. I presume for a good reason, but I don't know, and can't be R'sed to look right now.

But the prankster thing applies to any source code you download, unless you go through it with a fine toothcomb. When you say manually change a field, what do you mean by that? Change it's name, type, I presume you don't mean value? Not sure I understand you.
Personally, for someone just starting on coding, I think the more fiddly stuff like manual memory management can make life rather hard. the bugs that it can produce can be pretty tough to find sometimes, and depending on the language, pretty destructive in terms of the session. Some people prefer to jump in the deep end, which is great, but others prefer to learn concepts first with easier implementation to start with, so you can focus on the aspects of the language itself that are of interest (obvious this depends on who and what they want).
Likewise, dynamic typing has advantages and disadvantages. And suits some more than others. Maybe depend on where they want to move on to, quite a few other languages are like that (don't like 'em myself, but that's personal choice, factors in favour of both sides).
In the end, there are so many reasons to choose a particular language, and without a pretty complete and tight set of requirements, whose to say what's best or not? How well Python implements object orientation? Couldn't say, but seems to have some value to quite a few people whatever the reason and is hardly immature by now, I'd have thought.
 

vergil96

Well-Known Member
I presume you don't mean value?
Value, yes. It's a dictionary. object['__key']=value
Type too. Python is dynamically typed.

But the prankster thing applies to any source code you download,
That's why I said prankster, not hacker. I meant, if someone wanted to annoy other programmers in their own project and cause hard to explain and fix errors. Of course, it can be made by accident and with bad programming practice as well.

I'll come back later with an explanation how objects in Python aren't the best, it's late at night now

including science and maths etc. I presume for a good reason, but I don't know, and can't be R'sed to look right now.
Scientists write scripts and make use of rich graphing and data analysis libraries in Python.

Dynamic typing likes to cause hard to track down errors and performance is worse. Even simple programs can run significantly slower with Python. But it all depends what you want to code, it has its uses, definitely.
 

Boogs

Aₚₒcaₗyₚₛₑ ₛₒₒₙ!
V.I.P Member
Value, yes. It's a dictionary. object['__key']=value
Type too. Python is dynamically typed.
I don't get you at all! The value is meant to be changeable, unless its a const or similarly fixed?
And the typing, isn't that just a feature of non-typed variables? I don't understand how this makes Python unsuitable, unless you speaking in a task specific way? I understand if you want or need a language which is strongly typed, but as a general criticism against using a language, I can't see your argument, unless some context requires it.
That's why I said prankster, not hacker. I meant, if someone wanted to annoy other programmers in their own project and cause hard to explain and fix errors. Of course, it can be made by accident and with bad programming practice as well.
I see little difference, but I think you're really saying "caveat emptor" when sharing source code, in a generalised fashion?
I'll come back later with an explanation how objects in Python aren't the best, it's late at night now
I'd be interested from a curiosity p.o.v. but only if you've got the energy, not a big deal.
Scientists write scripts and make use of rich graphing and data analysis libraries in Python.

Dynamic typing likes to cause hard to track down errors and performance is worse. Even simple programs can run significantly slower with Python. But it all depends what you want to code, it has its uses, definitely.
As I said, I can't argue for Python, I'd have to go gen up on it (and much has prob changed too), but I know science, having worked in uni chem dept, and a pharma research site for 20 years, so I know a bit about how important reliable and correct answers are to this field. You don't put your whole career and rep on the line for a bit of stats software (or whatever) unless it's damn reliable and very quality controlled etc. and already proven as a scientific tool. It may have weaknesses, but everything is a compromise in one way or another.

Sadly, I can't make the technical argument, and haven't the time or motivation to learn enough to do so.
You totally spot on about typing, and I can see it's something seems close to your heart, I've mentioned I agree, and prefer strong typing in most cases, but that doesn't mean there is no case for non and weak typed languages. Horses for courses. I've lost count of how many different languages and scripting tools I've had to pick up for just one task, because it has some feature that makes it suitable, if not even preferable. But it's always based on what it's needed for, where (the type of environment) it's going to run in, etc etc.
 

Hypnalis

Well-Known Member
It would be interesting to continue this, but the thread is for someone learning coding basics.

Perhaps start another thread?
I'd be quite interested to learn more about Python. Anything that's so widely used is worth a look.

IMO, OP's questions show he's not ready to learn how languages are implemented, or how language runtimes work.

I think it's much better to learn how to specify basic logic in higher-level languages that are designed to make coding easy, and are reasonably well implemented
That means e.g. no explicit memory management, dynamic typing, and simple structures (e.g. Tables rather than objects).

IMO teaching more complex ideas and tools is comparable to starting a new language by studying grammar.
It works, but it's a lot slower and a lot more work. And has no real upside in the long term.
 

New Threads

Top Bottom