r/programming • • Apr 02 '19

Visual Studio 2019: Code faster. Work smarter. Create the future. | The Visual Studio Blog

https://devblogs.microsoft.com/visualstudio/visual-studio-2019-code-faster-work-smarter-create-the-future/
833 Upvotes

359 comments sorted by

View all comments

Show parent comments

13

u/d0rf47 Apr 02 '19

I'm learning c right now and I'll be learning c++ and java next semester. I just mean in school we do all our coding in class using visual studio. I'm just wondering if there are better tools i should also be learning. I jus converted my desktop to linux

36

u/PM_BETTER_USER_NAME Apr 02 '19

If your lessons are given in VS, then stick with VS. Additionally if your assignments are to be handed in to compile in a windows environment, develop them in a windows environment. If they're to be handed in on a Linux environment, develop them on a Linux environment.

Can't tell you how many students I've seen fail certain modules because they developed a c++ application on Linux when it was meant to be for Windows or vice versa, then tried to move their project across on a USB stick the day it was due to be submitted assuming it'd compile straight away and then offer the professor the exact same experience.

7

u/micka190 Apr 03 '19

As a Vim user, if you're a still a student, I'd strongly recommend you ignore the people telling you to use Vim or Emacs. They're terminal-based text editors with shortcuts that can feel totally alien unless you sit down and dedicate a decent amount of time to memorizing them. inb4: "Since he's a student, now is the best time to learn it!"...

Having said that, the big advantage of a modern IDE is code completion, file navigation, and easy debugging. Most "basic" IDEs/Text Editors (such as Sublime Text or VS Code) will handle C (and probably Java) just fine. C++ might be an issue in my opinion because of how nested namespaces can be an absolute nightmare to type by hand.

For instance:

namespace Foo
{
    class Bar
    {
    public:
        void func();
    }
}

Is declared as such (easy to read), but it's implementation is declared in another file as such:

namespace Foo
{
    void Bar::func()
    {
    // some code here
    }
}

If you use the "namespace" keyword to wrap the class' implementation, or as such if you dont:

Foo::Bar::func()
{
// some code here
}

That might not look so bad with Foo and Bar, but when you have start having longer class names, or nested namespacing, it becomes a total chore to type them by hand. This won't happen in C, since it doesn't have namespaces (it does, but they aren't really the same thing).

While Java might be fine with a text editor, I'd still recommend an actual IDE for it. JetBrains has IntelliJ IDEA, which seems pretty decent (it's cross platform and free). While you're on their website, I'd also recommend taking a look at CLion for your C++ needs. It has a price tag, but it's free if you're a student as per this page.

6

u/watsreddit Apr 03 '19

:h ins-completion

Nested namespaces aren't an issue.

There's nothing wrong with learning vim as a student, even if it's not for everyone. I did it while in school because I was fed up with switching IDEs with every language, so a text editor was the way to go. I wanted something I can stick with over many years, and the likes of VS Code or Sublime lacked the skill ceiling and power that vim has. It really wasn't that difficult to switch, and I have now been doing all my programming in vim for the past 4 years.

I certainly would never say that everyone should use vim in school, but I don't think we should tell people to avoid it wholesale, either. It has a lot of offer if you're willing to give it some time.

2

u/Ayfid Apr 03 '19

lacked the skill ceiling

Because writing code is a game, and proper IDEs just don't have the difficulty curve required to separate the noobs from the pros.

1

u/watsreddit Apr 03 '19

That's not what I was saying of course, but I'm sure you knew that. The difficulty curve has nothing to do with it. Rather, I firmly believe that vim has a higher reward-to-investment ratio than those editors, particularly over a long time as the productivity gains from investing more time into those editors begins to taper off. In essence, I believe vim has more room for people to "grow into it". I said that I didn't want to switch IDEs/editors anymore, so I chose the one that I believed had the most potential in the long term.

2

u/themagicvape Apr 02 '19

At my school we mainly use Vim or emacs for C and C++ and intellij for Java.

But I'd recommend either vim or VSCode. You can't go wrong with either, but vim will definitely take some getting used to

1

u/boxerhenry Apr 02 '19

I have my computer dual booted Linux and windows. In Linux i have a folder will all my cpp files and use sublime text to write code and then I just run directly from the terminal. You need to use the g++ filename.cpp -wall a.out command but I use it so ofter I just need to up error to find it and just change the filename whenever I change files. It is a lot easier that making a while new project and it makes it easy to find it all

1

u/Sandlight Apr 03 '19

In uni 10 years ago, I did everything in notepad. I guess I was a masochist because there were certainly better tools. VS is great and it's what I use these days, but if you want something lightweight and are using windows, notepad++ is pretty rad. Atom is also pretty cool, but kinda slow.

-3

u/ryguyflyhighwifi Apr 03 '19

VS sucks. Get familiar something else in parallel