But even for that, it's not a toy language as clearly evident by this example.
Metaprogramming in Python
11–20 of 61 posts
Re: Metaprogramming in Python
#12It is shocking how much vodoo magic there is in a programming language marketed as "easy to learn and use". And with the recent addition of new syntax, I would hardly call Python easy.
> It is shocking how much vodoo magic there is in a programming language marketed as "easy to learn and use". But that's exactly what that expression means? A car with an automatic transmission is "easy to learn and use", but an automatic transmission is way more complicated to construct than a manual one.
The comparison makes no sense.
Re: Metaprogramming in Python
#13Earlier quoted context omitted.
Python is easy, not because it prevent people from doing complicated things, but because with only a few simple things, you are productive. Most python programmer use 10% of the language, the same 10% that is described in most tutorial, because that's enough, and they don't even know the rest exist. This makes for a very smooth, but long learning curve which allow you to enjoy python in the early years, yet keep gett…
That "smooth learning curve" applies when you are learning the language, use it by yourself or work in the ML/Data science industry. Once you get thrown in a big project that makes heavy use of type hinting (plus the whole environment of it, mypy et all), Object Oriented design and all those hidden things...you realize how much you really don't know. And that 10% is way too small. To be productive in Python, you need…
Re: Metaprogramming in Python
#14Earlier quoted context omitted.
> It is shocking how much vodoo magic there is in a programming language marketed as "easy to learn and use". But that's exactly what that expression means? A car with an automatic transmission is "easy to learn and use", but an automatic transmission is way more complicated to construct than a manual one.
I wouldn't call subclasses, metaclasses and decorators easy to use, let alone learn to use correcly. The comparison makes no sense.
Re: Metaprogramming in Python
#15It is shocking how much vodoo magic there is in a programming language marketed as "easy to learn and use". And with the recent addition of new syntax, I would hardly call Python easy.
It's so easy to learn & use that children manage to be productive with it (the Roblox community).
It's still powerful though. With few enough primitives to remain simple & understandable, it has just enough primitives to build anything. People have written web frameworks, window managers and video games in Lua.
It's got less pitfalls, "voodoo magic" and advanced weirdness than any other language I know. You can learn 90% of the language from its Wikipedia page. Every time I encounter some of Python's internal weirdness, I wish Lua had been the scripting language of the 2000s instead. Unfortunately Python has a vast collection of libraries available that keep us using it instead.
Re: Metaprogramming in Python
#16Earlier quoted context omitted.
> It is shocking how much vodoo magic there is in a programming language marketed as "easy to learn and use". But that's exactly what that expression means? A car with an automatic transmission is "easy to learn and use", but an automatic transmission is way more complicated to construct than a manual one.
I wouldn't call subclasses, metaclasses and decorators easy to use, let alone learn to use correcly. The comparison makes no sense.
Re: Metaprogramming in Python
#17Re: Metaprogramming in Python
#18It is shocking how much vodoo magic there is in a programming language marketed as "easy to learn and use". And with the recent addition of new syntax, I would hardly call Python easy.
Re: Metaprogramming in Python
#19Earlier quoted context omitted.
Python is easy, not because it prevent people from doing complicated things, but because with only a few simple things, you are productive. Most python programmer use 10% of the language, the same 10% that is described in most tutorial, because that's enough, and they don't even know the rest exist. This makes for a very smooth, but long learning curve which allow you to enjoy python in the early years, yet keep gett…
That "smooth learning curve" applies when you are learning the language, use it by yourself or work in the ML/Data science industry. Once you get thrown in a big project that makes heavy use of type hinting (plus the whole environment of it, mypy et all), Object Oriented design and all those hidden things...you realize how much you really don't know. And that 10% is way too small. To be productive in Python, you need…
But 99.9999999% projects won't implement metaclasses.
Most won't event implement decorators, context managers or generators. Use them, sure.
Re: Metaprogramming in Python
#20https://github.com/irtnog/salt-states/blob/production/_modul...
The SaltStack module starts out empty except for a function that runs at module load time. The initialization function queries PowerShell for all AD FS-related cmdlets and creates Python wrapper functions for them. It even copies the cmdlet's help to the function's docstring.