Jump to content

VS Code and some other installation & config questions.


Recommended Posts

I am trying to familiarize myself with, install and configure Visual Studio Code, but this seems like you have to be a skilled programmer just to set up VS Code. Among other things, there is a file called Json, or something similar. This file that needs to be configured. Have no idea what this is, or what to do with that file. Here you have to enter commands and paths that I have no idea what they are, or how they should look/point to etc. I will primarily use VS Code for PHP, MySQL and Python, and eventually for JavaScript. Is there anyone in here who can help me with the installation and configuration?

During the installation, I get to a step where I have to choose from several boxes, but I can't find anything about debugging PHP or MYSQL, which I will primarily use VS Code for, and what is this Docker and GitHub? Do I need it, and for what? I'm still new when it comes to programming, so I need input at the feeding me kindly T-Spoon level. Can someone please help me understand this?

Link to comment
Share on other sites

...okay, yeah, new, I can see that...

 

4 hours ago, PeterBubresko said:

Among other things, there is a file called Json, or something similar.

I don't know what you mean by that. JSON is a syntax for writing data, and VS Code does use JSON for most of its data, but it's also not something you typically have to deal with - like, there is a regular UI for changing most settings.

4 hours ago, PeterBubresko said:

Here

Where?

4 hours ago, PeterBubresko said:

you have to enter commands and paths that I have no idea what they are, or how they should look/point to etc.

VS Code is designed for use with many things done through a keyboard. By which I mean, for a lot of things you might want to do, you do so through the "command palette" and not by clicking a button somewhere.
For example, if I want to select a lot of lines in a file and sort them, there is no menu I can click through to find that. But if I open the command palette and type "sort", I have the option of "Sort Lines Ascending" (and some other things) that I can choose.
That's not to say you don't use the mouse. There's still lots of things that you can/should do through clicking, but VS Code isn't like MS Word or something where there are toolbars to navigate through.

So that's what I think you mean by "commands". I don't know what "paths" you are talking about, but that word typically means a file or directory.

4 hours ago, PeterBubresko said:

During the installation, I get to a step where I have to choose from several boxes,

I don't know what the installer is asking for, but you don't have to answer everything right now. If you don't know what it's asking about then just skip it and deal with everything after.

Once you get it installed and started up, you can install extensions. VS Code does a few things "out of the box", but there are many things it won't and you're supposed to install extensions to support it. And there are tons of extensions.
Basically, if you want PHP stuff, you open up the extensions page and type "php" and then install whatever you want. Extensions are a community project so sometimes you'll find there are multiple competing or overlapping extensions and you'll probably have to do a little research to decide which ones you want - if you don't just judge popularity by their download counts.

For PHP, the main extension I use is "PHP Intelephense", so that's a good start. For MySQL, it'll depend on what all you want to be able to do, but I bet VS Code has some syntax highlighting built-in so maybe you don't have to install anything more. For Python, it looks like the "Python" extension (by Microsoft) is the main one, potentially "Python Debugger" if you want to do that, and maybe a couple more of the popular ones might be good too.
Javascript support is mostly built-in so I don't know if you need any extensions for that - I don't have any and everything works as I want.

4 hours ago, PeterBubresko said:

and what is this Docker and GitHub? Do I need it, and for what?

Docker is... well, too complicated for you right now. Don't worry about it. Basically, it's a way of running things on your computer without having to install them alongside all your other regular software.

GitHub is a code storage site: you sign up and they let you upload your code there so it doesn't all have to stay on your computer. Don't worry about that for now either.

  • Great Answer 1
Link to comment
Share on other sites

4 hours ago, requinix said:

...okay, yeah, new, I can see that...


Thank you requinix.

