# Is Sublime Text a valid option for C++ development?

## Recommended Posts

Hi!
So, I really like Sublime, I like its design and its simplicity. My question is, is it a valid option to use Sublime for C++ OpenGL 2D game development?

##### Share on other sites

It's just a text editor. So you can't just use Sublime Text; you'll need a compiler at the bare minimum and you'll likely want a mechanism to organize your build (be it makefiles or something more complex) and probably a debugger as well.

But as far as the text-editing aspects of making games? Absolutely.

##### Share on other sites
1 minute ago, jpetrie said:

It's just a text editor. So you can't just use Sublime Text; you'll need a compiler at the bare minimum and you'll likely want a mechanism to organize your build (be it makefiles or something more complex) and probably a debugger as well.

But as far as the text-editing aspects of making games? Absolutely.

This might sound silly, but can't  I just compile and stuff through terminal or something?

Edited by SweetestDownfall

##### Share on other sites
9 minutes ago, SweetestDownfall said:

This might sound silly, but can't  I just compile and stuff through terminal or something?

Yeah, all the tools people use are eventually just running the compiler one way or another.  You can do it via a makefile, or actually invoking the compiler executable by hand if you want.

##### Share on other sites
30 minutes ago, SweetestDownfall said:

This might sound silly, but can't  I just compile and stuff through terminal or something?

Yes, you can certainly invoke your compiler manually from a command-line interface if you want.

##### Share on other sites
41 minutes ago, SweetestDownfall said:

This might sound silly, but can't  I just compile and stuff through terminal or something?

In theory, yes, but for anything other than tiny projects, you don't want to have to manually pass all 100+ filepaths to the terminal for your .cpp files, and don't forget proper library linking order, compiler settings, and in some cases conditionally including or excluding files based off of platform you are building the project for.

This is what makefiles are for. But makefiles are terrible to write and maintain, so people use other intermediary formats that are more human-friendly to use, that then get converted to the makefiles that then generate calls to the compiler. CMake is very popular, though I use QMake for my own projects (mostly because I use QtCreator as my IDE - but I also like the QMake system on its own). Boost has its own, and Visual Studio uses their own without using the GCC makefiles.

So yes, Sublime is fine for programming as your IDE, but you'll still want CMake or similar, for your "project" file (which is a plaintext file you can edit from within Sublime), and you'll still need a compiler (MinGW or Clang, for example) to actually do the compiling.

Sublime also costs money, so if you don't want to pay, Programmer's Notepad 2 is free and fairly nice. It might not be as slick as Sublime, but it certainly works well-enough, so you might want to give that a try and see if it suits your needs before deciding to go with Sublime.

##### Share on other sites

I personally did not liked Sublime Text. All what it provides are flashy things not really useful for programming.

As other posters told about alternatives, other editors like geany for example are very good. Geany is also a tiny IDE in the sense that it allows you to build and run your project from within the editor. I personally use it for little projects, editing some shaders or doing little websites.

To go back to the original question, yes you can do it. For a long I was living with vim (and/or gvim) and a console (threw automake makefiles). But as projects grew up, and as entering new projects, IDEs revealed to be a great help (you know you can click on a function and jump to its definition/declaration, you can hoover a variable and see its type, you can push ctrl-space and have completion to work). This saves time, and saves efforts, and saves frustration. This is really important to my opinion.

Edited by _Silence_

##### Share on other sites

Also bear in mind that well known IDE's support advanced debug features like setting breakpoints into your code while running, disassembling code if needed and also integrate code versioning by default (even if I not use the build in ones but one might do so)

##### Share on other sites

As said above, easy debugging is the feature that you want to go after. Especially when you are learning. Being able to break the program, see the current state is the No.1 tool that will shorten the learning curve the most. That's why I recommend Visual Studio Community Edition, it has the best debugger integration.

And do not worry about not learning how to call the compiler/linker manually, it is a trivial thing, and when you need if you need it you can always look it up, it's not a big deal.

So again, go after the debugger.

Edited by ongamex92

##### Share on other sites

I use Sublime for hobby projects (C-style C++ and shaders mostly) and I find it much more comfortable, fluid and frustration-free than Visual Studio's built-in text editor, that I use at work. For me it was enough to justify having to set up command-line compilation.

6 hours ago, ongamex92 said:

As said above, easy debugging is the feature that you want to go after.

Agree 100%, but using an external text editor doesn't really prevent one from debugging in VS - so why not enjoy the benefits of both? One can always edit code in Sublime, compile and Alt-Tab into Visual Studio to do some debugging.

##### Share on other sites

