Live data from Hacker News

Advice to a novice programmer

blog.plover.com

121–130 of 158 posts

Re: Advice to a novice programmer

#121
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…

At university in the 1990's we had a short mandatory unix+emacs introduction as part of our first programming course. Maybe a few hours spread out over a week or two. Enough to get everyone started I think. Most of us ended up using it for everything after that and it was pretty much mandatory for some later courses (instructions assuming that you could use some REPL or such in emacs).

Not saying that it must be emacs and not some other editor, but it surprises me that any education does not include at least some introduction to how to use important tools like a code editor to getting work done.

Re: Advice to a novice programmer

#122

In wood shop in school, they teach you to use the saw, screwdriver, and tape measure before they say "make a box". Why not in programming shop?

As I mentioned elsewhere here, at university in the first undergraduate computer course we started out with a unix+emacs intro. It sounds unreasonable to me to just start out asking kids to write code without first showing them the tools they need?

Re: Advice to a novice programmer

#123

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 have tried, many times, I even have some plugins installed like git-gutter, etc.

It's not for me, thanks. I went back to Sublime Text and will only use vim in case of emergency, and only if I get paid for it.

Re: Advice to a novice programmer

#124

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.

can you go a full 8 hour work day without touching the mouse? edit: can you easily pipe the entire file through grep or awk, or insert the contents of the output of curl or jq?

Why would you want to keep your hands off the mouse?

Why do you think the mouse is slow?

Have you seen StarCraft players? They use the mouse and keyboard and perform an average of 200 actions per minute.

In fact, to select a certain piece of text, to get precisely to the end of what I want, the mouse is, most of the time, the fastest option.

I think the right idea is to use both, master them, and combine their strengths.

Re: Advice to a novice programmer

#125

Regarding variable names strongly consider keeping the first variable name which comes to your head. It is simple, straightforward. I often see overly elaborate variable names where I know the author took their time to come up with it ending up with an abstract variable name which makes far less sense. Another tip for novice programmers: don't do leet code or watch random videos which talk about loops and variable na…

Naming is still a hard problem :)

Re: Advice to a novice programmer

#126
I am a vim user, and I agree, start with whatever text editor is reasonable, vim is not at that stage, if you were doing intro to system administration, vim prowess would be advisable, but not for learning to program. Use vscode.

I think the advice are good, I'd like to add my own experience.. When I started programming, the hardest thing for me was : Understanding how to build the source code into a binary, and what parts were "code that became the executable" and "code that makes the executable be created"

Too much magic at the beginning is terrible, don't start with Makefiles or CMake.

Start with a one-liner that directly calls the compiler and linker.

When your one-liner gets too long, make it into a script.

When you consider doing things in your script with loops or conditionals: Now is the time for a Makefile.

When your project moves out of your compter and into a wider community, and people start being annoyed at your build process, look into CMake.

Also, stay away from anything that is cloud, anything you can't execute locally, it only adds extra abstractions and error scenarios.

Paradoxically, the first environment in which I found it easy to get my code executed was with Apache and PHP, but the underlying infrastructure was rather complex, and it didn't allow me to do real programming, I couldn't open new windows or call any graphics APIs, but it was useful for learning algorithms and "thinking like a programmer".

Re: Advice to a novice programmer

#127

Speaking of using sharp tools…. I really don’t get the love for VSCode. I’ve used Jetbrains for years and last week gave VSCode a really solid try. Man what a mess. Everything is a plug-in, plug-ins are inconsistent, getting basic things to work requires a tsunami of plugins. Everything feels half baked and duplicated and needing updates or abandoned ugh. Nothing feels professional because everything is a plug-in bui…

i tried Goland (the Jetbrains IDE for Go) and when my mouse hovers over a variable the IDE does not provide a tool tip that tells me what its type is. And for that reason I've stuck with VS Code.

This is simply not true. I have been using Goland since the first beta and can remember this feature being in there and using since then.

Re: Advice to a novice programmer

#128

Earlier quoted context omitted.

Everyone going to trade schools is just as stupid a line of thinking as everyone going to college, and yet I hear the former now all the time.

What if we combined universities and trade schools then we kill two birds with one stone.

That’s already happening in many cases as universities launch their own clock hour programs.

Re: Advice to a novice programmer

#129
post #105

Earlier quoted context omitted.

What does vim lack that one might need to complete a basic programming assignment?

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.
Post reply on HN