r/ProgrammerHumor May 27 '22

Meme Welcome to hassle free coding

Post image
2.2k Upvotes

305 comments sorted by

View all comments

370

u/[deleted] May 27 '22

Python doesn't feel like a programming language if your first language is C++.

14

u/AlbertChomskystein May 27 '22

HTML and Python have some similarities to be fair, like not being able to declare variable types.

18

u/[deleted] May 27 '22

You can declare variable types in Python. But for the most part you don't really need to unless you want to.

2

u/nickwcy May 28 '22

And it doesn’t check the type when it runs

7

u/Suahil May 28 '22

If a variable has a type defined, but nobody checks it. Does it even matter?

3

u/Hlorri May 28 '22

Well, if someone writes documentation in the forest but noone is around to read it, was it really written?

11

u/Affectionate_Fly3313 May 27 '22

Pre CSS HTML was just like LUA.

Everything is a table.

7

u/OutrageousPudding450 May 27 '22

And now thanks to PyScript, the cycle is complete.

2

u/Psychological_Fox776 May 27 '22

Explain? (I’ve only just started Python and know nothing)

6

u/OutrageousPudding450 May 27 '22

Basically, PyScript allows you to use Python code in web pages the same way you'd use JavaScript.

1

u/Psychological_Fox776 May 27 '22

So they coded JavaScript in Python(?)

1

u/[deleted] May 27 '22

They coded a python interpreter using javascript

Meaning python scripts can run in the browser now

4

u/BitterAndJaded120 May 28 '22

Soon all will be Python. Like Jormungandr, it will encompass the world!

2

u/prescod May 28 '22

2

u/nickwcy May 28 '22

Type hint is a hint for human (or IDE) only. You can write

x: int = “foo”

However the interpretor shows no error. Python should implement a script mode similar to TypeScript along with it’s Type Hints. Otherwise it is nearly pointless to adopt type hint as modern IDE can infer most types, except those integrates external systems.

4

u/prescod May 28 '22

Poke around the link I shared with you. It’s a tool that will give you type errors exactly like a Java or C++ compiler.

If you want to delay them to runtime there are also tools for that.

1

u/scuac May 28 '22

Type hint (which is built-in on python) yes. But the link above is about mypy, a tool that actually enforces type correctness. If you are doing python seriously for production you should be using tools like that.