Developing MATLAB code in Visual Studio - visual-studio

Is there a MATLAB add-in to Visual Studio?
I found an old one that works with Visual Studio 6. There's also the Eclipse plugin, but I prefer Visual Studio as an IDE.

However familiar you are with VS, I would recommend abandoning it when you use Matlab. I've used multiple IDEs while developing code for Matlab, and I always come back to the built-in editor.
Matlab's editor is easy to use, and fully integrated with the program. Since Matlab is a scripting language, the debugger is also very flexible and interactive.
There are many useful features of the editor that would be (most likely) impossible in VS, including:
Group your code into "cells", which allow you to evaluate blocks of code on the fly
select some portion of your code, and evaluate it
an interactive variable editor, which is available both during debug mode, and outside of it
a command window that allows you to evaluate commands
a powerful command history, which allows you to view and evaluate past commands.
evaluate commands or other blocks of code while in debug mode. In fact, you can call any piece of code while debugging, and even debug that code as well!
tab completion for all variables, and functions currently on the Matlab path
The M-Lint feature helps improve code quality by providing feedback (in the form of underlines) on both errors and questionable usage
An example:
You are debugging a function, and you come to a tricky line of code to debug. Instead of stepping over that line, you can highlight it and evaluate it in the command window, or even some small portion of the line. In this way, you can fix your code iteratively without ever leaving the debugger.
The only time I would recommend using VS for Matlab, is when writing/debugging MEX functions. You won't use VS to compile them, but VS is definitely a better IDE for writing C/C++ code.
When developing software, always use the IDE that is best suited for what you are doing. Learning a new IDE can be daunting, but Matlab's editor has a relatively low learning curve compared to others.

Related

Debug project written in multiple languages in VSCode

I am wondering how people typically go about debugging applications that are written in multiple languages.
For example, you could have some javascript that calls some back end python code. Is there a way to set up debugging so that you can start debugging in one language i.e. javascript, and then switch to the python debugger once that bit of code gets called?
My use case is with PowerShell and some .NET class libraries but it seems like there might be a broader set of use cases.

Which is better way of profiling using VTUNE: standalone or integrated with MSVC

I am getting certain errors while running VTUNE stand alone, but every thing works fine if I run it from MSVC IDE.
Will there be any reporting inaccuracy if I run VTUNE from inside the MSVC?
Which VTune version do you use? In general MSVS-integrated version of VTune provides exactly the same functionality as "Standalone". And of course there is no difference in accuracy at all.
MSVS vs. "Standalone" choice is a matter of your application and working style. In case you use MSVS for development purposes (and thus you have solution and sources integrated), using MSVS integrated version should be more convinient in terms of "more automation" for source viewpoints. At the same time some people prefer to use profiler in standalone manner, because their solutions are already overloading IDE process, however it's a rare case even for big legacy industry codes.
Side note: across other Parallel Studio tools (VTune, Inspector and Advisor XE, as well as Composer=Compiler+Libraries) - you may really find features enabled in different ways in MSVS and Linux/Standalone. Examples: 1. Inspector debugger integration with cl vs. gcc/gdb 2. Advisor Annotation Wizard vs. Assistance window. However VTune doesn't have even those small variations between hosts.

Converting OCaml to F#: Is there an OCaml IDE with GUI debugging like Visual Studio

