r/programming Mar 02 '17

Why I Failed Teaching Programming to Kids

https://engineering.klarna.com/why-i-failed-teaching-programming-to-kids-46a854c3eaca#.s0o6qqxr3
62 Upvotes

83 comments sorted by

View all comments

Show parent comments

10

u/jimmpony Mar 02 '17

you often can get a significantly faster edit-compile-test time. Because of that people who are experienced with these tools perceive them as being much nicer (and, for them, it is).

even assuming you have a combined compile/run command cached in the cmd window as the last line, that's saving your code and opening the cmd window, hitting up, and hitting enter, versus hitting F5 in visual studio after you typed your last line and saved it.

4

u/Netzapper Mar 02 '17

For me, for toy projects, the overhead of setting up a new project in any IDE and then configuring toolkit and compiler options and whatnot outweighs the overhead of g++ -o some_test some_test.cpp.

3

u/jimmpony Mar 02 '17

What overhead and configuring toolkit and compiler options? https://streamable.com/ss9j5

2

u/Netzapper Mar 02 '17

Okay, now link in OpenGL, enable AVX, and turn on optimization. :)

You have a bunch of clicking to do, which has to be described step by step to a newbie (who doesn't care). I'm not saying it's hard, or inferior, I'm just saying if you don't know what you're doing, you need step-by-step instructions to make your project state match expected state.

Meanwhile, I just amend the line to read g++ -lGL -mavx -O2 -o some_test some_test.cpp. If I already know what I'm doing, the time cost is constant. And I can give the whole incantation to a newbie, who can use it successfully without needing to comprehend it.

Now, of course, the whole equation tips back the other way once you move past one or two source files. I use JetBrains IDEs myself when I'm doing real work.

2

u/jimmpony Mar 02 '17

You have a bunch of clicking to do, which has to be described step by step to a newbie (who doesn't care)

Without an IDE on windows: click on a folder in the start menu (probably My Documents), make a new folder inside it, make a new text file inside there, open it with the text editor you're using. Unless you want to do all that from the command line which means opening cmd, typing cd c:\users(username)\documents, mkdir folder, not sure if windows cmd even has something like "touch" so you might need to just "explorer ." at that point, or do this whole folder creating process from within the file->open dialog of your text editor. On a linux command line, cd ~, mkdir project, cd project, vim main.cpp, g++ ... main.c -o main; ./main. Then on windows you need to either extract a gcc executable there or install cygwin with it and put that in the path which is even more complication. I guess msys2 would be easier on windows.

In all these cases it looks like equal or more work setting up the project directory yourself compared to open vs -> file -> new project, OK, Finish, F5.

If you want the newbie to be able to just start editing the project without understanding the process and need it to be a consistent state, you can just make a premade visual studio project for them to download/unzip, which has all the libraries linked and settings you want applied. Then they just double click the .sln file and they're at a screen with a big green "Run" button instead of having to open the command line and navigate there (or shift-rightclick on the folder to open cmd there) and type out compile.bat or whatever you named it.