Wow, it's been an age since I've written a blog here. Something I've picked up on recently is learning how to code in C++ and one of the things I like to do with C++ is create Empty CLR Projects targeting the .NET Framework in Visual Studio. So a while back I had a great idea, I wanted to make myself an IDE (somewhat). Right away, you're probably asking "Why? Why make an IDE when you have Visual Studio and you can use other IDEs such as EclipseIDE and Notepad++?" and my simple response is just for the hell of it. It's a great learning experience and at the end of the day you can learn a lot.
The first step is the layout. Every IDE has a layout that usually goes something like MenuStrip and multiple ToolStrips and somewhere to throw the code and if the IDE is advanced enough there might be an output log if a compiler is included and maybe even a solution explorer. When I was done with the layout then I had to anchor each element so the elements will change size whenever the form changes side. When I was all done creating the layout, I ended up with an application that looked like this:
The next step was to add code to everything. I wanted my IDE to be able to compile a script and fortunately Windows now comes with two little applications called "csc.exe" (the C# Compiler) and "vbc.exe" (the Visual Basic Compiler) located in %SystemRoot%\Microsoft.Net\Framework\<dotnetversion> so all I had to do was copy all the contents of the folder into another folder inside the executable's path. Then I set my IDE to be able to compile a script that is open in the IDE or one that is located elsewhere, but I hadn't added the option to compile multiple files so you can only compile one script.
What you just looked at and read was my experience with creating an IDE in Visual Basic.NET, now I am in the process of creating a new one in C++/CLR.
For you kiddies at home that want to create your own IDE, my advice is just don't. Why reinvent the wheel when you can use it? Use Visual Studio 2019 Community which is 100% free and supports lots of languages such as C++, C#, F#, Visual Basic, XAML, HTML, ASP.NET, TypeScript, etc. But if you absolutely want to create an IDE, here's some of what you should know to make something decent:
- Developing your own IDE is basically creating a notepad with numbered lines for coding.
- The element I used for the textbox is the RichTextBox and I set the language to Courier to make it look somewhat right. Turn off WordWrap and make sure you have scroll bars visible.
- Some people prefer to have an IDE that will detect the language (which changes text color for certain things), autofill and suggest code.
- Your IDE should be able to detect errors in code and prevent the app from being compiled.
- You should have basic knowledge about how to use a compiler (what I did for my IDE is I made the Custom Compilation Settings menu detect what compiler is selected, what the extension of the file is, i converted the text for file to compile and use the same string for the output file, then delete 2 characters to add the exe extension, convert that text into a string, and then for the compile process simply did 'Process.Start("vbc.exe", "-out:" + outputfilename + " " + sourcefile)' whereas outputfilename is the Output File text box text and the sourcefile is the File to Compile text box text.
You need to be logged in to comment