I understand that Docker is complicated, and I don't see that it's something I absolutely need, at least not yet. But the questions still arise. As I understand you, and what I have read about Docker online, Docker is "a place" where you find PHP, MySQL etc. as a kind of pre-installed "something" so that you don't have to burden your computer with heavy tasks and in some cases to save space. When it comes to saving storage space, I guess GitHub is a more suitable place/service, because as I understood you, it's something that can be compared to a "repository", because that's what it is, right?
I don't know if I'm on shaky ground now, but in my small-scale hobby programming projects, it's just as well for me to install MySQL and PHP locally on my computer and let "my old trotter" struggle a little more, it's despite all not the heaviest tasks I feed my computer with.
As for GitHub, this seems more applicable and more relevant to me. A question that quickly arose, and which I think I have heard talked about or read online. Does GitHub work in two different modes? Is it designed so that in public mode the code is open to everyone so that they can go in and correct the code or comment on the code? By correcting the code, I mean that you can give help and get help from others who can read the code on GitHub. Maybe I was completely wrong now? Eagerly waiting for a reply.

Link to comment
Share on other sites

Regarding Docker, there are two fairly common problems with software:
1. If I want to edit and test and run code, if the code has particular requirements, I have to set up my machine with those requirements. And that makes it hard to edit/test/run other code which has similar but different requirements.
2. When I want to deploy my edited code, it has to run on a server, and that server has basically the same sorts of requirement problems.

What Docker does is solve those by providing a self-contained environment. So I can edit and test and run code in its own isolated environment, with its own requirements, then do that with other code at the same time without worrying about the two of them conflicting.
Those problems used to be solved, not that long ago, by virtualization. Which is a self-contained environment too. The difference is that virtualization was basically a tiny little software-based computer that you'd have to boot up and such just like an actual computer, while Docker uses features in your operating system to give you something isolated without having to deal with that full "computer" experience.

12 hours ago, PeterBubresko said:

Docker is "a place" where you find PHP, MySQL etc. as a kind of pre-installed "something" so that you don't have to burden your computer with heavy tasks and in some cases to save space.

"Docker Hub" is a central place for people to upload their "images", which are basically archives of all the files needed for whatever. For PHP, there are images that give you php-fpm, and those images contain all the files php-fpm needs to run. Same for MySQL, and Apache, and tons and tons of other things.
What one typically does is then assemble those images into a "stack" and then add a little configuration to make them talk to each other. So you take php-fpm plus MySQL plus Apache, have php-fpm talk to MySQL, have Apache talk to php-fpm, and then you can point your browser to the Apache piece and have a fully-functioning site. All without having to actually install php-fpm or MySQL or Apache on your computer.

It's not a total improvement, though. Like, it is going to take up more disk space: those images have php-fpm/MySQL/Apache installed in them, but remember that each image is isolated, and that means each image also needs some amount of installed libraries and whatnot, resulting in taking up more space. Plus, the way images work, there's also some wasted space going to happen. However, the benefits of dealing with Docker greatly outweigh concerns of space usage - especially in a day and age where disk space is plentiful and cheap.

12 hours ago, PeterBubresko said:

When it comes to saving storage space, I guess GitHub is a more suitable place/service, because as I understood you, it's something that can be compared to a "repository", because that's what it is, right?

GitHub provides an internet-hosted git repository for you to use, but it's not a replacement to having files on your own computer. You still want everything available to you to edit and all that. But it does offer a number of advantages, like acting as a backup, and having a place to coordinate work with other people, and a bunch of other things.

That's why I say you don't have to worry about it for now. It doesn't provide some sort of brand-new development experience that will fundamentally change what you're doing now. It provides additional features.
That said, the one thing that would be useful to take out of it now would be as a place to back up your work: do what you want, "commit" (save) your changes, "push" (upload) them to GitHub, and then not have to worry about losing all your work because your computer caught on fire.

GitHub isn't the only such place, of course. GitLab and Bitbucket are two popular alternatives, and they all provide basically the same sorts of features.

12 hours ago, PeterBubresko said:

Does GitHub work in two different modes? Is it designed so that in public mode the code is open to everyone so that they can go in and correct the code or comment on the code? By correcting the code, I mean that you can give help and get help from others who can read the code on GitHub.

"Mode" isn't right, but otherwise yes.

When you make a git repository in GitHub, you have the choice of making it public or private. Public repositories are public: anyone can see it and read the code, anyone can "fork" (copy) it for themselves, and anyone can "submit pull requests" (suggest changes) - though you're not forced to accept the changes, of course. Private repositories are the opposite.
And yes, you can change your mind later.