I am converting several modules from OCaml to F#. To hunt bugs and verify some of the finer differences I am running both versions against the same test case at the same time.
For F# I am using the Visual Studio debugger and for OCaml I am using ocamldebug. Since Visual Studio is a GUI and ocamldebug is a command line, making the comparisons requires more attention than back and forth visual scanning.
I was wondering if there is any OCaml IDE that supports a GUI debugger with stepping while showing the source line highlighted and separate window to display values.
EDIT
I did some more looking after Jack posted an answer and then remembered why I didn't pick one a few months ago when I did this.
The reasons I am passing on the ones I find and staying with the OCaml command line tools are
The command line tools come with the compiler, so they are current and work. There is some documentation on the tools, but honestly I did have to spend a few hours writing my own ocamldebug manual with examples to become proficient with ocamldebug.
They rely on EMACS. It's not EMACS but me; I just hate the way it works. Also all of the tools working with EMACS I found they are just wrappers around ocamldebug. So nothing gained but more memorization of commands. Note: EMACS is actively maintained and updated.
They rely on Eclipse. I have used Eclipse a lot for working with ANTLR, but I only make a system every few years and have very good notes on it so it is worth my time. Once I get Eclipse working for a major ANTLR release, I don't update it again for years. For the small amount of time I plan on debugging OCaml, the cost is too high. Note: Eclipse is actively maintained and updated.
They don't do debugging. Since there are so few GUI tools for OCaml, even an enhanced editor is a benefit for some. Not for me at this time.
The tool/plug-in has not been maintained for some years.
This not a put down of OCaml, just the details as I find them. I don't have a problem with OCaml, I just wish I was more productive with it.
I think most people are just using the OCaml debugger (ocamldebug) from within emacs (see the bottom of that page for details).
I don't know if it supports debugging (yet), but the TypeRex OCaml Programming Studio looks like an interesting project.
Finally, there are some old, unmaintained Eclipse plugins you could try (e.g., Camelia), though I suspect they've bit-rotted for too long to be of much use at this point.
I was unable to find an OCaml GUI debugger with the same ability as Visual Studio using F# that meet my requirements.
If someone does find one or creates one and post that as an answer I will gladly give them them accept vote.
I was wondering if there is any OCaml IDE that supports a GUI debugger with stepping while showing the source line highlighted and separate window to display values.
I'm only just getting back into OCaml and Linux now after a 4 year break but, last I looked, Linux had very poor GUI libraries and OCaml had very poor interoperability so nobody ever got very far writing non-trivial GUI applications in OCaml.

Visual Studio 2010 hangs during debugging of C++ / CLI (mixed mode ) projects

After Google the issue i found that it was reported already but nothing useful yet from MS. I wonder if any one found a work around it?
Another option is to use windbg. You'll have to do a lot of commands by hand, but it's the best debugger out there. It handles mixed mode without any major issues. It has a bit of a learning curve, but it's very versatile.
Visual Studio's debugger is really not reliable when debugging mixed mode applications. Taken from my answer here #5965771:
If you're trying to debug a piece of native code try to use a native project as the debugger start-up application. Under the project settings, "Debugging" tab set the "Debugger Type" to "Mixed", for us this helped sometimes (the native project can be a DLL for example, simply set your main Exe as debugging target in the project settings);
OR, as already mentioned in another answer: Use WinDbg! With it you can debug both managed/unmanaged mixed code applications much more reliably.
use a different debugger, or don't use the debugger at all, just trace to a file or insert breakpoints in the code with inline assembly language.

Latex plugin for visual studio 2010

I am looking for a latex plugin for Visual Studio 2010 (preferably free) .
Features it must have:
Code folding
Syntax highlighting
AUTOCOMPLETION
Error Handling
I do not think there is anything available for VS.
As an alternative, I use eclipse with the texlipse plugin. It has all of the features on your list. I do not use windows but ubuntu with eclipse, R, MySQL and Sweave is sufficient to cater for all my data connection, management, manipulation, analytical and reporting needs. All the tools listed are available on Windows with sufficient connectivity to SQLserver with RODBC.
I do not think that there's anything that comes close to what you want to do. But as far as I know, you can - in principle - use Visual Studio with any programming language. If you have enough time to configure it properly.
You can create your own LaTeX-specific language service. Moreover, you would have to create own build rules.
But since I think that is too much work, I recommend TeXnicCenter, a freeware program that has syntax highlight, autocompletion and error handling. I'm not sure about code folding, but I think it does not have this.
Another freeware is LEd (LaTeX Editor), that should have all the features you like, but as far as I remember, I was not that happy with code completion.
A good choice for a LaTeX Editor is TeXWorks. You should try it, since there is no LaTeX support for Visual Studio.
Actually I think MS VS has been developed as a programmers 'editor'. Of course it's much more than just an editor, but editing (la)tex files doesn't fit into this model. So it's better not to waste the time and to try other solutions. I suggest open-source Lyx which is available on Linux and Windows (and AFAIK on Mac OS) platforms and easy to use. Just try it while waiting for other (possibly better) answers.
Visual Studio Code with LaTeX extension is available. It is free of charge as well.

Resources