Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Developing Multi-Platform Apps with Visual Studio Code
Developing Multi-Platform Apps with Visual Studio Code

Developing Multi-Platform Apps with Visual Studio Code: Get up and running with VS Code by building multi-platform, cloud-native, and microservices-based apps

Arrow left icon
Profile Icon Mehboob Ahmed Khan Profile Icon Habib
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (7 Ratings)
Paperback Sep 2020 334 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Mehboob Ahmed Khan Profile Icon Habib
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (7 Ratings)
Paperback Sep 2020 334 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Developing Multi-Platform Apps with Visual Studio Code

Chapter 1: Getting Started with Visual Studio Code

Visual Studio Code or, as it is mostly called, VS Code, is one of the most popular coding tools today. It focuses on being fast and extendible, and can build up to the needs of a wider developer community.

Earlier, the focus was on providing developers with an extensive development environment that could integrate the complete software development life cycle, from writing code to deploying the solution. To increase productivity, several in-built features were provided to automate repetitive tasks. Most of the environments supported a particular language and an abundance of prebuilt features for that language.

As the industry moved from thick installable clients to web-based applications, the choice of development platforms and tools also changed. These browser-based web applications that were developed using HyperText Markup Language (HTML), Cascading Style Sheets (CSS), and JavaScript did not require heavy integrated development...

Discussing editors and IDEs

Our focus in is this book is to explore and learn VS Code, but before we do that, let's discuss the difference between an editor and IDE and try to understand where and how VS Code is positioned for developers.

Over time, several languages and frameworks have become available for developers to work with. Along with these languages, a considerable amount of effort has been put in place to create the right tool to increase developer productivity and support the complete development life cycle.

These tools can be categorized into editors and IDEs.

Editors support a variety of languages, work around files and folders, and they are limited in terms of projects or solutions. They are lightweight and predominantly keyboard-centric, which allows developers to work faster.

IDEs support code editing, compiling, and debugging, as well as code execution. They are mainly specific to a particular language or a few selective languages. They usually work...

Discussing basic features of VS Code

With a brief introduction to development tools, we will now start off our learning journey by exploring some basic features of VS Code.

Files and folders

Unlike an IDE, VS Code does not depend on creating a solution or a project file. Your project is your folder, with subfolders and files in it. You can use the File menu and Open File... or Open Folder to start editing, as illustrated in the following screenshot:

Figure 1.1 – File menu in VS Code editor

Opening the folder will load all the files of the folder in VS Code. You can open multiple folders at a time. These folders will be available in the left pane of the editor.

Workspace

Often, your product will be organized into multiple interlinked projects. In this case, VS Code provides an option to combine these folders in a workspace. This way, when you open a workspace, it will open all the related project folders.

To do this, you can simply select...

Setting up VS Code

VS Code is a cross-platform editor and supports Windows, macOS, and Linux OS. You can start by visiting https://code.visualstudio.com.

Based on the operating system (OS) you are using, the website will prompt you to download for your OS. If you would like to download for another OS, you can click on other platforms or press the down arrow button that shows next to the OS name, as illustrated in the following screenshot:

Figure 1.11 – Different versions of VS Code for different OSes

There are two versions available for download. The stable version is updated every month with new features, whereas the insiders version is a nightly build that provides an early peak into the upcoming features. Both versions can run side by side on the same machine.

Launching VS Code

By now, you should have downloaded your copy of VS Code and followed the guided installation wizard to set up your environment. Next, let's start off by looking into different ways of launching VS Code and explore some command-line options.

The simplest way of starting VS Code is by running the code . command.

This will open up a new instance of VS Code. If this command does not work in your macOS installation, you can follow the next steps. For Linux, you can visit https://code.visualstudio.com and look for Setup | Linux.

Setting up the command line for macOS

If you already have a Bash profile, please skip Steps 1 and 2. Otherwise, proceed as follows:

  1. Write the cd ~/ command to go to your home folder.
  2. Write the touch .bash_profile command to create a new file.
  3. Then, on the terminal window, write the following commands:
    cat << EOF >> ~/.bash_profile
    #Add Visual Studio Code (code)
    Export PATH=''\$PATH:/Applications...

Basic editing in VS Code

VS Code comes with some great options, which will enable you to code faster. Let's look at some of the options.

Generating HTML

The Emmet 2.0 extension is built into the editor, and helps you to quickly write HTML code.

Here are some examples.

To create a table with five rows having two columns in each row, you can use the following statement:

table>tr*5>td*3 

This is what the table looks like:

Figure 1.29 – Generate HTML using the Emmet extension