I use Sublime Text for most of my programming (C, C++ and D). I use Premake to manage the builds. I generally develop on Windows with MinGW and keep an MSYS 2 window open in the background. You can can configure Sublime to build from short-cut keys in the editor, but my fingers are so used to alt-tab followed by the up arrow once or twice for the command  I want (to generate a new makefile if I've added any new source modules, otherwise to build & run the program) that it's second nature to me now. That, and I don't like how the output looks inside Sublime when building from within it. Now and again, I'll generate a Visual Studio project to make sure it all still builds there.

So yes, it's a perfectly fine option for C and C++ programming if you don't mind working with the command line. I also like VS Code, especially its built-in terminal (ctrl-~ to open/close). I would probably prefer it if it were as snappy as Sublime, now that there's little separating them feature-wise. And the fact that I actually paid for Sublime 2 and upgraded to 3 makes me feel somewhat compelled to put it to use :-)

##### Share on other sites

I use Sublime for C++, Python, Lua (Love2D), HTML/CSS/JS, text files, scripts, etc.  On Windows and Mac.  Works fantastic for refactoring (quick macros, replace in files, etc).

Either build from command or configure it to run whatever build process (which also boils down to command line).  Depending on the project I use either approach.

It's lightweight so quick to start compared to Dev Studio and Xcode.  It's almost infinitely customizable.

The macro code view on the right is great for scrolling through large files.  The folder sidebar on the left makes browsing for files way faster than file.. open.

The downside is no debugger, no type aware name completion (it does look for symbols already existing in the same file which works 80% of the time).

I probably only use half of Sublime's total functionality, and I could probably do way more if I sat down and learned it all.  But what I know already makes me super productive in it.

If you want something free for Windows, also check out SciTE.  But on Mac it's \$40+ for some odd reason which is too much for a small text editor.

##### Share on other sites

There are two schools of thought on this:

- School A: The IDE should do everything (project management, code editing, debugging, etc) so you only stay in one GUI for the entire project lifecycle. Visual Studio (a great IDE) thinks like this. XCode (not as good an IDE) also thinks like this. Eclipse, Android Studio, and a bunch of others also follow this pattern. Sublime doesn't work very well in this world, not because of Sublime itself, but because the IDE isn't great at letting any outside tool in.

- School B: Each tool should do what it's good at. gcc, or clang, or cl, compile code. make, or nmake, or msbuild, (or ninja/sbt/cabal/scons/whatever) calls compilers to run builds. Vim, or emacs, or whatever you want, edits text. In this world, Sublime is totally fine. Call this "command line development" for lack of a better term.

There's also the question of how you generate your project files (for IDEs) or make/build files (for command line.) Tools like cmake, premake, automake, and so forth, take it upon themselves to scan through your source code and generate the necessary make/project files for whatever your target development environment is. When you need to develop for many environments, this may add value. When you're just doing a single environment, building a simple make file yourself is quite likely to be simpler.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628354
• Total Posts
2982231
• ### Similar Content

• By rXpSwiss
Hello,
I am sending compressed json data from the UE4 client to a C++ server made with boost.
I am using ZLib to compress and decompress all json but it doesn't work. I am now encoding it in base64 to avoid some issues but that doesn't change a thing.
I currently stopped trying to send the data and I am writing it in a file from the client and trying to read the file and decompress on the server side.
When the server is trying to decompress it I get an error from ZLib : zlib error: iostream error
My question is the following : Did anyone manage to compress and decompress data between a UE4 client and a C++ server ?
I cannot really configure anything on the server side (because boost has its ZLib compressor) and I don't know what is wrong with the decompression.
Any idea ?
rXp

• Hi all,

I'm starting OpenGL using a tut on the Web. But at this point I would like to know the primitives needed for creating a window using OpenGL. So on Windows and using MS VS 2017, what is the simplest code required to render a window with the title of "First Rectangle", please?

• I was wondering if someone could explain this to me
I'm working on using the windows WIC apis to load in textures for DirectX 11. I see that sometimes the WIC Pixel Formats do not directly match a DXGI Format that is used in DirectX. I see that in cases like this the original WIC Pixel Format is converted into a WIC Pixel Format that does directly match a DXGI Format. And doing this conversion is easy, but I do not understand the reason behind 2 of the WIC Pixel Formats that are converted based on Microsoft's guide
I was wondering if someone could tell me why Microsoft's guide on this topic says that GUID_WICPixelFormat40bppCMYKAlpha should be converted into GUID_WICPixelFormat64bppRGBA and why GUID_WICPixelFormat80bppCMYKAlpha should be converted into GUID_WICPixelFormat64bppRGBA
In one case I would think that:
GUID_WICPixelFormat40bppCMYKAlpha would convert to GUID_WICPixelFormat32bppRGBA and that GUID_WICPixelFormat80bppCMYKAlpha would convert to GUID_WICPixelFormat64bppRGBA, because the black channel (k) values would get readded / "swallowed" into into the CMY channels
In the second case I would think that:
GUID_WICPixelFormat40bppCMYKAlpha would convert to GUID_WICPixelFormat64bppRGBA and that GUID_WICPixelFormat80bppCMYKAlpha would convert to GUID_WICPixelFormat128bppRGBA, because the black channel (k) bits would get redistributed amongst the remaining 4 channels (CYMA) and those "new bits" added to those channels would fit in the GUID_WICPixelFormat64bppRGBA and GUID_WICPixelFormat128bppRGBA formats. But also seeing as there is no GUID_WICPixelFormat128bppRGBA format this case is kind of null and void
I basically do not understand why Microsoft says GUID_WICPixelFormat40bppCMYKAlpha and GUID_WICPixelFormat80bppCMYKAlpha should convert to GUID_WICPixelFormat64bppRGBA in the end

• Hi, New here.
I need some help. My fiance and I like to play this mobile game online that goes by real time. Her and I are always working but when we have free time we like to play this game. We don't always got time throughout the day to Queue Buildings, troops, Upgrades....etc....
I was told to look into DLL Injection and OpenGL/DirectX Hooking. Is this true? Is this what I need to learn?
How do I read the Android files, or modify the files, or get the in-game tags/variables for the game I want?
Any assistance on this would be most appreciated. I been everywhere and seems no one knows or is to lazy to help me out. It would be nice to have assistance for once. I don't know what I need to learn.
So links of topics I need to learn within the comment section would be SOOOOO.....Helpful. Anything to just get me started.
Thanks,
Dejay Hextrix
• By HD86
As far as I know, the size of XMMATRIX must be 64 bytes, which is way too big to be returned by a function. However, DirectXMath functions do return this struct. I suppose this has something to do with the SIMD optimization. Should I return this huge struct from my own functions or should I pass it by a reference or pointer?
This question will look silly to you if you know how SIMD works, but I don't.

• 10
• 9
• 11
• 24
• 11