Raised This Month: $51 Target: $400
 12% 

Best Tools (Java Script & C++)


Post New Thread Reply   
 
Thread Tools Display Modes
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-28-2017 , 03:38   Re: Best Tools (Java Script & C++)
Reply With Quote #21

Quote:
Originally Posted by Arkarr View Post
Still theory. Do projets by our own. I believe this is the best way to learn something. Not the fastest through.
Theory is important too. You can not learn pawn without learning theory first.
__________________
Relaxing is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 02-28-2017 , 05:38   Re: Best Tools (Java Script & C++)
Reply With Quote #22

Quote:
Originally Posted by Relaxing View Post
Theory is important too. You can not learn pawn without learning theory first.
I never said it was not. It is. For the basics. To understand what a variable, functions, pointer is. After that, you do projects, get into troubles, search solutions for that specific problem, end up trying to figure what was created before, egg or chicken, finally found your solution to your initial problem, finish your project. You have learned a way more then behind a book.

Books are cool when you want to get in details at very specifics things. To optimize a part of your code.

But that's just my opinion and shouldn't be taken as the only and correct truth.
__________________
Want to check my plugins ?
Arkarr is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-28-2017 , 06:42   Re: Best Tools (Java Script & C++)
Reply With Quote #23

Quote:
Originally Posted by Relaxing View Post
Theory is important too. You can not learn pawn without learning theory first.
You MUST learn both, theory and practice, they're attached to each other, if you don't learn both, you'll fail.
__________________
edon1337 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-28-2017 , 18:03   Re: Best Tools (Java Script & C++)
Reply With Quote #24

Quote:
Originally Posted by addons_zz View Post
I agree with,

https://www.joelonsoftware.com/2005/12/29/the-perils-of-javaschools-2/


https://www.joelonsoftware.com/2006/10/25/the-guerrilla-guide-to-interviewing-version-30/

For C++, `Eclipse IDE` with the right plugins is a awesome. NetBeans is not as good, but VisualStudio has also good features.
Summarizing, use both `Eclipse IDE with the gcc compiler` and `VisualStudio with the MSVC/VC++ compiler`. Why? Because is always good to have two point of views. However you should know how to simultaneously configure/setup both IDEs to be able to edit and run on the same project and files at the same time. On this requisite, `VisualStudio` is not handy (at least, it was not some time ago), because every new file on the project you need to drag and drop over the project. This happens because to run a project using both IDEs, you need to setup the project files (source code) to a external location to both `Eclise IDE` and `VisualStudio` projects. For eclipse, is just to point to a link and it automatically detect all files.

But as you are beginning, using only `VisualStudio` should be easier, and when you want to more power, go with `Eclipse IDE`. And when you start programming daily on several languages, go with `Sublime Text`.
How on earth to connect the C++ Complier with Sublime Text...?
__________________

Last edited by Relaxing; 02-28-2017 at 18:06.
Relaxing is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 02-28-2017 , 18:31   Re: Best Tools (Java Script & C++)
Reply With Quote #25

Quote:
Originally Posted by Relaxing View Post
How on earth to connect the C++ Complier with Sublime Text...?
From Sublime Text, where you write your C++ code, you call the C++ compiler:

__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 02-28-2017 at 18:35.
addons_zz is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-01-2017 , 06:08   Re: Best Tools (Java Script & C++)
Reply With Quote #26

With gcc/g++ it is easy for sure. I don't know how difficult it would be to setup Microsoft's compiler as it requires a project file IIRC.
klippy is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 03-01-2017 , 12:07   Re: Best Tools (Java Script & C++)
Reply With Quote #27

If you want to build with the Microsoft compiler, is also simple. Instead of use:
Code:
g++ --std=c++11 main.cpp -I . -o main
  1. You have to go to your folder where the `vcvars32.bat` is on, example: F:\VisualStudio2015\VC\bin
  2. Open a cmd prompt there
  3. Run the `vcvars32.bat`
  4. and change the directory to where your source code file is on and run:
    Code:
    cl /I. /EHsc /Femain.exe main.cpp
  1. Compiler Options
  2. cl.exe not finding any standard include file
  3. Walkthrough: Compiling a Native C++ Program on the Command Line
  4. Setting the Path and Environment Variables for Command-Line Builds