As shown in the preceding screenshot, you will notice that VS Code starts showing you the HTML it will generate. Press Enter to generate the HTML.

In case you want to add a class attribute to the tag, use a dot (.) after the tag name. An example of this can be seen in the following code snippet:

table>tr*5.myclass>td*2

This will generate the same table as in Figure 1.29, with myclass placed as a class attribute for the <tr/> tag. The...

Editing and code navigation in VS Code

While writing code, developers are often working with several files at the same time. Quickly navigating between files or within the same file is an important feature.

VS Code offers multiple options for code navigation—let's explore them one by one.

Go to line

To move the cursor to a particular line and column, use the Goto (:) Line command, as illustrated in the following screenshot:

Figure 1.43 – Using the command palette to move cursor to a line and column

Go to symbol

To show the symbols used in your code and to navigate directly to a selected symbol, you can use Go to Symbol (@) in a File.

Also, while you are traversing, VS Code will highlight the code section, as illustrated in the following screenshot:

Figure 1.44 – Using the command palette to jump to a section of code

Figure 1.44 – Using the command palette to jump to a section of code

In the case of JavaScript, the command palette will show methods, as illustrated...

Summary

In this chapter, we started by looking at the editor and IDE space, and where VS Code falls. Then, we looked at the basic features of VS Code and moved on to setting up our environment. With VS Code being a multiplatform editor, we explained some steps related to macOS, and also provided guidance in case you are using a Linux OS. Next, we explored multiple ways of launching VS Code and also looked at several command-line options. Explaining the overall layout, we then moved on to showcasing some editing and code refactoring features. Finally, we closed out the chapter by looking at quick code navigation features.

By the end of this chapter, you should now have a basic background about development tools and a more detailed knowledge of VS Code as an editor. We learned about the basic features, layout, editing, and code navigation options.

Next, we will look in further detail at the VS Code extensions framework and how it can help you in enhancing your development experience...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Leverage the power of the free, cross-platform, and highly customizable code editor to build modern web and cloud applications
  • Edit, debug and deploy on Microsoft Azure with Visual Studio Code
  • Learn how to customize features and install a wide variety of third-party extensions

Description

Microsoft Visual Studio Code is a powerful, lightweight code editor for modern web and cloud development. It is a source code editor that can be used with a variety of programming languages, which works on multiple platforms such as Linux, Windows, and macOS. This book provides extensive coverage of the tools, functionalities, and extensions available within the VS Code environment that will help you build multi-platform apps with ease. You’ll start with the installation of VS Code and learn about various tools and features that are essential for development. Progressing through the chapters, you'll explore the user interface while understanding tips and tricks for increasing productivity. Next, you’ll delve into VS Code extensions and discover how they can make life easier for developers. Later, the book shows you how to develop a sample application with different programming languages, tools, and runtimes to display how VS code can be used effectively for development, before helping you get to grips with source code version management and deployment on Azure with VS Code. Finally, you’ll build on your skills by focusing on remote development with VS Code. By the end of this book, you’ll have the knowledge you need to use Visual Studio Code as your primary tool for software development.

Who is this book for?

This book is for software developers, web developers and polyglot programmers, who are working with any language or framework such as Python, Java, Node.js, or .NET and are looking to learn how they can create multi-platform, microservices based, cloud-native applications while effectively using Visual Studio Code for editing, debugging, version management and deployment. Basic software development skills are a must to grasp the concepts covered in this book.

What you will learn

  • Explore various editing, formatting, and navigational features of VS Code
  • Understand how to add, delete, and configure extensions in VS Code
  • Develop web APIs using Node.js, Java, and Python in VS Code
  • Develop background service in .NET Core and explore Dapr
  • Delve into debugging techniques such as breakpoints, log points, and data inspection
  • Use Git with Azure DevOps to share and synchronize code with VS Code
  • Create custom extensions in VS Code to increase developer productivity
  • Understand the concepts of remote development using VS Code

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 18, 2020
Length: 334 pages
Edition : 1st
Language : English
ISBN-13 : 9781838822934
Vendor :
Microsoft
Category :
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 18, 2020
Length: 334 pages
Edition : 1st
Language : English
ISBN-13 : 9781838822934
Vendor :
Microsoft
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 132.97
C# 9 and .NET 5 – Modern Cross-Platform Development
€62.99
Developing Multi-Platform Apps with Visual Studio Code
€36.99
Visual Studio 2019 Tricks and Techniques
€32.99
Total 132.97 Stars icon

Table of Contents

