Live data from Hacker News

Advice to a novice programmer

blog.plover.com

141–150 of 158 posts

Re: Advice to a novice programmer

#141
post #47

Earlier quoted context omitted.

This is fair for certain languages like JS or Java (IntelliJ is amazing), but not as much for less popular languages. I started learning Rust a few years ago, where the Rust plugin for Jetbrains IDEs was still in its infancy. Switching to VSCode specifically for rust-analyzer was a great decision for me, due to the amount of tooling included. VSCode is popular because it is easy to learn for a beginner and shares muc…

JetBrains released an LSP integration for their IDEs sometime ago: https://blog.jetbrains.com/platform/2023/07/lsp-for-plugin-d... Yes, it’s still new and somewhat buggy, but I am using Zig LSP plugin and it works pretty good.

Interesting! I stopped using Jetbrains IDEs by that time, which is why I didn’t mention it.

Re: Advice to a novice programmer

#142

This is great advice, although personally I will continue using vim over vscode. If vscode is a sharp kitchen knife then vim is a katana sword. Novice programmers should probably not start with vim.

I still don't really understand what Vim users see in it. They always seem to claim that you can edit faster... and sure you can if you're comparing with Notepad++. But modern editors have multiple cursors and tons of useful editing tools that let you be easily as fast with much less pain.

> sure you can if you're comparing with Notepad++. But modern editors have multiple cursors

Notepad++ has multiple cursors. Vim has "repeat last command", which is better.

Re: Advice to a novice programmer

#143
post #38

Earlier quoted context omitted.

You don't even have to read a vim tutorial. The tutorial is already baked in. I learned vim by doing vimtutor every couple of months to learn more advanced features after getting basic navigation and editing motions down and forcing myself to use it for as much of my work as I possibly can. Learning vim early paid dividends in terms of productivity and also by forcing me to learn more about how to actually leverage o…

> I learned vim by doing vimtutor every couple of months to learn more advanced features after getting basic navigation I think you're missing the point. Should a novice programmer postpone their education by months because they need to satisfy the imaginary pre-requisite of learning vim via vimtutor? There's a lot of thinking involved at all levels let alone at the novice stages. I cant imagine how frustrating it'd…

> Should a novice programmer postpone their education by months because they need to satisfy the imaginary pre-requisite of learning vim via vimtutor?

I think this splits out into two camps of people:

1) People who are deeply curious and want to tinker and learn new things

2) People who view programming as a means to an end and want to build an app

If you're a novice I think you're better off falling into camp #1 even if it takes longer because you're still picking up education at every step of the way about what tools exist on your system and how to use them and then eventually once you're good enough you can coast and move into camp #2.

The same curiosity that led me to want to learn vim led to me wanting to learn about as many tools shipped with Linux as possible because I assumed many of them would be as powerful as vim was. That curiosity led to me eventually building up a much deeper intuition about how systems work and I think ultimately made me a better developer.

Is it a frustrating process? Maybe at times. But for the most part I think computers are fun and learning about them is fun even if I don't fully grok what I'm doing at the time.

Re: Advice to a novice programmer

#144
post #105

Earlier quoted context omitted.

Integrated linters save a lot of time with their immediate feedback. Depending on the language you're working with, remote debugging can be an incredible time saver. Modern editors are aware of the structure of the code, so can do things that are impossible for default VIM to do, like find the usage of a variable, rather than text occurrences, automatically show documentation, etc. All time savings.

Agreed, good points. I guess I still wonder whether these are needed for an introductory assignment. A vim/ssh workflow seems more future-proof than any particular IDE. As an instructor maybe it would make sense to do the first assignment with low-level tools, then introduce VSCode/etc and briefly demo these things, to make the added convenience even more visceral to the novice.

> would make sense to do the first assignment with low-level tool

Sure, but if the goal is to teach programming, I think vim massively confuses a beginner. vim is hard for beginners, famously so. Something like VSCode, used as a remote text editor, is trivial and familiar to anyone who has used at MS Word. I agree it should be introduced, but there's definitely some cargo cult around vim and "the old ways".

Re: Advice to a novice programmer

#145

Earlier quoted context omitted.

You're not selling it to me. For simple admin tasks, Micro is totally fine. For actual programming where I really want the full power of an advanced editor, VSCode has all the properties you listed except arguably lightweight, though even there VSCode itself is pretty lightweight; it's just the heavy LSP servers that bog things down. I obviously don't see Vim as a flex. Maybe a misguided flex.

It’s not VIM specifically, it’s the vim way, a language for editing texts. Actions are atomic and composable. And then you can add your own commands. You could probably use VIM inside VSCode but the latter does not expose the necessary API. What you got instead is a very simplified version. Emacs does and evil-mode is a very good vim.

> Actions are atomic and composable.

That sounds like a downside. Incremental editing with multiple cursors is so much better than e.g. regex based find/replace or long vim commands because you get immediate feedback. If you make a mistake you just undo. You don't have to start again from scratch.

With complex atomic editing operations it is painful to get them right because you only see the final output.

