Hacker News new | ask | show | jobs
by 0-_-0 2042 days ago
Not directly related, but when I was learning programming back in highschool (before the Internet) what made it easy was the built in help in Turbo Pascal. You could press F1 over any function or keyword and you were given a detailed description and example of usage. Learning C later using the K&R book and Google was a huge downgrade. Even today I think that language help built into the IDE should be a basic functionality.
6 comments

In vim if you press K it will bring up the man page for the word under your cursor. It was very useful when learning C, considering that most libc functions have helpful man pages.
Note for people trying this at home, vim is case sensitive.

I still regularly use this feature to look up libc and other things. You can also type 2K to go to ‘man 2’, or 3K to go to ‘man 3’ etc.

And for the sake of completeness, it is not just for man pages either. vim simply calls 'keywordprg' with the word under the cursor, so you can use whatever you feel like. Open a browser tab on your favourite documentation, display an ERD, pop open a picture of a kitten, …

Many filetype plugins come with pre-configured 'keywordprg' settings. Including some non-programming filetypes like git which will execute `git show <word>`, which is great if you're the type of person who often references commits in other commit messages.

I've seen that with Delphi. The unique factor was that the examples were not a basic call of the function but an actual real world practical sample that usually solved the problem one was looking for.
I was a Delphi programmer for a few years, professionally, when it first came out in the 90s. I worked with their developer products (and for Borland directly on Delphi/Kylix/C++Builder, eventually) until the mid-2000s. I've never seen the match of Borland's docs, before or since, particularly as integrated with the IDE's coding features.

There are a number of programming languages and APIs with excellent documentation, but theirs were above and beyond.

The Delphi IDE help was good but the printed Delphi manuals were just outstanding. I have fond memories of learning much through those manuals.
I had forgotten the “brick” you used to buy with a few CDs (or floppies) and a whole stack of books.

Things sure were heavy before the internet got fast.

I have them in print still, including the MS-DOS ones (TP), if you don't have them any longer, they are available at bitsavers.
This is done quite nicely with clojuredocs being intergrated into Cursive / Intellij.

I hover over a Clojure function in INtelliJ and I get a pop up of the clojuredocs with description and example usages for that function.

It's great and I don't know why more IDE's don't do this. Why isn't VS linked to the MSDN for C# / .NET ? SO I can get the information for that function / class / library etc straight in my IDE!

Bringing it back, this works great with Rust and VSCode and rust-analyzer: Any function in any crate shows its doc comment complete with markdown formatting when you hover over it.
And you can assign a hotkey to open the docs in the browser for the symbol under the cursor.
This is one of the things I love about Mathematica, it has a lot of documentation about every keyword and function that you can open with F1.
You could do the same with C in Visual Studio for at least 15 years now
That requires an internet connection and opens a page in your browser.
Nope, because one would install the MSDN documentation locally from the bundled CDs and use Windows help infrastructure.

The Web version came much later.

Which means that currently it requires an internet connection and opens a page in your browser.
Have you actually tried that? I just installed it and it's just a buch of help files that link to the web. F1 continues to work the same way, bringing up websites, often useless ones like this one for a for loop:

https://docs.microsoft.com/en-us/dotnet/api/microsoft.codean...

I've seen this with bpython