0

I'm relatively new to coding and I'm setting up my local development environment. I've decided to start with VS Code and I'm off to somewhat of a rocky start. It's all a bit confusing. Whilst looking at the VS Code website to figure out how to start coding my first Python program, it was written that I had to "Start VS Code in a project (workspace) folder," by inputting the following code into the terminal:

mkdir hello
cd hello
code .

It does work, but is it necessary to do this to start coding an actual program? If so, why? And what does the code above actually mean and do? Basically, I'm asking if you could start coding outside of a folder.

syrrious
  • 7
  • 1
  • the code above simply makes a folder called 'hello', in the next line changes into that new folder (cd = change directory) and then you start vs code. I'm not really working with VS code, but I'm pretty sure, you can just start it and then open code files or project/solution files from within the program, just like any other IDE – Roland Deschain Jun 09 '20 at 20:30

2 Answers2

0

You are creating a directory and navigating to it With the code . you are starting Visual Studio Code in that directory (. points to the current dir).

You can perfectly just open VsCode from your start menu and open an folder and starting working there as well .

Sam Vanhoutte
  • 3,247
  • 27
  • 48
0

Yes you can definetely start coding in any language you want in a file and there is no need for opening it in a folder. Although it is recommended to do this in a directory(folder) as it makes your workflow more organised. Also there are some plugins for vs code which will work only when you are working in a folder.

Most of the times, when a developer is working on a project, he/she always prefers to open the entire project folder in the editor so as to keep it more structured. However, for small programs or code snippets, experimentation, etc you can surely use the separate file and write your code.