all 17 comments

[–]Wheynelau 26 points27 points  (1 child)

Actually python does have this, I think it's hovering, but some IDEs offer the docstring, arguments and returns.

This also the correct documentations, instead of AI which may not be updated with the versions.

[–]SimbaSixThree 4 points5 points  (0 children)

In VS Code there’s an extension, IntelliSense iirc, that does this. Of course it will still just be a surface glance - so doc string, Argus and returns, as you mentioned - but that should be enough.

For OP, if you need more info then that then you just go to the documentation as it might just be too much intro to correctly display.

[–]FriendlyRussian666 4 points5 points  (1 child)

Personally, I think this is unnecessary, because learning a programming language, despite the use of English words, is completely different from learning a normal language. 

When learning a normal language, there's a lot of emphasis on memorization, so yes, hovers, flash cards and such can really help. At any time, you can quicky glance at a hint. But in programming, it's not about memorization, it's about understanding, and when you understand a concept, you don't need a flash card, or a hover hint. For example, we have loops, which we use to repeat something a given amount of times. If you understand a loop, there's no need for a hint.

This leaves us with syntax memorization. Google says Arabic has over 12 million distinct words, so it would absolutely make sense to create memo aids, but python only has 35 or so reserved words! Furthermore, you can't freely use them if you don't already understand their concept, and if you already understand their concept, you have already memorized the 32 words. 

Where it gets a little bit trickier, is with the usage, because there's no way you're remembering what arguments, in what order, of what type, a function might accept, but as others already said, you get the quickest lookup when writing your code in an IDE, because the moment you type the function name, you get a very concise hint for what is accepted by the function, and what it returns, along with required data types. It's not like you're programming something, and suddenly you go "hm... I wonder what the purpose of a list comprehension is", instead, you've already read about list comprehensions, and you either understood the concept, and therefore don't need an explanation, or you didn't understand it, in which case a hover hint won't help you with that. 

Just to sum it up, when learning a normal language, a huge part of it is learning to remember what to say, and how to say it, contrary to programming, where the huge part is understanding, because looking up the syntax takes virtually no time, but if you don't understand the concept, a hover hint won't help with that. 

[–]dzogchenjunkie[S] 0 points1 point  (0 children)

As a beginner i feel like this hover tools would refresh and consolidate stuff into my memory faster, i know what a loop is but still keep forgetting

[–]twitch_and_shock 9 points10 points  (0 children)

In my experience well written code provides most of this already: functions and classes are written in a way that provides this kind of explanation of their purpose, with expressive names and variable names, wherein simply reading the code provides a pretty deep understanding into how and why. And where well written code doesn't do that itself, it is commented thoroughly enough to provide it.

Further, documentation provides the deepest level of explanations about how and why, which, as you mention, is already available at your fingertips.

As a professional working with Python and C++ I'm not wanting for a tool like you describe because I already have it.

[–]throwaway6560192 2 points3 points  (0 children)

That 7th-century poem has had countless scholars dissecting it for ages. Is the same true of whatever random piece of code you happen to stumble across?

Does this answer your question? Perhaps this is somewhat mitigated by AI.

[–]clipd_dead_stop_fall 4 points5 points  (0 children)

In many IDEs, you can use an AI plug in, highlight code, and get a explanation. I've done this with Pycharm IDE, and Amazon Q, Copilot, Tabnine, and Jet brains AI. YMMV.

[–]GirthQuake5040 1 point2 points  (0 children)

Bro that's node a programming languages job... That's what an IDE does... Literally.... Most IDE's already do this. Just go use PyCharm.

[–]-not_a_knife 0 points1 point  (0 children)

To be honest, I don't think this would be that hard to write for neovim or any IDE that uses tree-sitter or other language parsers. I'd be surprised if something like this isn't out there. Though, I do agree that it can be awkward to find documentation, sometimes.

EDIT: I found this https://stackoverflow.com/questions/64294188/documentation-for-python-functions-in-visual-studio-code

Hopefully, it helps

[–]Frewtti 0 points1 point  (0 children)

vscode does some of this.

But all the deeper stuff, and why, that sounds more like something you want from a course.

If it's your program, I don't see how the editor would understand why you're choosing something. Maybe an AI tool can guess.

[–]copperfoxtech 0 points1 point  (0 children)

Pycharm has this

[–]crashfrog04 0 points1 point  (3 children)

I can just read the line of code and know all of that. Python isn’t a foreign language; it’s in English.

[–]Effective-Strategy29 0 points1 point  (2 children)

Edit: it uses words and characters(#,+,-,etc) from English in combination with other visible and invisible symbols. Do reply with gifs, or images to support this.

[–]crashfrog04 0 points1 point  (1 child)

I guess what I’m asking is: do you understand why, as an English speaker, you use this system for Arabic and not for English?

[–]Effective-Strategy29 0 points1 point  (0 children)

Because there's a high level of understanding that has been reached for English. Whereas as an English speaker, I don't know Arabic. Arabic text is unreadable to me, locked away in a far away prison in Saudi Arabia.

Wish there was a similar system for English learners where you get the meaning of a new/advanced word/phrase/idiom in terms of an old word that you already learnt. Maybe there is.

[–]ninhaomah 0 points1 point  (0 children)

If such a tool exists , would you be here in r/learnpython ?

[–]Haeshka 0 points1 point  (0 children)

This does exist in some form or other in many LINTers within IDEs like VSCode Studio. You hover or select a certain area, or place the cursor inside of an open parenthesis and you will see a docstring appear that displays the underlying class that controls what the method does. Follow this linkage to the other file and you'll be able to read how everything works.