Live data from Hacker News

Py5, a Python version of Processing for your creative coding projects

py5coding.org

21–30 of 34 posts

Re: Py5, a Python version of Processing for your creative coding projects

#22
post #12

Why must every educational python library insist on teaching kids with global variables? I know parameters aren't easy for novices, but it feels like it's missing a lot of the value when we don't attempt to teach them...

Because it's perfectly fine for 100 line programs. Beginners don't need to write extensible code that will be maintained for 30 years on business critical systems. You start by learning what a fuckin for loop does.

Not only that, it's a relatively gentle introduction into object oriented concepts, where an instance is just like independent copies of modules, as they're using them: module.function(), with function accessing some global conceptually turns into instance.function() where function accesses some instance "global".

I was always a bit surprised that python didn't allow "module instances" that automatically did that.

Re: Py5, a Python version of Processing for your creative coding projects

#23
post #21

I can foresee the name of this causing issues in a decade or two when python releases version 5.

I think everyone who has gone through the 2->3 transition will have to be dead before 3->4 will have a chance of even being considered. :-)

Re: Py5, a Python version of Processing for your creative coding projects

#24
post #22

Earlier quoted context omitted.

Because it's perfectly fine for 100 line programs. Beginners don't need to write extensible code that will be maintained for 30 years on business critical systems. You start by learning what a fuckin for loop does.

Not only that, it's a relatively gentle introduction into object oriented concepts, where an instance is just like independent copies of modules, as they're using them: module.function(), with function accessing some global conceptually turns into instance.function() where function accesses some instance "global". I was always a bit surprised that python didn't allow "module instances" that automatically did that.

Honestly the way I learned not to use a ton of global variables was because I used so many and would forget what they'd do. But that was back in the days of Apple // BASIC so when I was introduced to C I rejoiced. People need to learn from mistakes.

Re: Py5, a Python version of Processing for your creative coding projects

#25
post #12

Why must every educational python library insist on teaching kids with global variables? I know parameters aren't easy for novices, but it feels like it's missing a lot of the value when we don't attempt to teach them...

Because the concept of variables must be learned before the concept of scope.

Re: Py5, a Python version of Processing for your creative coding projects

#26
post #21

I can foresee the name of this causing issues in a decade or two when python releases version 5.

I think everyone who has gone through the 2->3 transition will have to be dead before 3->4 will have a chance of even being considered. :-)

Python 95 :)

Re: Py5, a Python version of Processing for your creative coding projects

#27

Earlier quoted context omitted.

Yep. In case you don’t want to write Java you can do it in Python. But it uses the same engine

I suppose jython would be particularly useful in such cases

using Jython prevents you from using the regular Python ecosystem though

Re: Py5, a Python version of Processing for your creative coding projects

#28
post #22

Earlier quoted context omitted.

Not only that, it's a relatively gentle introduction into object oriented concepts, where an instance is just like independent copies of modules, as they're using them: module.function(), with function accessing some global conceptually turns into instance.function() where function accesses some instance "global". I was always a bit surprised that python didn't allow "module instances" that automatically did that.

Honestly the way I learned not to use a ton of global variables was because I used so many and would forget what they'd do. But that was back in the days of Apple // BASIC so when I was introduced to C I rejoiced. People need to learn from mistakes.

For me, I learned when I wanted all my function calls to do the same thing no matter how many times, or order, I called them.

I often wonder how much "pain" is required to really learn something. I would claim that 90% of how I write code is the result of pain, not patterns, even though they often end up being similar.

Re: Py5, a Python version of Processing for your creative coding projects

#30

Earlier quoted context omitted.

Yep. In case you don’t want to write Java you can do it in Python. But it uses the same engine

I suppose jython would be particularly useful in such cases

I've also worked with a python->javascript transpiler and hooked it into p5.js if your more into that
Post reply on HN