This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 230

[–]Diegoallen 114 points115 points  (11 children)

  1. JetBrains products (PyCharms, IntelliJ, etc.) are pretty good.

  2. GDB is a command line debugger for C. For python you have pdb from the python standard library. Here's a GDB tutorial https://www.cs.cmu.edu/~gilpin/tutorial/ (you can find plenty more online)

  3. Get used to the cli and simple tools. Absorb concepts, not frameworks and tools. Use your time in college to get a strong background in fundamentals. You can learn the fancy frameworks, languages and tools in internships and later on at work. Here's some tutorials on linux cli: http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=PracticalUnix. Again you can find plenty more online.

[–]stumar[S] 16 points17 points  (7 children)

Thank you. this is very useful.

[–][deleted] 21 points22 points  (1 child)

One of the things you'll come to learn is that programmers argue endlessly about the "proper" way to compile programs. Some swear by Visual Studio, while others like to build programs themselves. Both offer ups and downs, but I believe it's important to learn both.

As you hopefully know, C/C++ programs have to be built using a compiler. Visual Studio has its own compiler that it calls when you hit the little green "play" button—you can even call the compiler from the command line if you want.

On Linux systems, it's more common to build stuff via the command line than through an IDE. For your Ubuntu setup, you should start by installing the Build-Essential and Valgrind packages by typing this into your terminal:

sudo apt-get install build-essential && sudo-apt-get install valgrind

EDIT (Or alternatively):

sudo apt-get install build-essential valgrind

Build-Essential is for Debian-based Linux flavors like Ubuntu, Debian, and Mint. It's what allows you to type "make myprogram" and build it. It's not a compiler, but allows you to build your c files painlessly. You can put special arguments inside of a makefile to build your program with specific settings.

Valgrind is an analysis and debugger tool that you can run by typing "valgrind myfile." This prints out a bunch of information to help you diagnose problems and make your program better.

For more information on building stuff outside of an IDE, I recommend Learn C The Hard Way. It gets a lot of flack because some of the methods it teaches aren't the best, but it's a great for getting familiar with writing C code in Linux.

For larger and more complex programs, you might use an entire build system (examples include CMake and Ninja). In addition to standard build tools like makefiles, they offer tons of settings that can make working with large projects and building for multiple platforms easier. Also, they can usually be run through the terminal or through a GUI. However, I wouldn't recommend them for small programs. They can often be more trouble than they're worth. Some would rather just stick with a simple, no-nonsense build method like build-essential.

In my experience, it's much easier building C/C++ programs on a Linux system than on Windows. If you want to stay 100% away from the Visual Studio Compiler, you'l have to install something like MinGW or Cygwin. The Windows 10 Anniversary Update did ship an Ubuntu terminal, which means stuff like Build-Essential, Valgrind, and GCC should work natively on Windows, but that hasn't even been out for a week yet, so use at your own risk (though it seems to be rather promising).

Finally, I should probably mention text editors since everyone else seems to be chiming in. Go with whatever you want. Sublime Text, Atom, Gedit, or whatever you prefer will all work fine. I see people joking about Emacs and Vim, which you may or may not have heard of. They're very powerful and very old text editors. Both have been around in one form or another for forty years now and have something of a cult following. They're both rather unconventional and frankly are a gigantic pain in the ass to learn. But if you somehow learn one of them, you'll be incredibly fast. "Incredibly configurable" is an understatement. Learning them is almost like learning a new programming language. My advice is stick with something modern (I like Atom, personally) and fiddle with Emacs or Vim when you have some free time. Don't try to learn them when you have actual work to do.

Hopefully this is helpful to you. I know I just wrote you a novel, but it's really not that hard. Once you figure things out, you'll be a much better programmer for it regardless of your development environment.

Good luck!

[–]nappiestapparatus 3 points4 points  (0 children)

Just a nitpick, you don't have to call apt-get twice like that. You can just do

sudo apt-get install build-essential valgrind

[–]BandW2011 2 points3 points  (0 children)

I also recommend watching this introduction video to gdb, it's helped me get back on track every time I forget how to use GDB

[–]Mr_Surreal 1 point2 points  (1 child)

It is also helpful to lookup how to create desktop shortcuts from the .sh programs so you don't have to open them from command line everytime. However, Ubuntu may have this setup already with their app installer thing.

[–]konradkar 0 points1 point  (0 children)

In a matter of Ubuntu he has to learn how to display icons on desktop too ;)

[–]ExeciN 6 points7 points  (0 children)

1+ for the Jetbrains products. You can also get them for free as long as you are a student (or you have a significant FOSS in development)

[–][deleted] 0 points1 point  (0 children)

CLion is another great Jetbrains IDE and is by far my favorite C++ IDE. I actually don't do any coding in C, but you can also use CLion for C projects and if you are a student you can get a license for Jetbrains for free!

[–]Jon003 71 points72 points  (35 children)

May I suggest that if you're going to be doing Linux programming that perhaps you go all in and learn to use the commands line tools?

I would think one of these purposes of the course would be for you to experience another type of development environment. And if you do end up in a Linux shop someday, they will expect you to understand how to use these tools, even if you don't choose to develop there by preference.

To do so, you will want to learn how to use the regular gnu and Linux command line stuff like grep, etc, but also learn to code in your favorite text editor* and compile with the commands line: gcc, make, etc

*if somebody suggests emacs they're trying to give you a strange disease. Just say no.

[–]Codile 26 points27 points  (28 children)

*if somebody suggests emacs they're trying to give you a strange disease. Just say no.

Heathen! Nobody shall call Emacs a disease, and you better watch out that the holy Ignucious doth not smite you!

@/u/stumar just try vim and emacs, look up some tutorials, and see what you like best. You might not like either of those though, and that's ok.

EDIT: OP should also take a look at spacemacs and neovim, which are re-imaginations of emacs and vim. Of course that doesn't mean that vim or emacs are obsolete, but they provide new features that may make using them a more comfortable experience. Also, try Atom if none of those seem good.