To run it from Sublime Text, and skip the `vcvars32.bat`part, you need to create a wrapper
for including the libraries/include folders on the visual studio files.

Create a file called `cl_env.bat` where your source code files are and put this to setup the
folder to your Visual Studio installation:
Code:
@echo off

:: Path to your Visual Studio folder.
::
:: Examples:
::     C:\Program Files\Microsoft Visual Studio 9.0
::     F:\VisualStudio2015
set VISUAL_STUDIO_FOLDER=F:\VisualStudio2015

:: Load compilation environment
call "%VISUAL_STUDIO_FOLDER%\VC\vcvarsall.bat"

:: Invoke compiler with any options passed to this batch file
"%VISUAL_STUDIO_FOLDER%\VC\bin\cl.exe" %*
Latter on the make file you can call `cl_env.bat`, instead of the `cl` compiler directly:
Code:
./cl_env.bat /I. /EHsc /Femain.exe main.cpp
Using Visual Studio's 'cl' from a normal command line
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 03-01-2017 at 14:17.
addons_zz is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 03-01-2017 , 15:22   Re: Best Tools (Java Script & C++)
Reply With Quote #28

Quote:
Originally Posted by addons_zz View Post
If you want to build with the Microsoft compiler, is also simple. Instead of use:
Code:
g++ --std=c++11 main.cpp -I . -o main
  1. You have to go to your folder where the `vcvars32.bat` is on, example: F:\VisualStudio2015\VC\bin
  2. Open a cmd prompt there
  3. Run the `vcvars32.bat`
  4. and change the directory to where your source code file is on and run:
    Code:
    cl /I. /EHsc /Femain.exe main.cpp
  1. Compiler Options
  2. cl.exe not finding any standard include file
  3. Walkthrough: Compiling a Native C++ Program on the Command Line
  4. Setting the Path and Environment Variables for Command-Line Builds


To run it from Sublime Text, and skip the `vcvars32.bat`part, you need to create a wrapper
for including the libraries/include folders on the visual studio files.

Create a file called `cl_env.bat` where your source code files are and put this to setup the
folder to your Visual Studio installation:
Code:
@echo off

:: Path to your Visual Studio folder.
::
:: Examples:
::     C:\Program Files\Microsoft Visual Studio 9.0
::     F:\VisualStudio2015
set VISUAL_STUDIO_FOLDER=F:\VisualStudio2015

:: Load compilation environment
call "%VISUAL_STUDIO_FOLDER%\VC\vcvarsall.bat"

:: Invoke compiler with any options passed to this batch file
"%VISUAL_STUDIO_FOLDER%\VC\bin\cl.exe" %*
Latter on the make file you can call `cl_env.bat`, instead of the `cl` compiler directly:
Code:
./cl_env.bat /I. /EHsc /Femain.exe main.cpp
Using Visual Studio's 'cl' from a normal command line
or:
PHP Code:
call "%VS<version number>COMNTOOLS%\vsvars32.bat" 
if your VS version has that capability, ex:
PHP Code:
call "%VS140COMNTOOLS%\vsvars32.bat" 
would set the executing CMD window to use VS 2015 tools.
__________________
WildCard65 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-01-2017 , 16:01   Re: Best Tools (Java Script & C++)
Reply With Quote #29

Anyway, you would want an IDE that's capable of working with projects, and not single-file programs. At least look into some build system, like AMBuild.
klippy is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 03-01-2017 , 18:07   Re: Best Tools (Java Script & C++)
Reply With Quote #30

Quote:
Originally Posted by WildCard65 View Post
would set the executing CMD window to use VS 2015 tools.
Mostly you do not want to a terminal to be opened and type the command line to build. You would want to the process to be one single step as type `make` from anywhere. On this case press F7 (build) on Sublime Text, and it already knows what to do.