Atomicity of complex editing operations is not a desirable property.

Re: Advice to a novice programmer

#146

Earlier quoted context omitted.

I still don't really understand what Vim users see in it. They always seem to claim that you can edit faster... and sure you can if you're comparing with Notepad++. But modern editors have multiple cursors and tons of useful editing tools that let you be easily as fast with much less pain.

> sure you can if you're comparing with Notepad++. But modern editors have multiple cursors Notepad++ has multiple cursors. Vim has "repeat last command", which is better.

Why is it better?

Re: Advice to a novice programmer

#147

Earlier quoted context omitted.

I still don't really understand what Vim users see in it. They always seem to claim that you can edit faster... and sure you can if you're comparing with Notepad++. But modern editors have multiple cursors and tons of useful editing tools that let you be easily as fast with much less pain.

Here, this will help: https://gist.github.com/nifl/1178878 (Emacs user happily using Evil mode since 2011 or so)

Not really. I already know that Vim can be used as a difficult-to-remember editing language.

My point is that in practice the number of situations where that is better than normal editing with multiple cursors is so few that it doesn't get close to the threshold of being worth committing to memory.

That gist is rather long and rambling so I only skimmed it, but it seems to list commands you can do in Vim rather than real life editing situations that they are especially good at.

Re: Advice to a novice programmer

#148

Earlier quoted context omitted.

It’s not VIM specifically, it’s the vim way, a language for editing texts. Actions are atomic and composable. And then you can add your own commands. You could probably use VIM inside VSCode but the latter does not expose the necessary API. What you got instead is a very simplified version. Emacs does and evil-mode is a very good vim.

> Actions are atomic and composable. That sounds like a downside. Incremental editing with multiple cursors is so much better than e.g. regex based find/replace or long vim commands because you get immediate feedback. If you make a mistake you just undo. You don't have to start again from scratch. With complex atomic editing operations it is painful to get them right because you only see the final output. Atomicity o…

Undo is just the letter u. With the concepts of text objects, boundaries and movement, making mistakes is not easy. Code is also structured which makes it easier to manipulate.

Atomicity here has a linguistic meaning. You know the basic operations, and you compose them to express a more complex ones. Like d is delete, and w is one word to the right, dw means delete one word to the right. di” (delete in) is delete the characters inside the quotes and da” (delete around) also deletes the quotes too.

Once you got the hang of the languages, editing, inserting and selecting text becomes as easy as thinking.

N.B. Normal mode is the default mode, not insert mode

Re: Advice to a novice programmer

#149
I'm from the school of thought that when teaching beginners, it is completely okay to make things as smooth and easy as possible. After all, the goal is not to teach students how to become efficient with development tools, but to teach computer science.

Back when I took data structures & algorithms in college, the course was thought in C. Every assignment / project would be something like this:

1) SSH into some school server, navigate to the correct folders via the shell/CL.

2) Copy the assignment / project to your own student folder. To solve the problem the student would have to get familiar with the (rather small) codebase.

3) Upload your own source files etc. when you've solved the problems, create a makefile, etc.

4) The TAs would the run some script which tested all the different programs.

Pretty straight forward process. But, still, the students that aced these were obviously those that were experienced with using a shell, navigating code, somewhat experienced with the dev ops side of things.

The kids that were very fresh to coding, and had only ever taken the "101 introduction to programming" course were like fish out of water. To such a degree that many could simply not focus on the actual problems. Especially the larger projects would essentially be as much "Advanced C" + "dev ops" as DS&A, which IMO kind of went against the purpose of the course.

With that regard, I think it would have been better to just make the students solve the problem in some IDE, or even web application sandbox, and focus 100% on the DS&A part.

Re: Advice to a novice programmer

#150

Earlier quoted context omitted.

> sure you can if you're comparing with Notepad++. But modern editors have multiple cursors Notepad++ has multiple cursors. Vim has "repeat last command", which is better.

Why is it better?

It is not just typing in multiple places, but executing a vim command in multiple places. Which means, you can replace the insides of a parenthesis with something, then proceed to do the same action on a different-length parenthesis, without actually typing the whole command again. While not getting confused by other parentheses inside the first one, because the i( adverb handles that. Similar with quoted strings, words, sentences, paragraphs, etc.

By "repeat last command", I meant repeating a single command with ., which can do simple things like pasting a string, deleting something, toggling case, incrementing an integer, and probably more stuff I don't use. Then there are macros which can repeat multiple commands, and are actually not much harder to use than the dot.

Another thing I like about the repeating approach is that you don't have to find all the places beforehand. You can target some of them with a regex, then remember to do more of them with another regex, then the rest, one-by-one by hand.

I used to think that typing in multiple places at once was cool, but now I wouldn't go back. Not even if other editors are catching up. Are they, by the way? I remember Notepad++ could not do much more than insert the same string in multiple places at once, but I confess, I have never used VS Code, Sublime, Atom, or really anything that popped up while I was in the vim rabbit hole. Am I missing out?

Post reply on HN