Live data from Hacker News

What I would do differently if I was learning to program again

reddit.com

61–70 of 85 posts

Re: What I would do differently if I was learning to program again

#61

Earlier quoted context omitted.

> My opinion, my real opinion, is that if you find yourself writing code 'for fun' even if you don't know what your doing, pursue it. The dirty secret of turning your hobby into a career is that there exists a very real chance you will kill your hobby and passion for the craft. Unfortunately, one can only deal with some much half-assed code and coworkers before turning into a cynic who hates the craft. I almost wish…

The dirtier secret is that if you turn something you dislike into a career, you won't get even the small consolation of liking it, and all the other problems will not go away.

> something you dislike

There's a continuum between "turning a like into career" and "turning a dislike into career" wherein I think there's probably a good balance. Indifference, much like ignorance, seems to be bliss among many folks in my line of work. Especially when you've got someone passionate to pick up the slack.

Re: What I would do differently if I was learning to program again

#62

Earlier quoted context omitted.

People are not sure what benefit is going to be provided to make up for the inferior text manipulation capabilities. I remember tab completion being a big thing. When I was a new programmer, I really wanted that stuff, for sure. But as I see it now, I find the cases where I don't remember the name of the function I want to call rarer, instead wondering about the undocumented things like "is this method thread-safe?",…

What inferior text manipulation capabilities?

Every IDE or text editor I have ever used had very limited text manipulation and navigation capabilities.

The only exceptions are VIM and Emacs (and editors that follow that spirit, like Neovim).

Vim especially has an entire language of text manipulation and navigation features. This language is made up of actions (like c for change or d for delete), Motions (like hjkl for left, up, down, right respectively) and Repetitions. These elements can be combined into very powerful commands, especially since there are a lot of Actions and Motions that can be performed. This is made possible by the Modal Editing[1] that Vim provides. You would simply type these commands in "Normal Mode" and then you would be dropped into "Insert Mode" if necessary.

At first this might seem very silly or inefficient, but after a while it becomes almost second nature and is more efficient then using the mouse or pressing Arrow Keys 100 times. Especially if combined with the Macro capabilities and the Search Commands.

Some examples of this language:

Navigate 10 lines up: 10k

Navigate 10 lines down: 10j

Go to the beginning of the next Method: ]m

Change the word under the cursor: cw

Change the paragraph under the Cursor: cip

Change the inside of "" pair under the Cursor: ci"

Change a pair of "" after the Cursor: ca"

