Is there a tool to ask the computer how it can understand code?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

chrisw
Posts: 4313
Joined: Tue Apr 03, 2012 4:28 pm

Re: Is there a tool to ask the computer how it can understand code?

Post by chrisw »

Dann Corbit wrote: Fri Nov 09, 2018 9:19 pm
mar wrote: Fri Nov 09, 2018 1:33 pm {snip}
You should learn a bit about C++ before trying to understand C++ code.
Don't those two things go hand in hand?

But it probably would be a good idea to read Bjarne Stroustrup's books.
Yes, I was going to say that too (the hand in hand).
I find, since I restarted doing code recently, that there is so much of everything and everything moves so fast, that it’s best to work with a subset of the thing you are working in, you can always look stuff up anyway and, reversing a habit of a lifetime, it’s a good idea to go in at the highest level you can. I tended to just naturally code in C++, but now I discovered Python.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: Is there a tool to ask the computer how it can understand code?

Post by syzygy »

Uri Blass wrote: Thu Nov 08, 2018 6:25 amI take the following line in stockfish's code that is the first line in main.cpp line 37

Code: Select all

std::cout << engine_info() << std::endl;
Do you want to find where the implementation of "engine_info()" can be found, or do you want to figure out what std::cout is doing?

For std::cout, just look here:
https://en.cppreference.com/w/

The search function brings you to here:
https://en.cppreference.com/w/cpp/io/cout

std::cout and the << operator are just unnecessarily "cute" ways to print stuff.