Ask HN: Should I invest time on mastering the command line or the Jetbrains IDE?
I reckon that I have two options: -Try to master the Unix command line and a terminal based editor (Vim or Emacs). -Try to master the Jetbrains IDEs (all of them are equal, so if you know Intellij tricks, you know how to use PyCharm).
Please don't tell me other options because I'm already overwhelmed with having to choose between these two :P
And I think that both are excellent options, and there is no univesal answer but...
Could you, as master developers, give me a piece of advice? I've been coding for 2 years now, but I'm still uber noob.
Maybe Vim is a thing of the past? Maybe Vim is more useful to learn because it will always remain (it will always be installed on any Unix OS)?
Thank you very much! I have been reading HN for years (specially the comments), I really appreciate your opinion. I have just signed up to ask this question.
90 comments
[ 2.9 ms ] story [ 154 ms ] threadHowever, I'm pretty slow at translating my thoughts to code. Not only because I have much to learn, but also because I don't master the tools that we programmers use to write our thoughts. I mean, sometimes I have the code on my mind, or I know what should I (for example, debugging a particular function), but I'm so slow at doing it.
A friend of mine has used Intellij IDEA since he was a teen and he can do incredible things. He can refactor a class in seconds. He can find extremely fast a particular bug by debugging step by step. I also know people (older than me, by the way) that master vim, and they say that thanks to it they have experimented a huge productivity boost.
I'm afraid that if I invest time on understanding Vim, I will be investing to much time on the tool itself (which is not the end, but the mean), instead of focusing on learning algorithms and programming skills. But I really don't know.
Also, this could also influence my decision on which computer should I buy. With Vim/Emacs it's ok to have a light notebook (portable, with great battery, but no powerful), while if I choose the Jetbrains way, I should definitely buy a powerful computer.
(by the way, sorry for my English, I'm not good at languages)
Not really. He can only extract some variables from a class, move methods around, and rename things. That's all. That's still just text editing.
> He can find extremely fast a particular bug by debugging step by step.
He'll probably be hopelessly lost when he starts writing anything network-related, when stepping through code is not an option due to timeouts.
> I'm afraid that if I invest time on understanding Vim, I will be investing to much time on the tool itself (which is not the end, but the mean), instead of focusing on learning algorithms and programming skills.
Then don't. Stay with your Sublime. Don't masturbate over tools, since they cannot make your code better by an order of magnitude. When you're comfortable with the programming language of your choice, you'll know that you're ready to learn tooling.
For you at this point, sticking to text editor and command line tools may be the better option. You are exposed to how compilers are called and how things are being built, so you know it's nothing magic. I've seen people who started with IDEs for Java and never learned that there are operations beside F5 [run] and F9 [compile], e.g. that Java program can be packed up to a JAR and run from there, or that some source files can be generated before compilation.
However, while it's true that some programmers are (too) locked in their IDE, maybe this allow them to focus on the code itself, in a more abstract way.
But make sure that promise to yourself to learn the command line does not go forgotten! It IS important, and knowing how to use something like VIM, even at only a basic level, WILL help you.
Powerful contextual-search-and-replace. Refactoring is a deeper change than just moving things around.
I understand that with Vim I will be able to quickly find and replace words, but I will never be able to truly refactor, because it requires powerful code analysis that only an IDE can do and a Vim plugin can't.
What IDEs offer is just moving some bits around, the ones that can be tied mechanically together. It's nowhere near real refactorization. Handy, but not that much, if you think about your code in advance.
In the end, you'll need to involve your brain anyway, but the IDE makes the menial work easier.
https://www.jetbrains.com/help/idea/2016.3/refactoring-sourc...
https://www.jetbrains.com/help/idea/2016.3/refactoring-sourc...
From Wikipedia [1]: "Code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behaviour. Refactoring improves nonfunctional attributes of the software. Advantages include improved code readability and reduced complexity; these can improve source-code maintainability and create a more expressive internal architecture or object model to improve extensibility. Typically, refactoring applies a series of standardised basic micro-refactorings, each of which is (usually) a tiny change in a computer program's source code that either preserves the behaviour of the software, or at least does not modify its conformance to functional requirements."
"Many software editors and IDEs have automated refactoring support." Listed is Jetbrains IntelliJ IDEA.
The IDE can do the micro-refactorings but I agree that (at least today) there needs to be a programmer to decide which micro-refactorings should be done to improve the code.
[1] https://en.wikipedia.org/wiki/Code_refactoring
So, I should definitely learn both, but start with the IDE way, because it's easier.
I use Sublime 80% of the time and Vim the rest. Certain things like refactoring across files and multi-file find and replace I can just do so much faster in Sublime.
I also use Tower over the command line git client to make advanced things much faster (and not require a Google search).
I know that I should try both, but which should I start with first? Because in order to be able to really try a tool such as Vim, I reckon that you have to spend at leat several months. So maybe the order is important.
I would stay start with whichever has a lower upfront learning curve, which in most cases means the GUI.
I'm biased of course, but toward something that tends to allow me to reduce cognitive load in a place that doesn't matter. I get Emacs like bindings for writing and editing this comment.
That said, learning Emacs means losing a bit of productivity for a bit of time. It also means continuing to learn for a long time. It might be years before rectangular editing mode becomes natural or creating and destroying abbreviations on the fly is a matter of habit...or looking up documentation in the documentation rather than Googling for it. But every little bit tends to pay off.
I don't have anything against Vim. It does what it does well. It just doesn't do as much and sometimes the Unix design principle of only doing one thing isn't what I want...turing machines, compilers, laptops, web browsers are all examples.
Anyway, it's just my random advice from the internet.
Good luck.
I haven't decided if I will try to learn Vim or Emacs, yet. I'm still in a previous phase: should I prioritize improving my command line/terminal editors skills or mastering the Jetbrains set of IDEs?
I know that you can use both Emacs and Vim bindings on Intellij IDEA (and on many other programs). However, at this point I really can't take both (Emacs and an IDE), because I'm a beginner and I can't learn everything at the same time.
But I take your advice. I have to admit that I was a bit biased against Emacs, but if follow the "terminal way", I will definitely give it a try.
To me the best thing a beginner can do is to recognize that being a beginner means not being in a position to make expert judgments. Learning both Emacs and IntelliJ along side the command line allows each process to inform the other. Not learning Emacs and the command line does not mean that you will learn IntelliJ much more deeply or quickly. It's going to take considerable time no matter what. Learning other things along side it will provide context for judging what IntelliJ offers.
This is akin to trying to shave milliseconds off of your 100m sprint by carefully choosing aerodynamic clothes and running shoes when your time is 20 seconds. Nobody should worry about that until they're under 10 seconds. In that case, the problem isn't the shoes, it's probably the 40 pounds of fat the beginner runner is packing and should deal with first.
Worrying about productivity at this stage is a 10 year old wondering about the best way to shave his beard.. He just doesn't have that problem yet and should be doing something else..
It's pretty hard for a beginner to get started and the amount of tools is overwhelming and could be distracting from what the beginner should actually be doing, which is reading and writing code.
I'm telling you this because I'm a textbook case of this kind of "Oooh, I want to learn X.. What's the best book?" and the spend a year looking for the best book to learn X, instead of spending that year actually learning X.
I wasn't like this when I was a child. I had a computer, it had something called BASIC. I didn't understand a word of English. I looked words in a dictionary and guessed the most part, copied code examples, ran them, changed stuff, deduced the role of each from the side effects, and just started doing it. Children are like that, they get stuff done. They're great hackers. When we grow up, we start trying to be "clever" about things and doing it "smartly" and get stupid in the process getting less done and learning less.
>Try to master the Unix command line and a terminal based editor
About that.. http://xkcd.com/1168/
I think it'd be more productive for you to know enough to get you comfortable and know your way around it as soon as possible: yak shaving is never the point unless you're trying to unwind in which case, shaving animals can be.. relaxing.
Here's something to get you started but just that:
https://learnpythonthehardway.org/book/appendixa.html
Here's the most pertinent advice I could give you: Get internships. You probably live in a country that actually has software companies where people rely on software for most things.. Get internships at these companies. Real life experience, with real developers and real problems to learn the stuff you can't find elsewhere. Internships.
Also, side projects and reading code.
You think you're slow and a noob? I'm 29 and have been coding for 20 years on and off and I'm still a noob who can't code to save his life. I'm the slow guy here, not you!
All the best!
Maybe my original post focused too much on productivity. It's very true that it makes no sense to be worried about these things when I'm still a beginner.
However:
"It's pretty hard for a beginner to get started and the amount of tools is overwhelming and could be distracting from what the beginner should actually be doing, which is reading and writing code."
Ok, but, I still have to use some tools in order to be able to read and write code. And it's not neutral. Put it this way: should I code and read code with the command line + Vim/Emacs or with IDEs ala Jetbrains? I mean, in my original question, replace "productivity" with "ease of coding learning". I must focus on learning how to code, but: -If I do it with Vim/terminal, maybe I focus on the tool instead of the code itself. -If I do it with a powerful IDE, maybe I can't learn the basics properly.
I don't know if I'm being clear enough (English is not my native language and I'm bad at languages).
I will definitely try to get as many internships as possible. However, it's difficult for me to get the first one, because they look if you have had any experience before, and of course I haven't. I just need the first one to demonstrate that I can be a good intern.
People don't learn to use a screwdriver to the exception of wrenches; soldiers don't learn to use pistols to the exception of rifles; surgeons don't learn to use scalpels to the exception of forceps. It's not realistic, so using one will not seal your fate.
I think the reason it may be causing you trouble is that you think learning these tools is hard which makes you think you have to manage resources and make tradeoffs. It's hard to study Engineering and Medicine because the time commitment and effort for each almost make them mutually exclusive simultaneously, and rarely done sequentially.
The good news is that learning CLI/IDE is not hard. The fact it's not hard is also the bad news, because the hardest is yet to come. This is similar to a person finding learning the alphabet of a language hard when it's just the apéritif.
The reality is that you can learn about 80% of what you will be doing in the CLI in less than an hour. The remaining 20% will take you 40 years or something (well, you find people on Stack Overflow who know so much about these editors and tools, that the only technical question your ask yourself is which one they've used to draft the contract with the Devil).
As in most things, few things are used the most. The number of words you know is the millions; the number of words you actively use is more in the tens of thousands. The number of biomechanically possible movements is important, the number of movements we end up doing daily is less impressive.
My point is: neither constitutes that big of an investment, and you will end up using different ones anyway, so don't worry about it. I wouldn't hold my breath if you were to look for someone who's used a tool exclusively.
The command line by itself is an old-school text editor, where the default behavior is to write programs that are executed then immediately thrown away [1]. We develop a habit of using the command line in a casual way, without realizing that it's a powerful programming environment.
Once we realize that we're _programming_ with the command line, we can take deliberate steps to write better command line programs. We can:
* learn how to capture our programs and execute them again later. * learn how to improve our programs using the edit -> execute workflow. * learn more about the commands and their options so that we can write more powerful programs * learn how to make our programs play well with other commands
Note that I'm deliberately avoiding recommending a specific editor or programming language for your workflow. You can choose whatever works best for you. Instead I'd like to leave you with this thought:
Always. Be. Programing.Always be programming! [2]
Treat every command like a program you intend to keep, and you'll start writing better and better commands; commands that you'll reuse, that will automate your workflow, that will help you spend your precious mental energy on thinking about how to solve important problems because you've delegated as much of the tedious grunt work to the computer as you possibly can.
Best of luck, and enjoy the journey!
[1] This is not strictly true but is useful as a starting point for this thought exercise. See the history command, for example.
[2] (Since it's Christmas) https://www.youtube.com/watch?v=J_vSirIJEsY
[1] I know you probably don't mean only that sort of thing, there are bigger automations that can be done too, and have done those a lot too.
Edit: a useful thumb rule - picked up years ago, IIRC, from the book The Unix Programming Environment by Kernighan and Pike, is to observe your own use of a command a few times, and then if you find yourself using it enough in a certain pattern, automate that via a script, with suitable parameters, etc.
Could be something as simple as 'ltr' for 'ls -ltr' (with suitable changes to make it a script or a shell alias). In fact, many Unixes come with such an alias - 'll' for 'ls -l', because that command - 'ls -l' is typed so often in Unix.
I've already automated some tasks. However, I find it difficult to write useful bash commands that I will reuse later. Maybe I should learn a scripting programming language.
Try to avoid "pre-judging" the usefulness of scripts. As another commented mentioned, something as simple as:
may be useful to you. It also helps establish the habit of editing (saving) the script before you execute it.So just write some scripts and see if you use them again. You will probably end up with too many, but that's ok, because you can remove the unnecessary ones later, and you'll have gotten extra practice creating the scripts in the first place.
> Maybe I should learn a scripting programming language.
That's really your preference based on your need for portability (i.e. minimizing the dependencies required to run the script.) Using Python or Perl is perfectly fine for these scripts, but they do require that the system has one of those languages installed. If you're doing a lot of work on machines that you do not administer, it's more likely that Bash is already there.
When coding, I prefer an IDE or editor of my choice with autocomplete, syntax highlighting and auto-format.
The command line I see more of an alternative to the window manager. Depending on the type of software CLI(web-server) or GUI(image manipulator) is the way to go.
I recommend you take a look at the list of available packages: https://github.com/termux/termux-packages/tree/master/packag...
clang, git, emacs, vim, go, erlang, ssh,...
But it won't replace your main laptop.
In terms of CLI, for me, I am thorn. I used vim+tmux+zsh for few years, and 2016's New Year's Resolution was to use Emacs and write Lisp. And I did. Emacs grew on me very fast, and now I am using it for 75% of time as my main text editor, but from time to time, I jump into Vim to skim source code or do some little edit, since vim feels to me much more natural in terminal environment. (Emacs is beast on it's own, where you launch terminal inside Emacs).
So, I think everything is matter of taste. Nothing will make you better programmer than programming and thinking. But for example Emacs was amazing introduction into Lisp for me, since I learned a lot just by playing with emacs and understanding how it works.
So my final recommendation. Install IDE's. If you have some project or homework, do it in them. In your free time, install Linux/macOS/*BSD, tweak system to your liking, install zsh/fish, write a little bit of bash, use git inside it, and you will gradually notice how you are becoming more and more comfortable around it. Until the point where you spin your terminal in full screen and use it for everything, from file searching and managing to programming.
The answer depends on the programming language which you have chosen to use at this stage of your learning process. Each language has its own community, and in some of those communities, IDEs predominate. In others, it is CLI tools.
If you use the tools which are dominant in your community, reading books, blog posts, and StackOverflow answers will be easier. Pairing with other programmers will be easier. You will be able to watch screencasts and apply the tricks which you see. And so on...
There was a swift support in emacs on day one when the language was announced.
An IDE will be faster to pick up, and will take less time to customize. Command line skills are better for automating more and scripting more, but have a steeper learning curve.
Only you know which is a higher priority for yourself. Personally, I started with an IDE and then eased myself into command line once I had a solid grasp over coding.
Terminal based ones are very good :
- when you are working on REPL environments.
- small/short programs not involving lot of modules
- when you are learning or trying to learn a language/toolkit/framework
- training yourself for minimum tooling work experience.
IDEs are very good :
- when you are preparing to work on large projects with loads of modules
- when collaboration is more important than learning with insistence of a shared dev eco-system
- to quickly complete boiler plates & refactor larger artifacts
- when you are focused on making not only yourself but a whole team with varying levels of skills productive.
- when working with IDEs is actually productive for a given ecosystem.
The above are not complete but an average approximation of experience i've gained so far. The last point is where experience from someone using a given IDE for a given ecosystem really matters.Some of the IDEs might at times make it counter productive , e.g. in new languages with new IDE features might have a rather slow unproductive experience. I have experience with IDEs (JBs too) when refactoring something in a new plugin or a language,when an IDE would just hang!
Personally, I learned command line first, and I think its the better way to go overall, since IDEs like JetBrains run the same stuff under the hood, so it will be easier to pick up since you know what's going on better.
It's like when you see a non-tech-savvy user slowly mousing around instead of keyboard shortcuts -- that's how I feel watching non-Vim users edit text. So Vim is orthogonal to your other choices. You should get around to playing with it purely as a way to edit text properly. http://vim-adventures.com/ is a great fun way to start to get Vim powers.
I'm not some old Vim user - I only picked it up a couple years ago to see what the fuss was about. I installed it into Visual Studio and left it in insert mode most of the time, then slowly got more powerful over time. Do the same with IntelliJ: https://www.jetbrains.com/help/idea/2016.2/tutorial-using-in....
Edit: As to your actual question, for what it's worth I started with the high-level stuff. Both in languages and tooling. The key is to always be curious about the lower levels, and work over time to understand them and move down the stack to fully understand your tools.
It'd be great if there was a proper survey or study on developer effectiveness vs if they learned top-down or bottom-up.
On the other hand, I guess someone reading HN is rather likely of the kind that likes to open the lid and find out how things work.
I did my programming (various languages) in vim for several years, after that in TextMate on OSX and now mostly in IntelliJ IDEA (well, and still TextMate).
While I use the terminal the entire day for various commands and tools, I seldomly do any text-editing in it anymore.
I don't miss vim one bit, I wouldn't recommend anyone to learn it. If you have OSX look at TextMate, you can script and "power-use" it too.
On curiosity: I was a graduate student in CS and TA'd a lot of courses and now I do a bunch of interviewing at my current job. One of the things that I often find lacking is curiosity. Someone kinda knows "if I put it in this shape, things seem to work." They don't care how it works or what kind of trade-offs might be made. Worse, they often have somewhat magical thinking. Algorithms can be clever, complex, etc., but they can't be magical. I'll give you a more concrete example. A co-worker wanted to make a column in our database searchable by sub-strings (so that a search for "idea" would match something like "IntelliJ IDEA"). They knew that indexes "made looking over a column in a database fast", but never had the curiosity to know how it made it fast. Of course, indexes (generally) are just a sorted data-structure so looking for something not at the beginning doesn't really work. The point of this is to say that curiosity is definitely your best weapon. While others are guessing or finding incantations that "work" (though they might not completely understand why), you can understand why something works or why something won't be a solution (even if it's functionally correct and "works fine" on small data sets).
On grit: often times, you can get to a point where it feels like "I'm nearly there." You then decide to reward yourself with a little kick-back time only to come back to that piece of code and realize that you weren't nearly there. I'm not suggesting that you don't take breaks or that breaks can't be helpful. However, there's a lot to be said about gritting it out and getting through a chunk that might be hard. Often times, something can look like it will work, but then doesn't. Code can be hard and defeating at times, but having the grit to power through some of the hard times can be invaluable.
On reading code: if you want to do serious development, you're going to have to read code more often than you'll write it. Documentation and comments become out-of-date, libraries can be poorly documented, and Stack Overflow won't help you with internal company code. It's easy to fall into the trap of feeling that you're very good at writing code without being able to read it well. Not being able to read code will mean that you're a lot less productive and that you're always leaning on someone else for help. It also means that you're more likely to make mistakes in your development. Reading code is a hard skill. Writing code, you just yourself and the compiler to care about. Reading code, you have to care about the compiler, the other person, and potentially years of changes to the code that have built up little nuances. But it isn't an intractable problem. You can do it and you'll become more productive and
In terms of your specific question, I think you'll learn tooling as you go along. Don't get too obsessed with tooling - it's an easy trap to fall into thinking that you'll finally be productive when you have the right setup. Also don't worry about mastering them. Build something with the tools and you'll naturally find new, useful things. An important thing to remember is that it often doesn't matter if someone knows a way of writing a small piece of code twice as fast if they spend weeks googling how to write it twice as fast, worry about things that don't matter, etc. If it takes you 20 minutes to write it and it takes them 10 minutes after a week of not getting anything done, you've moved on to way better things.
Personally, I wouldn't code in a language like Java without a good IDE. A good IDE will basically write the boring parts of code for you. More importantly, it lets you use libraries without so much googling. I can do `varName.` and Intelli...
For example, I like the *NIX command line very much, just because I can quickly improvise (at least temporary) solutions for a specific problem. This doesn't mean that it is a silver bullet, but it's helpful to know your way around it, and without some curiosity, I would never have tried it.
Also: You dont have to be an expert - you'll get good at the things you use most, which should be those that you enjoy working with. If it doesn't "click", you'll find something else that suits you. Sometimes it's just useful to have tried something for a day or two - even Vim becomes quite usable after a couple of hours of figuring out the basic control scheme.
Oh, and also: It's not unlikely the tooling you use will change over time, so clinging to a specific IDE is not necessarily going to help you. Maybe you'll work at a place that only allows certain software on some systems. In which case, knowing your way around the basic system (Bash, Windows CMD/Powershell) will almost certainly be really helpful at some point. So just try to be open for new things :)
I gained knowledge of the command line about 3 decades ago. It's been useful for all that time, and I expect it to be useful for at least the next 20 years, too (assuming I'm still around). That's a span of half a century; seems like a good long-term investment.
I also learned many different development environments; they were very useful, too, but they had a much shorter half-life. At one time I could read source code by reading the pattern of holes in a punched paper tape; very useful for "mastery" of DEC PDP-8 development, not so useful now.
So both command-line and IDE are good things to learn, but in terms of "mastering," it might be good to save that for the command line. I would say definitely learn the IDE, but only enough to get things done with it and to get general knowledge of how IDEs work. Detailed knowledge of every last option, bell, and whistle in one particular IDE may be of limited long-term usefulness.
Plenty of people use vim still, and gain a lot of productivity out of it, as others have said here and elsewhere. But it takes time to learn it well enough to get the full benefit. You can learn it incrementally, though and realize benefits as you go along. In fact you can even start with vi, the predecessor to vim (which stands for VI iMproved); vi is quite powerful in its own right (though vim is more), and may be somewhat more universally available than vim (not sure of that last point these days). Anyway, vi's commands wil be mostly a subset of vim's, so any learning of vi will transfer to vim too.
Might want to check out my really basic [1] vi quickstart tutorial for that. It can be read in under 10 to 20 minutes, and you can start applying it right away. I first wrote it for a couple of friends, who were Windows sysadmins in the company where I worked at the time. They tried it and soon after told me it helped them to get up to speed with the basics of vi quickly (they had been given additional responsibility of a few Unix boxes, so needed to know vi - this was before vim was well-known). I later published it as an article in Linux For You (now Open Source For You), an Indian print-format computer magazine.
[1] There are many vi/vim tutorials that are more advanced and cover more than mine. Also, some of them cover vi/vim in a way that really gives the true power, one key such area being understanding different cursor movement commands and text changing commands, and how to combine the two sets together (basically, the Cartesian product of them is mostly possible) to achieve larger / faster editing effects. But mine was purposely kept simple and does not cover that, so you can get started faster with vi using it - since you said (and other commenters advised) that you do not want to spend a lot of time on tools instead of actual programming, which makes sense. You can still read those other vi/vim tutorials later whenever you are ready.
You can get the vi tutorial from here (for free):
https://gumroad.com/l/vi_quick
Vim itself is useful if you have to do anything on the command line and once you learn the basics you'll ditch pico and all the others and never look back for doing any non-trivial editing.
Extending vim (or emacs) is largely the trick - you need the right plugins to support the type of things you're working on - go to github and search for vim config and you'll find 8,050 repos with peoples favorite setups, often with instructional videos or text.
Certain programming jobs are legitimately faster with vim and the right plugins, others, especially if you're working in a team environment that uses an IDE are obviously better with an IDE.
A friend was in your shoes a few years back (young, starting out) became a vim guru, aced a job interview now writes java/clojure with IntelliJ as does the rest of his team. I asked him, he is super glad he learned vim so well but can't imagine working on his current codebase with it, but he still uses vim regularly and often.
And I liked vram22's comment about automation. I learned it as '3 or more use a for' which has boiled out to if you find yourself doing something 3 or more times, think of a way to abstract or automate it.
Thanks.
>I learned it as '3 or more use a for'
Nice mnemonic way of putting it, hearing it for the first time :)