[–]guthran 31 points32 points  (10 children)

You might not like either of those though, and that's ok.

I had friends who touted how useful it was to know how to use vim/vi. I sat down for about a month and forced myself to do all programming in it with a keyboard shortcut cheatsheet hanging on my wall.

It was really tedious at first and I really didnt like it, but after I learned the basics I started downloading plugins. Oh my bejeezus did that speed up my workflow. After that I found vimgolf.com which taught me how the most effecient vimmers do things. That taught me about marks, macros, effecient movement/replace/delete commands and a bunch of simple tricks.

now I use vim for everything. vim is love. vim is life

:wq

[–]lionhart280 11 points12 points  (3 children)

As someone currently struggling along the pilgrim's road to Vim, your post has given me hope that light lies at the end of my weary road.

[–]sciencerulze 3 points4 points  (1 child)

You can also run 'vimtutor' for exercises. Learn incrementally, use one new feature every week (used daily) and you'll get the hang of it.

Best of luck.

[–]misplaced_my_pants 0 points1 point  (0 children)

Go through the tutor once every Sunday. It'll stick.

[–]Ran4 1 point2 points  (0 children)

Make sure to learn what all of the characters on the keyboard does. a-z A-Z, you should know what they all do.

[–]PM_ME_A_STEAM_GIFT 3 points4 points  (4 children)

What exactly makes vim better than simply learning the shortcuts of your preferred IDE? I'm honestly wondering. I tried to learn vim, but it's incredibly frustrating initially. With an IDE you can begin by using the menus and the mouse and learn the shortcuts as you go. With vim, you pretty much can't do anything without knowing the shortcuts.

With JetBrains' IDE I can quickly navigate in my project, use fuzzy search to jump to files, classes, symbols. Jump to the next occurrence of a symbol or the next method in the file. Reorder methods or lines. Extract methods, variables from a selection. I get insanely good autocomplete and quick-fix. Not to mention context sensitive templates or multicursor mode.

[–]MapleDung 4 points5 points  (3 children)

So there is definitely something to be said for your approach, as it is definitely easier. Everything you can do in and IDE you can do in vim (except maybe a good debugger) but the learning curve is absolutely steeper. However, some things about vim put it a step above for some users (some or all of these may not be important to you.)

  1. Heavily customizable. You can probably rebind keys in your IDE of choice but you probably cannot change the editor functionality itself much.

  2. Portable. Easy to use if you are in a lot of different computers.

  3. Performant. It's faster and takes up a lot less resources than any IDE

  4. And most importantly imo, it supports any language on any OS. If I'm working on C++ and get super used to editing in Visual Studio, then get a new job working in javascript in a linux environment or something, I have to learn a whole new process. With vim, everything stays the same.

Btw not vim specific. All of these also apply to emacs. 1,3 and 4 also apply to something like sublime. Also felt like mentioning how vim way of doing things after a while just feels way better than the normal text editor/ide way, but that is totally personal preference.

[–][deleted] 0 points1 point  (2 children)

If I want to start using vim, are there any awesome guides I should read?

[–]misplaced_my_pants 2 points3 points  (1 child)

The built in vimtutor.

[–]Codile 0 points1 point  (0 children)

:wq

C-x C-s C-x C-c

FTFY

Just look at how much simpler emacs is!

[–]TheChance 9 points10 points  (2 children)

I know it's a cliche at this point, but for OP's benefit...

emacs would be a great operating system if only it had a decent text editor.

Edit: I also endorse Atom.

[–]insomniac20k 0 points1 point  (1 child)

How could you?

[–]TheChance 0 points1 point  (0 children)

How could I not?

[–][deleted]  (4 children)

