[:tr]Merhaba arkadaşlar,
Bir çok yazımdan da anlayacağınız üzere windows üzerinde yazılım geliştirmek için Visual Studio’yu kullanıyorum. Ama bazı noktalarda daha ufak kod incelemeleri/güncellemeleri veya python tarzı betik dilleri kullanarak uygulama geliştirme ihtiyacı ortaya çıkabiliyor ve bunlar için de VS’i kullanmak biraz külfetli oluyor açıkçası. Bu amaçla, ben de son bir kaç senedir Sublime metin editörünü kullanıyorum (daha önce de Notepad++ kullanırdım). Kendileri oldukça kabiliyetli ve ihtiyaç duyduğum bir çok kabiliyeti içerisinde barındırıyor.
Takip ettiğim bazı sitelerde ve de özellikle yazımın sonlarına doğru bahsedeceğim bir ihtiyaç sonrasında microsoftun yeni geliştirmiş olduğu (yeni dediğime bakmayın siz ben yeni görüyorum 🙂 yoksa neredeyse 3-4 yıldır kullanılıyormuş) Visual Studio Code aracına denk geldim. Araç isminden de anlaşılacağı üzere VS’den alışageldiğimiz IDE arayüzlerini daha basitleştirilmiş bir şekilde sublime benzeri (“Command palette” özelliği de hani sublime’ı hatırlatmıyor değil 🙂 bir editör aracılığı ile sunuyor.
![]()
Aracın öne çıkarılan en önemli özellikleri:
- Bir kere bedava ve açık kaynaklı,
- Windows, linux ve mac desteği var,
- Mevcut editörlerde kullanılan kısayolları eşleme mevcut (Vim, sublime, IntelliJ, Visual Studio, vb.),
- Yerleşik bir çok araç desteği mevcut,
- Bir çok dil (Javascript, JSON, HTML, CSS, TypeScript, C++, Java, PHP, Python, Go, SQL, C#) için “IntelliSense” desteği mevcut (sitelerinde de bahsedildiği üzere sadece renklendirme değil aynı zaman koda tahminleme/tamamlama kabiliyetleri de sunuluyor),
- Kod ayıklama kabiliyetleri sunuluyor (bunun için derleme ve oluşturma eklentilerini aktifleştirmeniz gerekiyor),
- Git desteği yerleşik olarak sunuluyor,
- Belki de en önemli özelliklerinden birisi de uyarlama alt yapısı (Uygulama içerisinden ‘Ctrl+Shift+X’ ile erişebilirsiniz)
Daha detaylı bilgili için aracın dokümantasyon sayfasına erişebilirsiniz. Uygulamayı indirmek için indirme bağlantısına tıklayabilirsiniz. Açıkçası aracı kullanmaya başlayalı bir kaç hafta oldu ama hoşuma gitmedi desem yalan olur, ileride belki daha detaylı tecrübelerimi sizler ile paylaşırım. Açıkçası özellikle linux ve benzeri sistemlerde kullanımı bende merak uyandırdı, bu platformlarda çalışan yazılımperverler için iyi bir tercih olabilir.
VS Code ile C++ Uygulaması Geliştirme
Yazıma son vermeden önce hızlıca VSCode aracılığı ile hızlıca C++ programlama için takip etmeniz gereken adımları sizler ile paylaşacağım. (Bu arada, buradaki adımlar sadece bir yöntem başka eklenti veya araçlar ile de aynı geliştirme ortamını elde edebilirsiniz.)
- İndirme bağlantısına tıklayarak uygulamayı indirin ve kurun
- Daha sonra tarayıcıdan eklenti adresinden ya da uygulama içerisinden aşağıdaki düğmeyi tıklayarak eklentiler sayfasını açın

- C++ ile yazılım geliştirme için üç adet eklenti kuracağız. Bunlar: “C/C++“, “Easy C++ projects” ve “Doxygen Documentation Generator” eklentileri. Bunların her birini bir önceki adımdan veya eklediğim eklenti bağlantılarından kuralım,



- Bu arada “Easy C++ Projects” i kullanmak için gerekli olan derleyicileri öncesinden kurmanız gerekiyor. İlgili eklentinin sayfasında kullanılabilecek derleyiciler ve kurulum yönergelerini yardımcı olması açısından yazımın sonuna ekliyorum,
- Her eklentiyi kurduktan sonra ilgili eklenti başlığının orada “Reload to Activate” yazan mavi bir düğme çıkacak bunu tıklayarak ilgili eklentileri aktifleştirin,

- Evet artık VS Code ile C++ geliştirmek için gerekli ortamımız hazır oldu şimdi hemen bir örnek yapalım,
- Öncelikli olarak eğer Sublime kullandı iseniz genel olarak bu tarz editörler VS deki “solution” ya da proje benzeri yaklaşımı farklı dizinler oluşturarak gerçekleştiriyorlar. Bu bağlamda önce projemiz için bir dizin oluşturacağız. Bunun için de “File -> Open folder”‘a tıklayalım ve diskte istediğimiz bir yer “VSCodeExample” isimli bir folder oluşturalım. Bunu oluşturduğumuz zaman soldaki “Explorer” panelinde ilgili başlığın geldiğini göreceksiniz:

- Şimdi “Command Palette” ‘i açmak için F1’e basalım. Aşağıdaki gibi bir listenin görüntülenmesini bekliyoruz:

- Burada ilgili girdi kutusuna “C++” yazıp gelen “Easy Cpp/C++: Create new C++ project”‘i seçiyoruz. Bunda sonra ilgili derleyici listesi geliyor,

- Ben örnek için “[MSVC] Windows X64, Visual Studio Build Tools 2017″‘i seçeceğim. Bunu da seçtikten sonra ilgili dizin içerisine gerekli dosyaların otomatik olarak eklendiğini soldaki “Explorer” panelinde görebilirsiniz,

- Son olarak projeyi derlemek ve çalıştırmak için aşağıdaki “Build & Run” seçeneğine tıklamanız yeterli. VS Code kullanarak ilk C++ uygulamanızı geliştirdiniz 🙂
- Eğer düğmeye tıkladıktan sonra “TERMINAL” alanında aşağıdaki gibi bir hata ile karşılaşıyor iseniz sağda çıkan “Do you allow shell: “cmd.exe” …” penceresinden cmd.exe ye izin verin, ya da buradaki adımları da izleyebilirsiniz.
- 1234567891011121314The terminal process terminated with exit code: 1Terminal will be reused by tasks, press any key to close it.> Executing task: .\build.bat && .\bin\main.exe <At line:1 char:13+ .\build.bat && .\bin\main.exe+ ~~The token '&&' is not a valid statement separator in this version.+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException+ FullyQualifiedErrorId : InvalidEndOfLineThe terminal process terminated with exit code: 1

- Tekrar “Build&Run” a bastığınızda herhangi bir sorun ile karşılaşmadan aşağıdaki çıktıları görmenizi bekliyorum
- 123456789101112131415161718192021> Executing task: .\build.bat && .\bin\main.exe <************************************************************************ Visual Studio 2017 Developer Command Prompt v15.8.7** Copyright (c) 2017 Microsoft Corporation**********************************************************************[vcvarsall.bat] Environment initialized for: 'x64'x64 için Microsoft (R) C/C++ İyileştirmeli Derleyicisi Sürüm 19.15.26730Telif Hakkı (C) Microsoft Corporation. Tüm hakları saklıdır.main.cppMicrosoft (R) Incremental Linker Version 14.15.26730.0Copyright (C) Microsoft Corporation. All rights reserved./out:main.exe/debug/OUT:bin\main.exemain.objHello Easy C++ project!Terminal will be reused by tasks, press any key to close it.
Doxygen ile Kod Açıklaması Ekleme
Gelelim VS Code ile kodumuza doxygen uyumlu kod açıklamaları eklemeye. Açıkçası VS Code ile ilk ciddi karşılaşmam da C++ kodlarımı doxygen uyumlu kod açıklama için kullanacağım bir araç arayışı ile oldu. Bir eklenti buldum eklentinin VS için olduğunu düşünerek irdeledim fakat VS Code için olduğunu gördüm, oradan yav hele bir bakalım bu araca deyüp sonrasında taa bu yazıma kadar geldik.
Evet arkadaşlar VS Code Doxygen Documentation Generator eklentisi ile çok hızlı bir şekilde doxygen uyumlu kod açıklamaları ekleyebiliyorsunuz. Bunun için ilgili kod parçasından bir önceki satıra gelip (ör. tanımlanan metot veya sınıf veya dosyanın başlangıcı), “/**” yazıp “Enter” a bastığınız anda otomatik olarak bu eklenti ilgili açıklama şablonunu ekliyor (eğer gelmiyor ise ilgili eklentinin kurulu olduğu ve “Reload to Activate” dediğinizden emin olun).

Daha detaylı bilgi için ilgili eklentinin sayfasına başvurabilirsiniz.
“Easy C++ Project” Derleyici Kurulum Yönergeleri
Windows
- You must have MSVC or GCC installed:
- MSVC can be installed using Build Tools for Visual Studio 2017 from here
- GCC Windows 10: Install GCC and Make on Windows through WSL: Windows Subsystem for Linux setup
- GCC Windows 8.1 or lower: Install GCC and Make using Cygwin or MinGW
GNU/Linux
- Install GCC, Make and GDB using the package manager of your distribution, these are some of them:
- Debian/Ubuntu/Mint:
sudo apt install g++ make gdb - Fedora:
sudo dnf install gcc-c++ make gdb - Arch Linux:
sudo pacman -S gcc make gdb
- Debian/Ubuntu/Mint:
MacOS
- GCC: Check out Brew
- Clang:
- Open a Terminal
- Run the command
xcode-select --install - A dialog will appear telling you that it requires the command line developer tools, and asks if you would like to install them. Click on the “Install” button
Kaynaklar
Yukarıdakilere ek olarak aşağıdaki kaynaklardan da faydalanabilirsiniz.
- https://code.visualstudio.com/
- https://github.com/Microsoft/vscode
- https://medium.freecodecamp.org/an-overview-of-visual-studio-code-for-front-end-developers-49a4aa0771fb
- https://news.codecademy.com/visual-studio-code-sublime-text/
- https://blog.elmah.io/best-visual-studio-code-extensions/
- https://github.com/viatsko/awesome-vscode => Oldukça kapsamlı bir liste
[:en]Hello my friends,
As you may realized, I am using Visual Studio 2017 community for my C++ development activities. But sometimes, it might be required to find a simple tool to check code samples and to develop scripts which might be a little bit overshoot for Visual Studio. For this purpose, I have been using sublime editor for last couple of years (before that I was using Notepad++) which is very powerful and intuitive.
At some sites that I followed, and especially after a necessity that I will mention at the end of my post, I encounter with Microsoft’s new editor, Visual Studio Code (Well it has been around for 3-4 years 🙂 As it name implies, this tool provide Visual Studio like IDE GUI via sublime like editor.
![]()
The tool’s prominent features can be listed as:
- Free and open source,
- Support for Windows, linux and mac,
- The shortcuts of well known IDEs and editors can be used within this tool,
- Great extension and tool support,
- Intellisen support for various programming languages (Javascript, JSON, HTML, CSS, TypeScript, C++, Java, PHP, Python, Go, SQL, C#) . This suport covers not only coloring but also code completion,
- Debugging capabilities with associated compiler plugins,
- Built-in git support,
- In my opinion, the most important capability of this tool is extensibility (Corresponding plugins can be seen in a gallery which can be accessed via ‘Ctrl+Shift+X’).
For more details, you can check out tool’s documentation. To download the application you can click this link. Honestly, I have been using this tool for one or two weeks and it is not that bad but not enough for me to give up on Sublime 🙂 I really like Visual Studio IDE for programming C++, so if you are developing on Linux or similar platforms, this might be a good choice for you.
Developing C++ Application with VS Code
Before completing my post, let us look at the steps that we need to follow to develop a simple C++ application using VSCode. (By the way, this steps are based on some plugins, so there might be other plugins that you may use for this purpose.)
- Go and click to Download Link to download application and then install it,
- Open Extensions either from your browser (by clicking to eklenti adresinden) or clicking to button illustrated below

- We are going to install three extensions for developing C++ software which are “C/C++“, “Easy C++ projects” and “Doxygen Documentation Generator“. Install these extensions via the links that I provided,



- By the way, to use “Easy C++ Projects”, you need to install corresponding compilers beforehand. You can find supported compilers and how to use them at the end of post,
- After installing every extension, you need to activate corresponding extension by clicking to blue “Reload to Activate” button as illustrated below,

- Now, we prepared our environment to develop C++ application in VS Code. Let us try it via a simple C++ code,
- If you have used Sublime editor, you may remember that you can logically group your files via folders (like solutions in VS) which is also applicable for Visual Studio Code. So we are gonna create a folder for this purpose. To do so follow “File -> Open folder” and create a folder named “VSCodeExample” at your disk. You “Explorer” panel will be look like below:

- Open “Command Palette” via pressing F1. A list like below should be shown:

- Enter “C++” and then select “Easy Cpp/C++: Create new C++ project”‘. Then a list of compilers will be shown,

- I am going to select “[MSVC] Windows X64, Visual Studio Build Tools 2017″‘ for this post. After you made your selection, you can observe that necessary files are generated automatically and shown at left “Explorer” panel,

- Final step is to click “Build & Run” to compile and run our sample. Well, done! You have developed your first C++ application using VS Code 🙂
- If you encounter with an error as illustrated below in “TERMINAL” then allow cmd.exe shown in “Do you allow shell: “cmd.exe” …” window, or you also follow the steps given in this link.
- 1234567891011121314The terminal process terminated with exit code: 1Terminal will be reused by tasks, press any key to close it.> Executing task: .\build.bat && .\bin\main.exe <At line:1 char:13+ .\build.bat && .\bin\main.exe+ ~~The token '&&' is not a valid statement separator in this version.+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException+ FullyQualifiedErrorId : InvalidEndOfLineThe terminal process terminated with exit code: 1

- In case of no error, you should see the following lines in your Terminal.
- 123456789101112131415161718192021> Executing task: .\build.bat && .\bin\main.exe <************************************************************************ Visual Studio 2017 Developer Command Prompt v15.8.7** Copyright (c) 2017 Microsoft Corporation**********************************************************************[vcvarsall.bat] Environment initialized for: 'x64'x64 için Microsoft (R) C/C++ İyileştirmeli Derleyicisi Sürüm 19.15.26730Telif Hakkı (C) Microsoft Corporation. Tüm hakları saklıdır.main.cppMicrosoft (R) Incremental Linker Version 14.15.26730.0Copyright (C) Microsoft Corporation. All rights reserved./out:main.exe/debug/OUT:bin\main.exemain.objHello Easy C++ project!Terminal will be reused by tasks, press any key to close it.
Adding Code Comments with Doxygen
Now let us look at how we can use VS Code to add doxygen compliant code comments. Well, this is the in fact motivation for me to learn this tool. I was looking for a code commenter plugin in Visual Studio but most of them are commercial and could not found a tool in VS. Then I encounter with Doxygen Documentation Generator which I first thought that it is for VS. You can add simple doxygen based comments to your code easily. What you need to do is to move cursor to one line above the code segment that you will add comment and enter “/**”. Then corresponding code comment is added automatically. If it does not, check that no comment added before that line and also ensure that you installed extension and activated it.

For more information, you can check out extension page.
“Easy C++ Project” Compiler Installation Directions
Windows
- You must have MSVC or GCC installed:
- MSVC can be installed using Build Tools for Visual Studio 2017 from here
- GCC Windows 10: Install GCC and Make on Windows through WSL: Windows Subsystem for Linux setup
- GCC Windows 8.1 or lower: Install GCC and Make using Cygwin or MinGW
GNU/Linux
- Install GCC, Make and GDB using the package manager of your distribution, these are some of them:
- Debian/Ubuntu/Mint:
sudo apt install g++ make gdb - Fedora:
sudo dnf install gcc-c++ make gdb - Arch Linux:
sudo pacman -S gcc make gdb
- Debian/Ubuntu/Mint:
MacOS
- GCC: Check out Brew
- Clang:
- Open a Terminal
- Run the command
xcode-select --install - A dialog will appear telling you that it requires the command line developer tools, and asks if you would like to install them. Click on the “Install” button
References
You can also check out following links for more information about Visual Studio Code.
- https://code.visualstudio.com/
- https://github.com/Microsoft/vscode
- https://medium.freecodecamp.org/an-overview-of-visual-studio-code-for-front-end-developers-49a4aa0771fb
- https://news.codecademy.com/visual-studio-code-sublime-text/
- https://blog.elmah.io/best-visual-studio-code-extensions/
- https://github.com/viatsko/awesome-vscode => Oldukça kapsamlı bir liste
[:]