Change the inside of {} pair under the Cursor: ci{

Visually select the text from the cursor until the 3rd occurrence of the character x going to the left without selecting the x: v3Tx

Same thing, but going right: v3tx

Same thing, but going to the right and selecting the x: v3fx

Same thing, but change instead of visual select: c3Tx

Same thing, but do a rot13 "encryption" after selecting: v3Txg?

[1]: https://unix.stackexchange.com/a/57708

Re: What I would do differently if I was learning to program again

#63
post #43

Earlier quoted context omitted.

Interesting. If I had to work with a pair or a team, as an introvert, I would find myself subtly withdrawing from active participation. I like live-coding, and I like active-listening (the latter is absorbing, hoping to understand and the former is testing/verifying/correcting/practicing your understanding, but I like absorbing or total-immersion personal practice. Group exercises get in the way of that (for me - aga…

Yes, learning styles have been debunked. The group work falls under the general rubric of "active learning". It's more structured and shorter (20 mins maybe) than the kind of project I was exposed to at school and University (which might have been 6 weeks long, for example.) I can't comment on your particular situation, as I don't know enough context, but in general there is an incredible amount of research on effect…

Thanks!

Re: What I would do differently if I was learning to program again

#64
post #32

Earlier quoted context omitted.

All my opinion, of course. I learned Python much better because I did not use an IDE. I've written Java and C# using IDEs. I barely remember anything about their standard libraries. Python, in comparison, I know like the back of my hand. Thanks to writing Python in vim, I had to reference the docs, and eventually memorized them. Like vim itself, it made for a steeper learning curve, but the productivity gains in the…

> I barely remember anything about their standard libraries. If an IDE can abstract that memorization away from you, what's the problem? The benefit I provide as a software developer is to solve business problems and provide value to the people that use my product. Knowing the optional third parameter to a string method I use once a month off the top of my head really doesn't help me with that as long as looking it u…

> If an IDE can abstract that memorization away from you, what's the problem?

It's more knowing what's available (do I have to use a 3rd party library for X task), and being able to fill in the parameters (as well as having those parameters ready) before the IDE prompts me for it.

Sure, pulling up the documentation isn't a huge chore in an IDE, but if I'm not prepared to give the third parameter a calculated length, I then have to go back and write more code before I can move forward.

It's also "how do metaclasses work" and "what types am I dealing with" and "how will this type be coerced in this situation" and "is monkey patching appropriate for testing this method".

Ultimately, it's about having sharp tools. My brain is a tool, and the more complete the picture of how a problem fits a programming language is, the more efficient I'll be at coming up with a working solution.

Re: What I would do differently if I was learning to program again

#65
post #59

Earlier quoted context omitted.

Why would anyone not want the power of an ide? Is it a Unix tough guy thing where there’s nothing that a GUI app does that you can’t do better in a terminal? Or is it that you’ve never really spent a lot of time in a professional ide so when you argue against it, it’s cause you don’t know?

Want to try the best of both worlds? Right now, you can experience ide-level autocompletion and type-checking in vim if you are working with typescript and have typescript-vim plugin. Just do one decent sized software with typescript+vim. Even intellij ides seem like bloated and inefficient software after that. PS: gvim is fine too. Easier copy to, and paste from clipboard.

Just to add to that: Vim has ide-level autocompletion and type-checking for many languages and not just typescript.

Re: What I would do differently if I was learning to program again

#66

Earlier quoted context omitted.

Vim keyboard bindings offer nowhere near the capabilities of a real Vim. They only offer the basics and never advanced vim features. Vim is so much more then just keybindings, it is more of a text manipulation language. There is only one exception to that and that is Emacs Evil mode. The other way around is much more likely: Vim plugins offer all those IDE features and integrate them seamless into vim and its way of…

I thought the same until recently and found the underlying java nonsense of an IDE to be slow, forever indexing. But due to work I had to use an IDE. Much to my surprise it was not slow. Plus I learn from it. I like the code errors showing and I like learning new things from the auto complete. I also like the plugins for database and Redis stores. Plus debugging is great. Give it a go and avoid modding down those tha…

I used plenty of IDEs (from free ones up to expensive enterprise IDEs) and I still prefer Vim. In fact I started with an enterprise Visual Studio when I first started programming and only years later switched to Vim.

Which IDE do you use now? I am willing to give it a try, but most likely I already have.

Vim can be configured to show code errors (by integrating linters, static code analysis or "just" by integrating the compiler, or doing all 3).

Vim can also be configured to do auto complete. Actually I have not found a IDE that can provide Python (which I use a lot) autocomplete better or up to the standard that vim has and I have not found a IDE that can provide autocomplete for so many different languages.

Database work and debugging is something I mostly just use specialized tools for and don't have a need to integrate that into my text editor. Sure it was nice to just click and have a break point on that line like I did in Visual Studio, but that isn't something I miss.

Also: What do you mean by "modding down"?

Re: What I would do differently if I was learning to program again

#67

Earlier quoted context omitted.

I just have IntelliJ configured to use Emacs key bindings; vi ones are also available for people who use the wrong text editor.

The default Emacs keybindings are nice, but do the semantics transfer (mark/point and associated manipulation functions), and can you write your own functions? I don't have a _ton_ of custom elisp functions for raw text manipulation, but the ones I have written are useful and I wouldn't just give those up for no reason. There are also a lot of dumb keybindings in Emacs that should not be copied by anyone (looking at…

The semantics are pretty good with the IDE I use most often, IntelliJ (for instance you definitely do have marks, there is a sensible kill-ring-like functionality for M-y, etc.). Writing a custom function is harder (I think you've got to write an extension, basically), but there are a lot of other useful things you can customize (making up your own templates, for instance). Also, the deeper understanding the IDE has of your code compared to Emacs lets it make many more useful suggestions for issues and potential refactors.

Re: What I would do differently if I was learning to program again

#68

Earlier quoted context omitted.

What inferior text manipulation capabilities?

Every IDE or text editor I have ever used had very limited text manipulation and navigation capabilities. The only exceptions are VIM and Emacs (and editors that follow that spirit, like Neovim). Vim especially has an entire language of text manipulation and navigation features. This language is made up of actions (like c for change or d for delete), Motions (like hjkl for left, up, down, right respectively) and Repe…

This stuff is all supported by IDEs, though. e.g., https://github.com/JetBrains/ideavim

Re: What I would do differently if I was learning to program again

#69

Earlier quoted context omitted.

What inferior text manipulation capabilities?

Every IDE or text editor I have ever used had very limited text manipulation and navigation capabilities. The only exceptions are VIM and Emacs (and editors that follow that spirit, like Neovim). Vim especially has an entire language of text manipulation and navigation features. This language is made up of actions (like c for change or d for delete), Motions (like hjkl for left, up, down, right respectively) and Repe…

Been doing all that happily for years with IdeaVIM. And still retaining access to the things that are nice in a graphical environment.

Re: What I would do differently if I was learning to program again

#70

Earlier quoted context omitted.

Why would anyone not want the power of an ide? Is it a Unix tough guy thing where there’s nothing that a GUI app does that you can’t do better in a terminal? Or is it that you’ve never really spent a lot of time in a professional ide so when you argue against it, it’s cause you don’t know?

I can't get the features of VIM in an IDE. I CAN get IDE features in VIM. I get syntax highlighting, Automatic Checks, Navigation based on Language structures. I even can integrate my shell and debuggers into VIM, but I don't use do that. I use those usually just as a stand alone tool. VIM and Emacs also have the absolute best git integration I have ever seen. Magit for emacs and Fugitive for Vim are absolutely fanta…

That's false though. You totally can get the features of vim in your IDE.
Post reply on HN