Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
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

By Ovais Mehboob Ahmed Khan , Khusro Habib
$35.99 $24.99
Book Sep 2020 334 pages 1st Edition
eBook
$35.99 $24.99
Print
$48.99
Subscription
$15.99 Monthly
eBook
$35.99 $24.99
Print
$48.99
Subscription
$15.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Sep 18, 2020
Length 334 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781838822934
Vendor :
Microsoft
Category :
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.

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

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


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

Table of Contents

15 Chapters
Preface Chevron down icon Chevron up icon
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

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.