14 Chapters
Section 1: Introduction to Visual Studio Code Chevron down icon Chevron up icon
Chapter 1: Getting Started with Visual Studio Code Chevron down icon Chevron up icon
Chapter 2: Extensions in Visual Studio Code Chevron down icon Chevron up icon
Section 2: Developing Microservices-Based Applications in Visual Studio Code Chevron down icon Chevron up icon
Chapter 3: Building a Multi-Platform Backend Using Visual Studio Code Chevron down icon Chevron up icon
Chapter 4: Building a Service in .NET Core and Exploring Dapr Chevron down icon Chevron up icon
Chapter 5: Building a Web-Based Frontend Application with Angular Chevron down icon Chevron up icon
Chapter 6: Debugging Techniques Chevron down icon Chevron up icon
Chapter 7: Deploying Applications on Azure Chevron down icon Chevron up icon
Chapter 8: Git and Azure DevOps Chevron down icon Chevron up icon
Section 3: Advanced Topics on Visual Studio Code Chevron down icon Chevron up icon
Chapter 9: Creating Custom Extensions in Visual Studio Code Chevron down icon Chevron up icon
Chapter 10: Remote Development in Visual Studio Code Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Most Recent
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9
(7 Ratings)
5 star 85.7%
4 star 14.3%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Most Recent

Filter reviews by




Mohith Kumar Feb 16, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is good if you code in multiple languages and want to become familiar with visual studio code and it's offerings!I have enjoyed reading all the chapters! My favorite is where the author deep dives into how to debug code like node.js with vscode!Also it has a chapter around how to build your own visualstudio extensions that is useful!
Amazon Verified review Amazon
rvet Dec 21, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Here's a book that's just-in-time: Open-source dev using Visual Studo Code.Starts with great walk-through of VS Code: What it is, what it does, and how to use it.Covers microservice development across different platforms.Covers the upcoming Dapr framework, Angular front-end development, DevOps integration, Azure deployment, and even creating custom VS Code extenions.A must-read for any developer on any platform.
Amazon Verified review Amazon
Joe Dec 18, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I was looking for a such a book to understand Visual Studio Code.The Multi-cursor editing amongst other basic editing tools is a great help especially when having to select multiple occurrences of the same text and edit at the same time. The instructions are fully detailed with plenty of screenshots to help drive the points across. The shortcuts shown in the book are great to navigate Visual Studio Code and provide great time savers. The code snippets are also very helpful at limiting the amount of time taken to write the code. The themes and extensions are great I especially liked the way the author teaches you how to create a new extensions.json file with your recommended extensions. Learning how to install extensions from the CLI is of course very valuable information. I am already a certified Azure Administrator however still not being able to land a job in that field. Section 2 was a great refresher course in Azure and have a better understanding of Azure Devops and Angular frameworks now. Debugging practices and examples are on point. I was unable to completely grasp the concept of using containers however now I understand and know how Docker and Kubernetes work. I greatly applaud the author of this book and have faith that with the knowledge attained by reading and following the examples on Developing Multiplatform Apps with Visual Studio Code, that I am now ready to pass any future job interviews and have faith that I will be be able to attain a job as a Cloud Administrator.
Amazon Verified review Amazon
Patrick Dec 16, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The book has about 300 pages. The first 10% is on the tool VsCode. It is perfect for someone getting started with VsCode. For those who already use VsCode, you can skip the first chapter, and even chapter two dedicated to extensions can be skimmed.The rest of the book is organized into few topics like using Kafka with Azure Event hub, how to run a service that runs in the background, and the it starts building a web application. My personal takes on "multiplatform" were not to create a web application but maybe an Electron or an application within a container. So, be aware of what you are getting into. In my perspective, chapter 6 can be skipped if you know how to debug. Chapter 7 is interesting if you never deployed a Docker or never used Kubernetes. The idea of container and images are both well covered by the author. Chapter 8 could have been removed since it is a stretch of the main topic: Git and Azure DevOpsOverall, the book is fine if you want to jump into Docker with having information about VsCode. The book title is a little bit misnamed, in my opinion, and should have demonstrated how to build that can be run on Windows and MacOS for example. The use of image is still relevant and the use of many techniques would still be great. Still a good read.
Amazon Verified review Amazon
Amazon Customer Dec 02, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Visual studio code is the most used open source IDE by for developing & configuring multi\cross platform apps. I do advice anyone to discover the incredibly power of visual studio code available the below book. Personally, I'm using visual studio code from years but I was not aware of many nice features available there. It doesn't matter which language you are writing or which framework you are using as all of this is available with details on the below book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.