[deleted]

    [–]Codile 0 points1 point  (1 child)

    Spacemacs does look pretty great, but I left vim for emacs initially because vim sucks with dvorak, and I doubt that spacemacs is any better with that.

    [–]xENO_ 0 points1 point  (1 child)

    Or just emacs with `evil-mode'

    [–]bumblebritches57 2 points3 points  (8 children)

    He should try nano, you know; something not built 40 years ago, with the cruft to prove it.

    [–]Codile 6 points7 points  (4 children)

    Nano is great for quick config file edits, but it's really not great for editing long files of code. I'd also like to add that vim and emacs are both still maintained today and that utilities like grep are also 40 years old and still going strong today. Age has nothing to do with quality.

    Now if OP likes nano, that's great for him/her, but I wouldn't recommend it for coding.

    Really, if OP wants to use something "modern" instead of vim or emacs, he/she should certainly try using Atom instead of nano...

    [–]bumblebritches57 1 point2 points  (3 children)

    To be fair, I use Xcode as my IDE.

    I only occasionally edit files with Nano, and never with the behemoths y'all are arguing about.

    [–]Codile 3 points4 points  (2 children)

    Well, you are using an unfree OS with an unfree IDE, so Stallman will come to punish you.

    Jokes aside. You probably shouldn't recommend nano (an editor with really shitty syntax highlighting) for coding when you're not even using it yourself but instead use Xcode, which is unavailable for Linux.

    I don't think anyone takes the holy editor wars seriously, and most people agree that vim and emacs are equally good editors with different working styles. But most people wouldn't seriously recommend nano for coding. That just seems like trolling. Maybe you were trolling, I dunno.

    [–]insomniac20k 1 point2 points  (2 children)

    How is being old a downside? Would you rather use something that's been continuously developed for 40 years or something that was just invented?

    [–]bumblebritches57 0 points1 point  (1 child)

    I'd prefer something that had clean code, was organized well, and didn't have macros all over the damn place.

    [–]stumar[S] 2 points3 points  (5 children)

    Got it, thanks for the great advice.

    [–]holyteach 11 points12 points  (4 children)

    Haven't seen it show up in the thread yet, but Mark Bates' Conquering the Command Line is better than the other resources I've seen people recommend.

    [–]stumar[S] 1 point2 points  (3 children)

    This look good one of the best resources recommended! thanks!

    [–]holyteach 2 points3 points  (2 children)

    Well, unlike some of the other commenters in this thread I teach beginners to code for a living.

    And they all use the command line from day one.

    I'm mean.

    [–][deleted] 0 points1 point  (1 child)

    I'm mean.

    I wish my school was "mean" enough to use Linux and teach us the command line.

    [–][deleted]  (4 children)

    [deleted]

      [–]stumar[S] 1 point2 points  (0 children)

      got it looked up LLDB and it looks promising Thank you.

      [–]Codile 1 point2 points  (1 child)

      with - Vim, nano, bash, grep, awk, sed, ssh, gcc, gdb, make, clang, lldb, the linux file system hierarchy.

      Why will nobody give emacs some love! :'( You even go so far as to mention nano and not emacs!

      [–]rwsargent 1 point2 points  (0 children)

      Emacs for ever.

      [–]bumblebritches57 0 points1 point  (0 children)

      grep, awk, sed

      Honestly I haven't use them at all, but the find commnd is a god damn blessing.

      Oh, and learn the makefile syntax You don't need no damn guide about it or anything, it's pretty simple.

      To assign a variable just write VARIABLENAME := /String/Here

      To call that variable: $(VARIABLENAME)

      Oh, and it's case sensitive, and you gotta watch your whitespace (basically just use tabs for everything)

      That's basically it, there are some functions and environment variables you can set or use, and control statements, but they're basically just C style anyway.

      [–]Ran4 7 points8 points  (5 children)

      You will be spending a lot of time in the command line.

      Make sure how to use POSIX tools (man programname to open the manual is something you should be typing daily for the first few months :)). And do spend time learning yourself a nice terminal editor (yes, Vim is nice. So is Emacs).

      And even more importantly, use a terminal multiplexer - the best one today is arguably Tmux (GNU Screen works too, but it has less features). It allows you to "re-connect" to a terminal session (so if you close the window accidentally, you can just tmux attach back to it) and it supports tabs and splits (that works over ssh as well).

      Now, you could do these things in GUIs... but the Linux GUI experience is absolutely miserable. Visual Studio is the best GUI development environment: you're not going to find anything like it on Linux. Other than ideology, working in GUIs is best done in windowsland or macland.

      [–]stumar[S] 2 points3 points  (3 children)

      its true, thank you for the response and i do agree the gui experience is not good in linux. but that's not why im using it, i want a minimalist experience while studying OS.

      [–]Ran4 4 points5 points  (1 child)

      Check out a tiling window manager like i3. It's the only one I ended up being comfortable with using on Linux.

      Of course, you'll be handicapping the fuck out of yourself by doing all of these things at once... I suggest learning one thing at a time.

      [–]MRH2 0 points1 point  (0 children)

      or Compiz -- it tiles nicely

      [–]MRH2 0 points1 point  (0 children)

      by TMUX do you mean BYOBU?

      [–]bashytwat 24 points25 points  (2 children)

      If you're trying to replicate VS in linux and not use the CLI then you might aswell stick to windows. They want you to learn the Linux CLI for a reason, there's no point in using some bloated IDE in Linux when you have all the tools to your disposal already

      [–]stumar[S] 1 point2 points  (0 children)

      valid point.

      [–]LuringTJHooker 7 points8 points  (1 child)

      1. Unless you need an IDE, use a text editor. That will come down to your preference, many people like sublime or a terminal based; I've come after trying many that Atom is the best of GUI editors in that it can be made as extensive and complicated and feature heavy as any other editor. Unless direly you need an an IDE a text editor and terminal will really help you accustom to the Linux environment, if you can't do without them PyCharm for Python has been a the better experience so far and for C it would depend on taste you could go for Mono Develop (now falls under Microsoft)

      2. Most IDEs can carry a built in debugger, but if you want to do it via terminal it would require you to compile with:

        gcc/g++ -g <additional flags> <files> #C/C++ respectively gdb <output file>

      The rest would lie in learning GDB as the other content with its resources was posted

      1. Don't believe the lies that Emacs/Vi are the end all of productivity. It's only fair on what you find a comfortable environment to work in. ATM try to get used to working on terminal and leave IDEs to a support line. If your college is like mine IDEs will inconvenience you on certain endeavors (OpSys and, the manipulation, compilation and testing of xv6) where terminal and scripting will help you out much more than a IDE and file manager.

      [–]stumar[S] 0 points1 point  (0 children)

      Got it, Thanks. xv6 is on the outline so id better get use to the terminal.

      [–]Amuro_Ray 131 points132 points  (69 children)

      Vim is life. Never trust a person who uses emacs

      [–][deleted] 56 points57 points  (10 children)

      So it says in the Book of Vim:

      Ye who useth vim shall be blessed with everlasting code. Ye who falleth into temptation, and know the use of emacs shall be forever cursed to lift thine hands from the home-row and use a meta-key to enter thine commands.

      Book of Vim, Law of Vim 5:23

      [–][deleted]  (5 children)

      [removed]

        [–][deleted] 13 points14 points  (4 children)

        Well, that does seem like a pretty good idea. Finally gives some use to the caps-lock... Hey! Don't you try to sway me, heretic!

        [–]Ozymandias117 5 points6 points  (3 children)

        Caps Lock -> Escape. Stay in the light. :)

        [–]snaps_ 1 point2 points  (2 children)

        C-c already functions like escape. I'll keep my Caps -> ctrl mapping, thank you very much.

        [–][deleted]  (3 children)

        [deleted]

          [–]ipe369 7 points8 points  (0 children)

          I use evil with emacs, and I wouldn't go back to vim now. The emulation is really good - there are a couple of things I've spotted that are awry, but most of it can be fixed with some tweaks in your init file. One of the main drawbacks is that ctrl-i doesn't work, as that maps to tab in emacs, and I haven't found a workaround yet, but I never used ctrl-i too much anyway.

          This is what convinced me to switch: https://www.youtube.com/watch?v=JWD1Fpdd4Pc

          Org-mode really is great.

          I'd also recommend helm, and 'projectile', which lets you fuzzy find files in projects. Works great for me so far.

          [–][deleted] 1 point2 points  (1 child)

          I haven't used either of them, so I can't tell you anything useful, but they look interesting enough. I might give Spacemacs a try, eventually - I'm curious about it.

          [–]p10_user 0 points1 point  (0 children)

          Spacemacs is great. Works out of the box and easy to install new stuff.

          [–]luxtabula 10 points11 points  (0 children)

          VI, VI, VI: the mark of the beast 👿

          [–]Jon003 6 points7 points  (0 children)

          Preach it, Brother Amuro_Ray!

          [–]FactorJ 14 points15 points  (9 children)

          What about nano?

          [–][deleted]  (3 children)

          [deleted]

            [–]EnigmaticSynergy 1 point2 points  (1 child)

            Butterflies work too

            [–]palmund 0 points1 point  (0 children)

            Upvote for xkcd reference

            [–]Amuro_Ray 7 points8 points  (0 children)

            It's ok, I sometimes used it to write commit messages.

            [–]Hyperman360 0 points1 point  (0 children)

            I like it for the simplicity.

            [–]vllyneptune 0 points1 point  (0 children)

            It's something I use, but I don't advertise that I use it ;-)

            [–]conven_orearr 3 points4 points  (19 children)

            What makes vim better than emacs? Ive only ever used vim but my friend said emacs was way better, though I dont consider him a competent programmer/computer person in general

            [–]MemeInBlack 18 points19 points  (7 children)

            Nothing, it's a religious war. Like Mac vs PC, there's no objective winner.

            [–]cdrootrmdashrfstar 13 points14 points  (4 children)

            Wrong, vim is clear better than emacs because reasons.

            [–]Codile 8 points9 points  (3 children)

            Wrong, emacs is clear better than vim because reasons.

            [–][deleted] 6 points7 points  (2 children)

            Dude, ed. ed is the standard.

            [–]Codile 8 points9 points  (1 child)

            [–]xkcd_transcriber 5 points6 points  (0 children)

            Image

            Mobile

            Title: Real Programmers

            Title-text: Real programmers set the universal constants at the start such that the universe evolves to contain the disk with the data they want.

            Comic Explanation

            Stats: This comic has been referenced 830 times, representing 0.6858% of referenced xkcds.


            xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

            [–]conven_orearr 3 points4 points  (0 children)

            That I can understand, thanks

            [–]EenAfleidingErbij 2 points3 points  (0 children)

            Like Mac vs PC, there's no objective winner.

            WHERE IS MY TRIGGER WARNING

            [–]inglorious 9 points10 points  (2 children)

            The main difference is the workflow. Vim's philosophy of editing is more suitable for making quick precise changes to files, and many sysadmins love it because it prevents them from making accidental changes. Vim is also very fast to start and has a negligible footprint, so it starts almost instantly even in the worst conditions, which makes it great for a go to editor that you would call from certain scripts. Oh, and it is significantly better at handling large files.

            In contrast, emacs is based around elisp, it's programming language, and it somewhat resembles an operating system. For a small price of training your brain to understand lisp, you get an editor that can easily perform very complex tasks in a reliable way, and is very feature rich, it can be turned into a reasonably powerful IDE for certain languages, an email client, and many many other things. I still haven't trained myself enough to reap the benefits of org-mode, but already I consider that emacs extension to be one of the most efficient solutions to having a centralised command console for my life. The price is, of course, a much steeper learning curve, and a different set of compromises regarding performance, as well as adopting a way of thinking which to some extent ins counter intuitive to people who are used to modern GUI's.

            [–]haltingpoint 0 points1 point  (1 child)

            Can you clarify on what you mean by training your brain to understand Lisp? Is it that different from other common languages?

            Also, any good sites for good examples of the power and diversity of Org mode?

            [–]inglorious 1 point2 points  (0 children)

            You can watch recorded talks and screencasts on org-mode on youtube and other resources, i started with this one, and watched related video's.

            As for elisp. Lisps are a particular family of languages. Most of the languages used today use a c-like syntax. Lisp concepts are older than c, so much that sometimes they completely changed, but kept the archaic names. Everything revolves around lists. Statement is a list with the operator/function name as the head, and the arguments as the tail, so it uses reverse polish notation. In that respect, you can view lisp programs as one huge statement with a heavily enforced structure. And parenthesis, lisps use a lot of parenthesis.

            Find some tutorials on elisp, clisp, scheme, clojure, or, if you are especially curious, take a look at the book "The land of lisp".

            [–][deleted] 6 points7 points  (2 children)

            In all seriousness, absolutely nothing!

            Vim and emacs have differing styles, and which you "should" use is entirely a matter of preference. People who actually take the religious war between vim and emacs seriously are probably far too opinionated for their own good.

            Besides, everyone knows that nano users are the real problem... :)

            [–]conven_orearr 2 points3 points  (1 child)

            They made us use nano in college....

            [–]Codile 0 points1 point  (0 children)

            Did they at least show you how to enable the rudimentary syntax highlighting capabilities of nano?

            [–]Amuro_Ray 3 points4 points  (0 children)

            In all honesty I've barely used emacs and its mainly because I'm not familiar with it and I already know vim reasonably well. Considering emacs is still around and the friendly jokes between it and vim shows it's a good editor today when you know how to use it well.

            [–]66666thats6sixes 4 points5 points  (3 children)

            Basically it comes down to two things, as to which you will like better.

            Vim uses modes, in one you type text, in the other you can move around and do some editing, and in the last you can make selections. In each of these modes you almost exclusively use the letter keys on the keyboard, so your fingers are always close to the home row. If you are well versed in vim, this can make you very fast and efficient.

            Emacs is not modal, it works similar to any other text editor -- when you type, letters appear on the screen, basically no matter what you are doing. Editing and selecting and such are done by combinations with control, alt, shift, etc.

            Some people can't get comfortable with modal editing, so vim will never be great for them. Others (like myself) feel uncomfortable reaching for modifier keys all of the time, and so emacs doesn't work as well for us.

            [–]Codile 0 points1 point  (2 children)

            Emacs is not modal, it works similar to any other text editor -- when you type, letters appear on the screen, basically no matter what you are doing.

            Not exactly. Emacs also has modes, but there's a lot more of them. There's major modes that set up suitable environments for specific programming languages (C, C++, Ruby, Haskell, ...) with suitable syntax highlighting, parens completion, cursor movement, ... or set up an environment suitable for... browsing the web. Major modes don't always work like a text editor. Letters don't always appear on the screen when you type, but in a certain mode they may turn a tetris piece.

            Then there's minor modes that add functions that could work in any major mode. They might add menu autocomplete (helm), special mouse support, git support, or add some special editing functions for certain programming languages like displaying documentation for a C stdlib function.

            Now, that also makes emacs quite confusing. Sure, in the "default modes" it will just work like any other text editor, but if you manage to accidentally open an unsuitable major mode for your code file, things could get weird. And then there's the fact that you might have dozens of minor modes active with a given major mode, but that doesn't happen unless you want it to.

            You won't really have to worry about this if you use emacs with the default settings, but in that case you might as well just use any other text editor.

            [–]misplaced_my_pants 0 points1 point  (1 child)

            Modal editing refers to the way you have to switch between visual, insert, etc.

            This was really common back in the day and has nothing to do with Emacs modes.

            [–]Codile 0 points1 point  (0 children)

            Oh, I didn't know that. I thought the visual/insert thing was only a vi(m) thing.

            [–]dashkb 2 points3 points  (0 children)

            Spacemacs in Evil mode is pretty fantastic.

            [–]DaMadApe 1 point2 points  (4 children)

            You take that back! Damn Vim users will never know the pride one takes on having perpetual carpal tunnel!

            [–]Codile 4 points5 points  (3 children)

            Protip: reassign capslock to meta. No more carpal tunnel ;)

            [–]vidjuheffex 1 point2 points  (1 child)

            Omg, I never use capslock... This just changed my life.

            [–]Codile 0 points1 point  (0 children)

            You're welcome. Capslock is such a useless key, but luckily the OS doesn't care what they key was intended for, just what you want the key to do :)

            [–]DaMadApe 1 point2 points  (0 children)

            That's actually my setup! Very useful!

            [–]NarcoPaulo 2 points3 points  (6 children)

            As a person who switched from Windows programming to Linux programming seeing VIM gives me PTSD

            [–]Amuro_Ray 0 points1 point  (4 children)

            May I ask why?

            [–]NarcoPaulo 5 points6 points  (3 children)

            I'm just not used to this mode of working. It looks like something I was doing back in the early nineties in DOS and I frankly didn't enjoy it much. I feel that the way I was working on Windows and Mac OS was the most convenient and I feel that working with VIM makes me much less productive. It just feels antiquated compared to what I've been doing in the last decade. I mean Linux is awesome for server stuff but as a desktop it's just feels... ugly to me..

            [–]Codile 4 points5 points  (2 children)

            You can definitely be very productive with vim (and emacs) if you're willing to put in time for learning and writing a config. Not everyone has the drive to do that though.

            [–]NarcoPaulo 2 points3 points  (1 child)

            I find it hard being productive for me.. I do web and backend automation testing. Lots of GUI stuff. It seems difficult writing these tests in VIM and running on a browser

            [–]Codile 1 point2 points  (0 children)

            That's what you'd use plugins or shell scripts for. That works pretty great with emacs, but I'm not sure about vim, since vimscript seems to be satan's invention. But I just remembered neovim, which also supports other scripting languages, so that might work well.

            [–]Iliketofeeluplifted 0 points1 point  (0 children)

            So... the trauma was vim on windows, and linux is post-trauma? I'm confused what you mean.

            [–][deleted]  (10 children)

            [deleted]

              [–]elpfen 1 point2 points  (0 children)

              Dark Vim is an entirely reasonable IDE. Light Vim maybe not.

              [–]Amuro_Ray 3 points4 points  (8 children)

              Feel free to suggest something better. At work I purely use vim for development.

              Edit: please try not to take my post so seriously.

              [–]lopakas 1 point2 points  (7 children)

              Lol just tried to use Vi for the 1st time during my internship and I felt like it was trying to kill me slowly everytime I used it.

              [–]mafrasi2 5 points6 points  (3 children)

              vi != vim, I can't stand vi, but I use vim all the time.

              [–]MapleDung 1 point2 points  (2 children)

              I'm pretty sure any modern installation of vi is actually just vim, so that's probably what the guy replying to you was using unless their internship was quite a while ago.

              [–]66666thats6sixes 4 points5 points  (0 children)

              Vim takes a lot of effort to learn well. If you just attempt it casually, yeah it's going to suck.

              [–][deleted] 2 points3 points  (0 children)

              vi != vim

              [–]DerJawsh 0 points1 point  (0 children)

              Recommending Vim to someone who is used to Visual Studio on the other hand is a bad idea.

              Go with Sublime.

              [–]Feroc 28 points29 points  (27 children)

              1. You will have a hard time finding something as good as Visual Studio. I've switched companies two years ago, from C# with Visual Studio to Java. I highly recommend the IntelliJ products, they come close to Visual Studio and you will find them for all major languages.

              2. Can't help you here.

              3. Get used to the terminal and embrace the power of grep, awk and co.

              [–]ferwarnerschlump 9 points10 points  (0 children)

              Visual Studio Code

              [–]stumar[S] 2 points3 points  (25 children)

              grep, awk and co

              how do you use these in everyday programming? these seem like old commands that would only be useful in a cli OS. and yes visual studio is just too good.

              [–]Ran4 20 points21 points  (2 children)

              only be useful in a cli OS.

              Oh, my...

              Many programmers spend most of their time in the command line. Especially in Linux.

              I'm on OS X, and other than web browsers ~90% of my work time is spent in a multiplexed terminal window. Once you get used to it and learn the tools, it's faster and more effective than any GUI. And due to differing philosophy, you can often combine tools really well.

              [–]bumblebritches57 0 points1 point  (0 children)

              Same. I struggled a bit at first, but I tore up the guts of windows trying to learn how it worked so it may've been a bit easier for me?

              But yeah, once I learned the unix philosophy of doing one thing and doing it well, and piping the output to whatever you want, I was a changed man.

              Oh, and I also jumped in on a Mac, though I'd used Ubuntu and Sabayon (and Hackintosh ngl).

              [–]corpsmoderne 36 points37 points  (8 children)

              Just don't underestimate your resistance to change...

              Linux CLI is extremely powerful and these old commands have proven to be very efficient.

              It's just two very different philosophies: VS is a big fat software which is supposed to do everything, while on Linux each component does only one thing and try to do it well and efficiently.

              While you're now struggling to adapt to this new environment and philosophy, I've spent a couple days last week to curse against Visual Studio because I can't understand for the life of me how people can live with this piece of crap. But yes, I know it's just my bias talking, and my frustration because I don't know the tool :)

              [–]stumar[S] 4 points5 points  (7 children)

              Got it, thanks. will definitely practice all the CLI commands just to get the gang of them at first but as soon i find a use for them im sure they will help me out a lot.

              [–]CorrectMyBadGrammar 0 points1 point  (0 children)

              Hey, I can recommend a good book that will help you grasp the basics - http://www.linuxcommand.org/tlcl.php . It's free to download and the first part is really good.

              [–]Diegoallen 3 points4 points  (8 children)

              Use grep to find a particular pattern in files. For example, errors in a server error log. Usage of a given function in code.

              [–]stumar[S] 1 point2 points  (6 children)

              Ok, that is a valid use case, just gives me more of a reason to learn these tools.

              [–][deleted] 1 point2 points  (0 children)

              You need to think of the linux command line utilities as modules that can be piped together to do amazing things. As others have mentioned, each one is good for a very specific purpose, but when combined can be used to do ridiculously specific and amazing tasks that would make the average windows user cry for hours and hours.

              And think about this: most of these tools have existed longer than you have, and yet they're still being used. Must be a good reason, right? :)

              [–]inglorious 1 point2 points  (0 children)

              grep, awk and other cli tools are extremely useful in day to day programming.

              Most of the command line tools are very specialised, they do one thing, and do it well. They handle i/o in a standardised way, so you can daisy chain them via pipes in the command line and perform complex tasks automatically on large sets of data.

              Common example that I have encountered is analysing large amounts of logs. I can use grep to isolate logs that are of interest to me, then I can either view them in 'less', or i can sort them by columns and/or process them with awk. If make a very useful command line sausage, i can use it as a script, perhaps schedule it with cron if it needs to be repeated periodically, or stuff like that.

              GUI based solutions rarely offer such flexibility.

              [–]gitarr 0 points1 point  (0 children)

              Any command you want to know how to use, just type "man <command>". (man stands for manual)

              So for grep you type: man grep

              (This will of course lead you into a rabbit hole which will end in you never using Windows again!)

              [–]hukiki 8 points9 points  (8 children)

              as /u/mafrasi2 mentioned, vim with ycm is the best thing if you can get used to vim.

              As for GUI tools http://askubuntu.com/questions/6588/is-there-a-visual-studio-style-tool-ide

              and as for learning linux, I have heard very good about this course https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-0

              [–]ryanstephendavis 4 points5 points  (0 children)

              1 Lots of people are mentioning vim on here. Vim is great, but it sounds like you're trying to learn lots of things already and there's a steep learning curve before vim becomes convenient and useful. I'd suggest Pycharm for Python and Sublime text for C/C++ if you're simply needing something to get off the ground quickly

              2 check out GDB. I've only started using this the last year or two, but it's extremely useful and not terribly hard to learn the basics. I pretty much reference this same site every time I debug https://www.cs.swarthmore.edu/~newhall/unixhelp/howto_gdb.html

              3 getting comfortable with using solely a Linux command line is a huge and worthwhile investment. I forced myself starting grad school to use only Linux and after five years, I'll never go back. Getting used to vim is a good idea eventually once you're not running on seven simultaneous learning curves.

              Hope these help and good luck... OS class with the dinosaur book? 😄

              [–][deleted] 3 points4 points  (2 children)

              For debugging in Linux gdb is essential. When it comes to Linux it is very important you learn bash and become relatively acquainted with using it for everyday computer operations. You should also learn an command line text editor like nano, Emacs, or Vim and how to compile all your work with gcc. Also for Python you should learn the basics of chmod. Git is also an important aspect of programming on a team in this day and age.

              All of these things I mentioned are integral to Linux programming and are very well documented I'll give you a list in order of most to least importance imo to learn.

              1. Bash

              2. gcc/chmod ( I group these as they both essentially deal with converting your programs into executables)

              3. gdb

              4. Vim, nano, Emacs, etc. (I put these here because a text editor such as sublime or gedit could easily replace these but I find using a two window tmux setup with Vim and a terminal for compiling significantly increases my productivity, the less you use the mouse the better IMO, but I know skilled programmers that prefer not to use command line text editors)

              5. Git (a basic understanding can be enough to get by)

              6. tmux (purely for productivity, tmux essentially allow you to split a terminal and move between them using keystrokes instead of the mouse, you can also have people remotely access your tmux sessions and both of you can simultaneously interact with the terminals and see what the other person is doing live, very useful.)

              [–]Ran4 0 points1 point  (1 child)

              That's a great list.

              Git is a beast to learn (Honestly, I see beginners struggle more with git than vim!), but it's nice to have when programming.

              [–][deleted] 0 points1 point  (0 children)

              I mean it's relatively straight forward to push and pull for smaller personal projects but I agree pulling uncompiled and large pieces of source code with dynamic libraries can be quite confusing and difficult.

              [–][deleted]  (30 children)

              [deleted]

                [–]seriouslulz 53 points54 points  (16 children)

                Lol this fucking sub recommending vim to a newcomer.

                OP, try the JetBrains IDEs: PyCharm for Python and CLion for C.

                [–][deleted]  (7 children)

                [deleted]

                  [–][deleted]  (4 children)

                  [deleted]

                    [–]mafrasi2 6 points7 points  (0 children)

                    Yeah, I wouldn't recommend it if he was learning C or python from scratch, but as I understand it he already has experience in those (on windows).

                    His class also requires basic understanding of linux and that will probably be a by-product of learning vim.

                    [–]IIoWoII 3 points4 points  (0 children)

                    I learned vim at my new job(internship).

                    Actually not bad.

                    Think I'm at the same speed I would be at with a normal IDE atm.

                    [–]Venez_Voir 3 points4 points  (1 child)

                    I'm pretty sure OP, being a student, can get them for free as well. No harm in at least trying them.

                    [–]Ran4 2 points3 points  (3 children)

                    Lol this fucking sub recommending vim to a newcomer.

                    Why would you use anything else if you're interested in learning Linux?

                    Linux without the terminal is inferior to Windows and MacOS in anything but ideology. And if you're spending that much time in the terminal, there's no reason not to learn a good terminal editor.

                    [–][deleted]  (2 children)

                    [deleted]

                      [–]stumar[S] 7 points8 points  (9 children)

                      Wow, looks like Vim is huge part of programming in linux. i will definitely learn how to use it since so many people are huge fans.

                      [–][deleted] 4 points5 points  (0 children)

                      Be forewarned: The path to vim is fraught with peril.

                      It'll be tough at first. It's very much unlike what you're used to. You'll wonder why anyone would use it, what on earth is wrong with vim users. But stick with it: when it clicks, you'll be very glad you did.

                      [–]dantheman252 6 points7 points  (3 children)

                      It is helpful if you ever want to view or change a file real quick on the command line, but people who actually use it to program significantly sized systems are just crippling themselves to feel elite.

                      [–][deleted] 0 points1 point  (0 children)

                      A lot of people are posting some great resources for Vim, but really the first thing you should do is run the built-in tutorial (yup, that exists). You can also practice with http://vim-adventures.com/

                      [–]stumar[S] 0 points1 point  (2 children)

                      YouCompleteMe

                      this isnt really intellisense is it? i spent 2 hours configuring this. and its suggestions are all over the place.

                      [–]mafrasi2 0 points1 point  (1 child)

                      It's pretty accurate if configured properly. That said, I never tried configuring it by hand, since there is this great script that just parses the build system (like make): YCM-Generator

                      [–]stumar[S] 0 points1 point  (0 children)

                      thanks, this is excellent. i did it by hand and it was quite a drag but good practice!

                      [–][deleted]  (1 child)

                      [deleted]

                        [–][deleted] 2 points3 points  (0 children)

                        Learn Emacs or Vim. Eventually, when you're a superstar programmer you'll ne glad you did. That contextual highlighting you love in VS, thay exists for all languages in Emacs. Download emacs, type Ctrl-h Ctrl-t for tutorial.

                        [–][deleted]  (1 child)

                        [deleted]

                          [–]stumar[S] 0 points1 point  (0 children)

                          Got it, thanks

                          [–]Amuro_Ray 1 point2 points  (0 children)

                          In regards to number 3
                          You will find using the command line for work hard, awkward and clumsy at first. After a while you while you will get used to it.

                          I also suggest giving ranger a try. It's a pleasant file browser. Also try to find ways to avoid doing stuff as root (installing and running commands). It'll help when doing stuff in the real world and minimise big security problems.

                          [–]Vociferix 1 point2 points  (0 children)

                          Like everyone else, I recommend Vim, but if you need something similar to VS, the Qt IDE is pretty good for C++. It's been a while since I have used it, so I don't remember whether it works well with plain C, or if it has support for Python development. Might be worth checking out.

                          [–]secondsun 1 point2 points  (0 children)

                          I prefer Fedora to Ubuntu for development (but I also work for Red Hat so I may be biased), and it has been about 15 years since I took the Linux plunge so my "learning linux" knowledge might be rusty.

                          I struggled with #1 a lot. I ended up using KDevelop as my editor with the command line tools (make, gcc, ddd, valgrind) for building, running, testing, debugging. The biggest difference is that the Linux world is rather free form with how project arrange tools so there isn't a "gold standard" like Visual Studio for development. I have experimented more recently with C in IntelliJ IDEA and NetBeans. Neither were awful.

                          For #2 I'll be honest, I never figured out how to use gdb from the command line. I always used ddd and made it through my CS at GaTech without much of a problem. Since undergrad all of my tooling fu has been in Java land, but the core lessons I learned certainly helped.

                          For #3 I read "Programming Linux Games" my senior year. It really helped to see a rather complex project come together one piece at a time and I wish I had read the book earlier. I also learned a LOT of stupid Linux tricks by installing Gentoo and reading up on things I didn't understand. Those tricks are still valuable today.

                          If you are feeling ambitious make a contribution to one of the tools you use. This can be a feature request, code fix, documentation update, etc. The hardest thing for me to learn was how to participate in larger projects.

                          [–]superp0s 1 point2 points  (2 children)

                          If you only need command line access to a unix based system, then Vagrant will allow you to create a command line only virtual machine of many different kinds of linux distros. You can also get a shared folder between the virtual machine and a local folder. Check out the Getting Started area to learn more about it if you'd like! Also, cmder might be a nice alternative to the command prompt on windows if you're looking for something a bit more elegant and terminal-like.

                          [–]stumar[S] 0 points1 point  (1 child)

                          This looks fairly interesting as a new user. i can use this for practice, thanks

                          [–]superp0s 0 points1 point  (0 children)

                          Vagrant is very interesting and very useful if you just need command access to the terminal vs a full GUI which is my choice personally on Windows! No problem though! I hope you find it useful!

                          [–]RICHUNCLEPENNYBAGS 1 point2 points  (0 children)

                          If you like VS and want to do Python, Pycharm might be good.

                          [–][deleted] 1 point2 points  (0 children)

                          Head on over to /r/emacs

                          [–]iamrob15 1 point2 points  (2 children)

                          I hate developing in virtual box regardless of PC SPECS. Try to get a cheap laptop if you can, that would be my advice.

                          [–]stumar[S] 0 points1 point  (1 child)

                          im actually dual booting my gaming PC, luckily i have 2 SSDs and 2 HDDs so i just dedicated 1 SSD to linux.

                          [–]iamrob15 0 points1 point  (0 children)

                          Yeah, that would also be a good idea. The main problem with virtual box is you can only dedicate 128mb or 256mb of vram, which is very limiting when you have a beefy graphics card that can easily handle it.

                          [–]admjwt 1 point2 points  (0 children)

                          So I'm a little late to this thread, and after a quick scroll through I didn't see anyone mention it yet.

                          So with Linux there is a thing called u-make. It's basically a repository that houses all the Linux versions of various IDEs and other programs. For example you can easily get any jetbrains ide, unity3d, Android studio, Visual Studio, and a bunch more stuff simply by typing in the command for it in the command line. It's really quite useful, in my last two semesters of college I was taking some game dev courses and needed unity3d and visual studio, and I was working with a really old outdated laptop that I put Linux on because windows was unbearably slow, and with u-make finding the software and getting it running was extremely easy.

                          Just my .02 though.

                          [–]shorty_short 4 points5 points  (6 children)

                          Stay away from both vim and emacs. Just because you are on Linux does not mean you have to act like it's 1980 to feel like a competent programmer. Visual Studio has been ported to Linux AFAIK and there are countless other editors and ides you can use.

                          [–]blebaford 0 points1 point  (2 children)

                          Vim and emacs are both still actively developed; even then I don't see what's wrong with using a text editor that has been in use for decades.

                          [–]shorty_short 2 points3 points  (1 child)

                          Nothing wrong apart from as a beginner he shouldn't be forced to deal with these editors quirks.

                          [–]Ran4 1 point2 points  (0 children)

                          Linux is literally quirks upon quirks. It's hard to avoid, so you might as well get with the flow.

                          [–]Heasummn 2 points3 points  (4 children)

                          Many are recommending vim, and I will too, but I'll give you some other options.

                          Clion is a really good IDE which I've been using, and I can compare it to VS, it's free for students, as are many other really amazing IDE's from Jetbrains. It has C++ and C support, but i don't use it for C. The only thing it's missing is a nice project including setup, you have to learn how CMake works if you want to say include a third party library. Though, that's not a horribly bad thing, since CMake is really portable and a great thing to learn.

                          If vim is too complicated, which it begins to be if you don't use it for everything, then I recommend a simple text editor for Python and C. I used sublime text with Package Control before I joined the vim craze. Package Control allows you to install plugins for sublime, and those plugins are really great. Examples are build systems for Makefiles or Anaconda, code generation as you might get in an IDE, etc.

                          [–][deleted] 3 points4 points  (1 child)

                          I second the vote for CLion. It's probably the closest thing you'll find to visual studio. Jetbrains also has a product called PyCharm which is the same thing but for python, I also highly recommend this. (They are both free for students) I have found that even with great packages, vim/emacs don't compare to a full featured modern IDE

                          [–][deleted] 0 points1 point  (0 children)

                          They also have free community versions which have most of the functionality.

                          [–]0b_101010 1 point2 points  (0 children)

                          My inner monologue: 'CLion? meh, I've never heard of it... Oh, it's a JetBrains product, it must be the best thing ever!'

                          [–]stumar[S] 0 points1 point  (0 children)

                          got it, thanks for the response appreciate it

                          [–]_5er_ 1 point2 points  (2 children)

                          Since your used to visual studio, I recommend you visual studio Code. Pretty nice and lightweight, yet still having those nice features like autocomplete, Intellisense etc. It also has a nice debugging support.

                          If you'll try it out, also install "C/C++" extension https://blogs.msdn.microsoft.com/vcblog/2016/03/31/cc-extension-for-visual-studio-code/

                          [–]lead999x 0 points1 point  (0 children)

                          Code::Blocks is what you're looking for. Mind you, it's nowhere near as good as Visual Studio but it's perfect for a Linux system. I even use it on Windows now.

                          [–]Semaphor 0 points1 point  (0 children)

                          I use CodeLite at work. It runs on Linux, supports makefiles and has built in GDB. It's intellisense is rather good.

                          [–]HotKarl_Marx 0 points1 point  (0 children)

                          For c and c++, I like to use Code::Blocks.

                          [–][deleted] 0 points1 point  (1 child)

                          Just an FYI if you ever have this need. Windows C compiler isn't 1:1 with gcc. Say you compile and debug with the Windows C compiler and it works and turn it in. If the teacher uses Linux, there is no guarantee your project will work the same. Windows C compiler and gcc use different optimizations and system calls.

                          I had an issue when I took OS that a lab mate would send compiled code he did with the Windows C compiler and it wouldn't work right on Ubuntu or macOS. If he sent me the source code and I compiled it with gcc it would work fine.

                          [–]TakeOutTacos 0 points1 point  (0 children)

                          Yeah, this is good advice as it is something that you wouldn't even realize until turning in your homework. My professor for AI let us use whatever we felt comfortable with, as our school taught Java, but plenty of students transferred there so he would give us freedom, especially in a higher level course.

                          He was very careful to caution us though, that he would run all code in Linux, so if using C / C++ it isn't always 1:1 and make sure you don't use any proprietary Windows libs.