Answer the question
In order to leave comments, you need to log in
What are some ways to facilitate the process of testing and editing code?
I use Visual Studio Code, most likely I do not use it to the maximum, but I'm not sure what exactly I need to use in it or maybe switch to another editor that is more convenient.
Usually I write the code in one file, if it doesn’t work as it should, I think it through and in order not to lose the original look, I create a new file (test1, test2, test3), transfer the code there and redo it, and if anything I return to the first option. Thus, I accumulate a lot of garbage, because I forget to delete and in general it is not very convenient, and I can get confused in the files, especially if I solved many tasks in a short time. To test the code, I insert print() lines between different lines of code and monitor the output that way. If I need to edit and check only part of the code, again I create a new file and test the piece of code there.
I know that there is a terminal and it seems like you can check a piece of code there, but for example, if I want to check the data type of a variable, I need to copy all the code associated with the variable to the terminal, otherwise it will not understand where the variable came from, etc. I also know about GIT technology, but I'm not sure if I should use it for algorithmic Olympiad problems?
Therefore, please advise ways to simplify testing and code editing as much as possible.
Answer the question
In order to leave comments, you need to log in
There is only one solution here - take a sheet, a pen and paint the algorithm before you start implementing it. First, with a diagram (you can use a flowchart), then with words, then write code.
Problem with "test1, test2, test3"
All over the civilized world, whatever problems with "test1, test2, test3" use Git.
Create a new branch and post. It works - you pour it into the main one, if not - you delete it.
At first, it’s a little stressful, especially if you haven’t worked with Git at all, but then, on the next rollback to one command in the terminal, you understand how convenient it is.
If I need to edit and check only part of the code, again I create a new file and test the piece of code there.
I use online sandboxes in my work. Especially when you need to develop some tricky function in a large and complex application.
ways to make testing and editing code as easy as possible.
As mentioned above, think before you start writing code. Understand how you will solve it. Think through the algorithm you want to write. If this is not done, then no editor and none of its capabilities can help you.
I know that there is a terminal and it seems like you can check a piece of code there ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question