Link to comment
Share on other sites

14 hours ago, requinix said:

"Mode" isn't right, but otherwise yes.

When you make a Git repository in GitHub, you have the choice of making it public or private. Public repositories are public: anyone can see it and read the code, anyone can "fork" (copy) it for themselves, and anyone can "submit pull requests" (suggest changes) - though you're not forced to accept the changes, of course. Private repositories are the opposite.
And yes, you can change your mind later.

First thing first: What do the three letters, GIT, mean in GitHub? What is a GIT?

Apart from that, the word "mode" was used in a lack of a better word.

Thank you for all your well-explained answers.

Since I'm a small-scale "hobby programmer", I'll give GitHub a chance, but it will probably mostly be in private "mode". Docker has a utility value equal to zero in my eyes. So, I may have more questions about GitHub coming up.

 

Edited by PeterBubresko
Link to comment
Share on other sites

8 hours ago, PeterBubresko said:

First thing first: What do the three letters, GIT, mean in GitHub? What is a GIT?

git is a tool to track and manage changes to files. There's no way to properly explain it here, but the point of it is that you can make changes to files and keep a full history of everything that's happened.

It's something you should start learning to work with now, as it's practically universal with software programming, but you can slowly ease yourself into it. The main concepts to deal with now are cloning (making a copy of the repository that's in GitHub), pulling (downloading recent changes), committing (saving the changes you've made locally), pushing (uploading everything back to GitHub).

Link to comment
Share on other sites

To build on what requinix has said about git, there are GUIs available to make life easier. Especially when you're starting out using the command line to deal with git can be confusing and a bit daunting. I've been coding for decades and still use Sourcetree because I'm more comfortable when I can see the graph (don't worry about what that means for now). And my memory is crap so remembering the exact commands and parameters is tiring.

As for VS Code, I'll just agree that PHP Intelephense is required - I also use PHP DocBlocker, which rocks. There are other extensions for HTML, MySQL, and JavaScript as you grow, as well as framework-specific extensions depending on where your journey takes you.

Link to comment
Share on other sites

On 9/24/2024 at 4:10 PM, PeterBubresko said:

I am trying to familiarize myself with, install and configure Visual Studio Code, but this seems like you have to be a skilled programmer just to set up VS Code. Among other things, there is a file called Json, or something similar. This file that needs to be configured. Have no idea what this is, or what to do with that file. Here you have to enter commands and paths that I have no idea what they are, or how they should look/point to etc. I will primarily use VS Code for PHP, MySQL and Python, and eventually for JavaScript. Is there anyone in here who can help me with the installation and configuration?

The first thing we need to know is what workstation/operating system you are using.  

Web Development is non-trivial. People misunderstand this because they see that HTML is easy, and then CSS and a little bit of javascript, and everything works.  They get a simple PHP script up, and think "wow this is easy".  Then something doesn't work the way they expected, and they can't debug or figure it out, and get completely lost, because they don't have any foundation or fundamental understanding of how the web actually works.   We see it here weekly, I would guess.

There are many different ways to proceed with development, as well as many different deployment platforms, and architectures that are used.  So there's no easy answer on exactly what pre-requisites or plugins might be helpful to you.

To add to the Web Development with PHP iceberg (and to 2nd my friends who already have replied):

  • You need to understand a bit of Linux
    • ssh (how to make an ssh key pair)
  • You want to make a github account (free)
    • You want to learn how to configure your github account with your ssh pub key

I actually use Vscode for PHP development  (whereas many of the experienced devs here use PHPStorm, which is the de facto industry standard IDE for PHP development).

Vscode comes with html/javascript/css support built in.

It also has some built in support for PHP, but it's not recommended.  Instead people install the Intelephense plugin.  The important thing is to look at the readme and carefully follow the instructions on disabling the php plugin that comes with Vscode.

You can pay a relatively small fee to license Intelephense, and unlock some of it's more advanced features, but I wouldn't rush out to buy the license immediately, although you should keep it in mind.  The one benefit of Vscode is the many plugins available, and Python support is easy enough to add. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.