You can work with projects on sublime. This is my `.sublime-project`:
Code:
{     "folders":     [         {             "path": ".",             "folder_exclude_patterns":             [                 "source/libraries/doctest/scripts/bench/catch",             ],         },         {             "path": "D:/User/Dropbox/Applications/SoftwareVersioning/SublimeText/Data/Packages"         },     ],     "build_systems":     [         {             "working_dir": "$project_path/source",             // "selector": "source.c, source.c++, source.c++11", // comment this to build from everywhere             "file_regex": "^(..[^:]*):([\\d+):?(\\d+)?:? (.*)$|^\\(.*\\)\\((\\d+)\\)(.*)$",             "name": "Build Main file",             "cmd": ["sh", "make_run.sh", "main"],             "variants":             [                 {                     "name": "Visual Studio Compiler",                     "cmd": ["sh", "make_run.sh", "visual_studio"],                 },                 {                     "name": "Catch Driver Class",                     "cmd": ["sh", "make_run.sh", "catch_tests"],                 },                 {                     "name": "Doctest Driver Class",                     "cmd": ["sh", "make_run.sh", "doctest_tests"],                 },                 {                     "name": "Do a Make Very Clean",                     "cmd": ["sh", "make_run.sh", "veryclean"],                 }             ],             // "target": "ansi_color_build",             "syntax": "Packages/ANSIescape/ANSI.tmLanguage"         }     ] }
This is the `make_run.sh`
Code:
FIRST_COMMAND_ARGUMENT=$1 if [[ $FIRST_COMMAND_ARGUMENT == "main" ]] then     make clean     make elif [[ $FIRST_COMMAND_ARGUMENT == "veryclean" ]] then     make $FIRST_COMMAND_ARGUMENT     make else     make clean     make $FIRST_COMMAND_ARGUMENT fi wait $!

And the `Makefile`:
Code:
PROGRAM_MAIN_FILE_NAME      = main PROGRAM_MAIN_FOLDER_INCLUDE = . main: $(PROGRAM_MAIN_FILE_NAME).cpp     g++ --std=c++11 $(PROGRAM_MAIN_FILE_NAME).cpp -I $(PROGRAM_MAIN_FOLDER_INCLUDE) -o $(PROGRAM_MAIN_FILE_NAME)     ./main visual_studio: $(PROGRAM_MAIN_FILE_NAME).cpp     ./cl_env.bat /I$(PROGRAM_MAIN_FOLDER_INCLUDE) /EHsc /Fe$(PROGRAM_MAIN_FILE_NAME).exe $(PROGRAM_MAIN_FILE_NAME).cpp CATCH_TESTS_FILE   = unit_tests/catch_tests CATCH_DRIVER_CLASS = unit_tests/catch_main catch_tests: $(CATCH_DRIVER_CLASS).o     g++ --std=c++11 $(CATCH_DRIVER_CLASS).o $(CATCH_TESTS_FILE).cpp -I $(PROGRAM_MAIN_FOLDER_INCLUDE) -o main     ./main $(CATCH_DRIVER_CLASS).o: $(CATCH_DRIVER_CLASS).cpp     g++ $(CATCH_DRIVER_CLASS).cpp -I $(PROGRAM_MAIN_FOLDER_INCLUDE) -c -o $(CATCH_DRIVER_CLASS).o DOCTEST_TESTS_FILE   = unit_tests/doctest_tests DOCTEST_DRIVER_CLASS = unit_tests/doctest_main doctest_tests: $(DOCTEST_DRIVER_CLASS).o     g++ --std=c++11 $(DOCTEST_DRIVER_CLASS).o $(DOCTEST_TESTS_FILE).cpp -I $(PROGRAM_MAIN_FOLDER_INCLUDE) -o main     ./main --force-colors=true $(DOCTEST_DRIVER_CLASS).o: $(DOCTEST_DRIVER_CLASS).cpp     g++ $(DOCTEST_DRIVER_CLASS).cpp -I $(PROGRAM_MAIN_FOLDER_INCLUDE) -c -o $(DOCTEST_DRIVER_CLASS).o clean:     $(RM) $(PROGRAM_MAIN_FILE_NAME)     $(RM) $(PROGRAM_MAIN_FILE_NAME).exe     $(RM) $(PROGRAM_MAIN_FILE_NAME).obj veryclean: clean     $(RM) $(CATCH_DRIVER_CLASS).o     $(RM) $(DOCTEST_DRIVER_CLASS).o

For Visual Studio, you would just replace the `g++` by `cl_env.bat` within the proper command line.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 03-02-2017 at 10:58.
addons_zz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode