Teaching Java with Visual Studio Code why is this better than Eclipse
Java is one of the major practical and widely-used languages that fall within the Object Oriented family.
Many institutions use Java as a first-year teaching language and generally teach the Java course is intended to:
1. Provide all of our students with exposure to a common programming language that can be used by later courses and practical work
2. Introduce the syntax that is (almost) common to several of the most widely used practical programming languages today (the syntax of Java has a great deal in common with that of C and C++, so having learned Java you are quite a long way to understanding those languages too
3. Discuss the process of designing, writing and debugging programs and raise some awareness of issues of style
4. Present the Object Oriented aspects of a programming language as means to enforce modularity in large programs
5. Teach basic use of Java, a language that has significant relevance in the outside world today.
For those learning to code here is a set of the ten top things
1. Understand the task you are about to solve before starting to write a program about it. Work through methods and procedures by hand on paper etc. Plan some test cases. Identify cases that will represent boundaries or oddities. In general prepare a plan before you start going anywhere near a computer
2. Sketch the structure of the whole of your code out informally so you have full overview before fussing about exact syntax etc. Ensure you know what you expect that the computer will do. This initial sketch can be very informal, and may be in terms of diagrams rather than anything that looks much like real programming. The key word here is “structure”. This applies with way greater force when your code starts to grow: you should always design a good way to factor your code into reasonably self-contained and independent components (each will be one “class” in your code) right from the start;
3. Write out key parts of above in the form of comments before you start the real code. Concentrate in these comments on the “what” and “why” of your code rather the details of “how”. This will really help when you show your work to somebody else because you need help! I will explain this one again: The first thing you will type into a computer when you start writing any program will be a set of overview comments that explain its strategy and structure
4. At least for a first version of anything, favour clarity and obvious correctness over pretty well everything else. Clever tricks, worries about efficiency, generalisations etc can come later;
5. Neat consistent layout and thoughtfully named fields, methods, variables etc. are a good investment of your time. Cryptic is bad even if it saves keystrokes in the short term;
6. If a task is too big to solve in just one gulp look for ways of breaking it down into sub-tasks. As you do this think about ways you will be able to test code you write for each sub-task and work on the whole thing step by step;
7. When you try to compile your code and see a syntax error do not panic. Learn to interpret the compiler’s diagnostics. And only try to remove one error at a time: count it as a success if next time you try to compile the first error has give so you can then concentrate on the second;
8. When you have compiled your program and run it and it gives wrong answers or behaves badly do not panic. First work to understand what is wrong and only after you have found where the problem is think about ways to fit it. Do not just try random changes! Eg. confirm what your program actually does by adding assert and extra print statements;
9. Whenever you find you have to change your program review comments, consider if it will now do exactly what you want, and re-run all your test cases. Experience shows that changes (for whatever cause) can introduce new problems while you are in the process of fixing old ones;
10. If you find you are spending a seriously long time trying to make sense of anything then find help from friends or a supervisor or a book. Do not just keep building up your frustration not getting anywhere!
So why would you use Visual Studio Code in preference to Eclipse or NetBeans
All students and educators get access to all version of Visual Studio, Visual Studio Online and Visual Studio Team Services via www.DreamSpark.com
In Visual Studio, we can add a file from a path to a project located in a workspace, and Visual Studio records the reference to a new file and opens it like any other file. But, in Eclipse and Netbeans, the structure of a project's elements must correspond to their layout in the underlying file system.
Eclipse is 166 MB to download for Java. Even more for the other versions! To download the Java EE version of NetBeans, it's 186 MB. And it's 205 MB for all four languages. Now compare that to Visual Studio Code, which is only 58 MB for all 34 languages! Imagine having to wait three times longer per download/install on each computer in your school! And then downloading and installing the new versions for each of those machines!
Unlike Eclipse, in Visual Studio Code, you don't need a plugin to use other languages, like C#, F#, HTML5, Python, and Ruby. You can transition quickly to other languages!
Java is important, but it should just be one language on the road to learning computer science! Eclipse only has Java (out of the box), and NetBeans only has 4 languages out of the box (Java, C++, HTML5, and PHP). But Visual Studio Code includes 34 languages out of the box! (Java, C#, C++, HTML5, PHP, VB, CSS, XML, JavaScript, Python, Ruby, Go, Perl, R, SQL, JSON, F#, PowerShell, and more!) And if it doesn't have your language, it's far easier to add it into Visual Studio Code than the other IDEs!
Visual Studio gives you a simple interface to publish your game or application in an app store! The biggest and best validation (and way to push improvement in your app) is when others like your work, people download it, and people use it. That includes deploying to Windows Store, Amazon, iOS, and Google Play!
Do you ever feel like someone doesn't get you? Well, VS Code gets you by getting how you need Git We're talking full Git Support: Commits, Diffs, Pulls, Pushes, Status Bar Actions, Branches, Tags, Handling Merge Conflicts, Remotes, Credentials, and more! Get the Git details here: Visual Studio Code - All the Git Features
Wikipedia
- Eclipse: https://en.wikipedia.org/wiki/Eclipse_(software)
- NetBeans: https://en.wikipedia.org/wiki/NetBeans
- Visual Studio Code: https://en.wikipedia.org/wiki/Visual_Studio_Code
Languages Out of the Box
- Eclipse: 1 (Java)
- NetBeans: 4 (C++, HTML5, Java, PHP)
- Visual Studio Code: 34 (Batch, C#, C++, Clojure, CoffeeScript, CSS, DockerFile, F#, Go, HandleBars, HTML5, Ini, Jade, Java, JavaScript, JSON, Less, Lua, Makefile, Markdown, Objective-C, Perl, PHP, PowerShell, Python, R, Razor, Ruby, Rust, Sass, SQL, TypeScript, Visual Basic, XML)
File Size
- Eclipse: At least 166 MB
- Netbeans: 205 MB
- Visual Studio Code: 58 MB
- Anonymous
May 31, 2016
It would be great to know how to configure Visual Studio Code for building Java files (i.e. running javac). Haven't found that info yet.- Anonymous
October 18, 2016
That's exactly how I ended up here. While I am really liking VSC (and the default color scheme) I cannot seem to click-through to class definitions, even though they're seemingly accessible on the context menu. I feel like running a [Maven] build would help. I've never used VS pre-Code, but in searching for an answer I found the older MVS had build abilities (Ant and Maven too). But, nothing here, on this page, is helping me progress in my goals. :/ May have to Eclipse. - Anonymous
December 04, 2016
The comment has been removed - Anonymous
August 01, 2017
The comment has been removed
- Anonymous
- Anonymous
July 13, 2016
Hi there are number of extensions now available to VS Code see https://marketplace.visualstudio.com/vscode/Languages?sortBy=Downloads Some specific ones being built to support Java are available via the Visual Studio MarketPlace as extensions https://marketplace.visualstudio.com/search?term=Java&target=VSCode&sortBy=Relevance- Anonymous
September 11, 2016
The comment has been removed- Anonymous
February 23, 2017
I think the answer is there is no difference.So then let's compare another point...File Size & Download Speed – 3X BetterEclipse is 166 MB to download for Java. Even more for the other versions! To download the Java EE version of NetBeans, it’s 186 MB. And it’s 205 MB for all four languages. Now compare that to Visual Studio Code, which is only 58 MB for all 34 languages! Imagine having to wait three times longer per download/install on each computer in your school! And then downloading and installing the new versions for each of those machines!- Anonymous
March 20, 2017
What kind of answer is that? "Yes that one is an outright disinformation attempt (58MB for 34 languages), but look at the one below!". This kind of articles are typical below-the-belt click-bait attempts from Microsoft. Will you never learn?- Anonymous
July 05, 2017
Sopot, what do you mean by "look at the one below"? Personally, yeah, I find something one third the size (a little over that) to download and wait to install is a reason to choose it. Is it the only reason? No, but it's something I look at when downloading and installing programs. Especially if you have to do that on 50 machines in multiple classrooms!
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
October 11, 2016
The comment has been removed- Anonymous
February 03, 2017
Good to know. I think that's my fault. I was pulling from Wikipedia and didn't see what you wrote: https://en.wikipedia.org/wiki/NetBeansSo, no lies from Microsoft. Just thought Wikipedia was accurate. Silly me.
- Anonymous
- Anonymous
March 19, 2017
This article is full of misconceptions and mistakes about Eclipse IDE and VSCode: 1. it's free: Eclipse IDE is too. And it's actually managed by a vendor neutral community involving more than a hundred serious corporate members, which makes it more sustainable2. Easier File Mapping: Eclipse IDE has been able to open an individual file out of an existing project forever. File > Open File... does that, as expected and well titled.3. Finally one true comment!4. That's simply wrong, like so many other things written here: VSCode has a marketplace and doesn't comme with all those language fully included. You have to download extensions for some of them to be more useful, just like other IDEs.5. Indeed, you took the Java Eclipse package, and you get mostly Java. Now, if you take another Eclipse package, you'll get something else, the Java EE package proably support a dozen of languages already. And many more are available on Marketplace and inter-operable. Indeed, one has to select what they want rather than getting everything at once, it's a different approach; but saying Eclipse IDE only has one language is wrong. The list of languages supported by Eclipse IDE and it's various extensions is still bigger than the list of languages supported by VSCode.6. Wow, a second comment that's not a plain lie! I didn't expect so much!7. Git support in Eclipse IDE has been complete for years now, and several Git users clearly state that it's even on of the best Git client on the market. On that topic, VSCode isn't better, maybe it's equivalent, but not much more.Also, you're missing an important part: debugging. A debugger is something a good developer need to be taught. If you get taught Java without being taught how to debug, you'll simply not be as productive as you can be with a debugger. At the moment, VSCode doesn't have a Java debugger, whereas Eclipse IDE excels at that.That point is IMHO much more important that the 7 ones you mentioned.And really, the quality of the comparison is pretty bad: out of 7 points, only 2 are fully accurate. Please try to do better and, if you really want to be professional rather than doing unverified propagande, fix this article accordingly.- Anonymous
July 05, 2017
The comment has been removed- Anonymous
July 05, 2017
Mickael, on your #2 points, it looks like Nitin's comment below contradicts this. Can you review and respond to it? Thanks!
- Anonymous
- Anonymous
- Anonymous
March 20, 2017
The comment has been removed- Anonymous
March 20, 2017
I forgot to say the above also invalidates point 4 of your article. There is full support for those core set of 5 languages or so, but everything else (Go, Rust, C/C++, D, and so on), requires extensions. (extensions are not called "plugins" in VS Code, but it's effectively the same thing, obviously!)- Anonymous
March 20, 2017
Hi thanks for the comments.. In most cases students and academics wish to use a variety of tools, so yes some institutions will install 5 IDEs. However one of the key asks is around applications is. 1 size of install and 2.security requirements of the install 3. platform support of the install. A key driver for VS Code adoption is its a light weight tool in most cases is capable of being used across modules dependant upon the lesson/module being taught and in all cases its not about replacing x vs y, its about opportunities of using the best tool at the right time. Eclipse etc are all great tools so this instant saying they are bad tools! But if a student is doing 30 hours of Java in a module is worth the institution installing a vast range of tools sets, patching updating validating of those packages. We have seen the adoption of VSCode in education because of it supporting extensions for a number of popular languages in education from Haskell, Java, C# and its cross platform support. Additionally we have seen an adoption of electron also being a taught, which has resulted in a number of students building custom extensions for themselves and even their institution. Some of the key feedback at an institution level is cross, platform support the ability to build assessment tools and this requirement is increasing with a number of institution using online submission extensions for code checking and assessment submission. So yes its user decision to what they teach what tools they use to teach but ultimately someone is going to have to build a managed desktop image be in Windows, Linux or Mac and deploy this to the classroom if the apps cannot be managed and updated or labs simply don't have sufficient disk space then there is a issue that lessons will be impacted. Additionally coding experience in the classroom is limited and students will decide which tool they prefer and simply utilise those tools to undertake assignments/assessments or homework.- Anonymous
March 21, 2017
> A key driver for VS Code adoption is its a light weight tooldu -sh /usr/share/code/ -> 160MBdu -sh ~/.vscode -> 61MB (this includes the Java extension).So overall, Java development without a debugger in VSCode takes 220MB of disk space.Took Eclipse for Java development and unpacked it:du -sh eclipse/ -> 195MBAnd for that price, there is a debugger.Now, let's talk about RAM usage:Scenario: open a simple Maven project in VSCode and Eclipse, open the same .java file, trigger completion on the same locationps aux | grep eclipse -> shows %MEM=9.8ps aux | grep code -> shows multiple processes (which is expected by design of VSCode) with the sum of %MEM=9So VSCode is a bit better their, but a 10% gain isn't that strong.The arguments of disk space go in favor of Eclipse, the arguments of RAM consumption go in favor of VSCode; overall it's not really what can be factually used to highlight one tool is better than the other for teaching.- Anonymous
July 05, 2017
VSC doesn't include a debugger? What is the difference from this? https://code.visualstudio.com/docs/editor/debugging. You mean supporting the specific language?
- Anonymous
- Anonymous
- Anonymous
- Anonymous
July 05, 2017
The comment has been removed
- Anonymous
- Anonymous
March 20, 2017
The Easier File Mapping statement is misleading. For any Java application that goes beyond a single file, the layout NetBeans and Eclipse enforce is what's expected by the compiler in the JDK. The compiler can't find classes declared within packages otherwise, so Eclipse and NetBeans are saving the user from maintaining that layout by hand. As for the download size, the Eclipse download cited has full XML, Git, Gradle, and Maven support in it, and isn't being positioned as a teaching tool. Granted, while a download of just the Java tools would be larger than VSC's download, VSC's doesn't exactly contain support for all of the stated 34 languages.- Anonymous
July 05, 2017
Thanks Nitin. I updated that on my list: https://blogs.msdn.microsoft.com/user_ed/2016/02/05/why-should-i-teach-java-out-of-visual-studio-code-instead-of-out-of-eclipse-or-netbeans/So you made a point is that Eclipse, by default, isn't intended/ideal for teaching? Thanks!
- Anonymous
- Anonymous
April 26, 2017
Highly inaccurate and opinionated. VSC is a good tool. But there is no proof it is better for teaching Java.- Anonymous
July 05, 2017
Mark, Agreed. I don't think anyone is going to be able to prove anything, with so many variances at play, in the software, languages, and teacher needs. So I prefer to describe it as reasons to teach Java in VSC: https://blogs.msdn.microsoft.com/user_ed/2016/02/05/why-should-i-teach-java-out-of-visual-studio-code-instead-of-out-of-eclipse-or-netbeans/These reasons might not work for you. Are you a teacher? Thanks, Mark!
- Anonymous