Muutke küpsiste eelistusi

Begin to Code: Building apps and games in the Cloud [Pehme köide]

  • Formaat: Paperback / softback, 560 pages, kõrgus x laius x paksus: 28x234x194 mm, kaal: 940 g
  • Ilmumisaeg: 07-Oct-2023
  • Kirjastus: Addison Wesley
  • ISBN-10: 0138065403
  • ISBN-13: 9780138065409
  • Formaat: Paperback / softback, 560 pages, kõrgus x laius x paksus: 28x234x194 mm, kaal: 940 g
  • Ilmumisaeg: 07-Oct-2023
  • Kirjastus: Addison Wesley
  • ISBN-10: 0138065403
  • ISBN-13: 9780138065409

Become a cloud developer — and have fun doing it!

This full-color guide will help you start creating cloud-based apps and games fast, even if you’ve never done it before. Not just friendly and easy, it puts you in control of your own learning and empowers you to solve problems you care about. Microsoft and author Rob Miles have reinvented the introductory tutorial, reflecting deep research into how newcomers learn. Begin to Code is packed with innovations, from debugging challenges to step-by-step Make Something Happen exercises replicated as YouTube videos linked directly from the book. Miles puts code in context, showing how modern cloud applications are deployed and run, how their elements combine into working systems, and how key cloud technologies help you address security, reliability, and scalability. Easy, friendly, and you’re in control!

Learn how to…

  • Recognize what’s unique about cloud-based software and why JavaScript is ideal for developing them
  • Move JavaScript code onto the cloud, and add programmed behavior to web pages
  • Create active sites and generate dynamic web content
  • Use the Node.js framework to write programs that run on servers and respond to browser requests
  • Build shared applications that use services and JSON data transfer
  • Host and optimize shared game experiences in the cloud
  • Consider ethical and privacy issues as you design new cloud apps and services
  • Streamline and improve cloud development with Express Framework, node package manager, and Git
  • Use professional techniques to deliver reliable, secure, and well performing solutions
  • Build cloud-hosted programs that interact with file stores and databases
  • Configure and deploy a working application, step by step
  • Get started with cloud-based Internet of Things (IoT) development

About This Book

  • For beginners who’ve never written code for the cloud
  • For anyone who’s been frustrated with other beginning programming books or courses
  • For people who’ve started out in other environments and now want to code for the cloud
Introduction xv
Part 1 The cloud
1 Code and the cloud
2(40)
What is the cloud?
4(1)
The World Wide Web
4(1)
Putting the web in the cloud
5(3)
JavaScript
8(2)
JavaScript heroes: functions
10(1)
The JavaScript function object
10(1)
Lifting the lid on JavaScript
11(9)
References to JavaScript function objects
20(2)
Function expressions
22(1)
Function references as function arguments
22(5)
Returning values from function calls
27(2)
Returning multiple values from a function call
29(3)
Make a console clock
32(1)
Getting the date and time
32(4)
Arrow functions
36(2)
What you have learned
38(4)
2 Get into the cloud
42(44)
Working in the cloud
44(1)
Git
44(2)
Storing Git repositories
46(1)
GitHub and open-source software
47(4)
Get Visual Studio code
51(5)
How a web page works
56(1)
Loading a page and displaying it
57(6)
Make an active web page
63(1)
Interact with the document object
63(6)
Web pages and events
69(3)
Making a time travel clock
72(1)
Add buttons to a page
73(1)
Share values with global variables
74(6)
Host a website on GitHub
80(1)
What you have learned
81(5)
3 Make an active site
86(38)
Get input from a user
88(1)
The HTML input element
88(5)
Input types
93(2)
Storing data on the local machine
95(4)
JavaScript heroes: let, var, and const
99(7)
Making page elements from JavaScript
106(1)
Cheese Finder
107(11)
What you have learned
118(6)
4 Host a website
124(42)
Node.js
126(6)
JavaScript heroes: modules
132(1)
Create a module and require it
133(5)
Require and import
138(1)
Using import in the browser
139(5)
The dark side of imported code
144(1)
Make a web server
145(1)
Serving from software
146(7)
Serving out files
153(6)
Active sites
159(1)
What you have learned
160(6)
Part 2 Make a cloud-based application
5 Build a shared application
166(44)
Upgrade Cheese Finder
168(1)
Adding some color
168(7)
Add a game ending
175(2)
Add randomness
177(3)
Add more cheese
180(5)
Even more cheese
185(3)
Create a shared game
188(1)
Design a protocol for a conversation
189(1)
Create endpoints
190(1)
Start the game
191(6)
The game server
197(4)
Play the game
201(5)
What you have learned
206(4)
6 Create a shared experience
210(46)
Sharing gameplay
212(1)
Create shared gameplay
213(2)
Debug shared gameplay
215(9)
Make pseudo-random values
224(7)
Create a pseudo-random library
231(1)
Generate timed randomness
232(2)
Use worldwide time
234(1)
Prepare for the cloud
235(1)
Optimize performance
235(4)
Avoid recalculations
239(1)
Improve structure
240(2)
Buy a domain name
242(1)
Put your name on it
242(1)
Deploy an application
242(8)
What you have learned
250(6)
7 Design an application
256(42)
The Tiny Survey application
258(1)
Ethics, privacy, and security
258(3)
Application workflow
261(1)
Index page
261(1)
Enter options
262(2)
Select option
264(2)
Display results
266(1)
Extra workflows
267(3)
Application data storage
270(1)
JavaScript hero: classes
270(11)
Classes for Tiny Survey
281(1)
The Option class
281(2)
The Survey class
283(7)
The Surveys class
290(4)
What you have learned
294(4)
8 Build an application
298(54)
Put on the style with Bootstrap
300(3)
Getting started with Express
303(1)
Express and node package manager
303(7)
Express routes
310(1)
Manage versions with Git
311(1)
Use gitignore
311(4)
Use page templates with EJS
315(3)
Get the example application
318(2)
The index page
320(1)
Post data from a form
321(1)
Receive input from a post
322(5)
Enter the survey options
327(1)
The enteroptions page
327(2)
Generate pages using an EJS template
329(6)
Use named route parameters
335(1)
Build a survey data object
336(3)
Build a select option page
339(4)
Record survey responses
343(2)
Render the results
345(3)
What you have learned
348(4)
9 Turn professional
352(40)
Modular code
354(3)
Comments/documentation
357(3)
Error checking
360(7)
Testing
367(6)
Logging
373(1)
"Professional" coding
373(1)
Store application status with cookies
374(1)
Cookies in Tiny Survey
374(1)
Cookie middleware
375(1)
Use cookies in Tiny Survey
376(9)
What you have learned
385(7)
Part 3 Building with cloud technologies
10 Store data
392(44)
File data storage
394(1)
Synchronous file writing
394(1)
Asynchronous file writing
395(1)
JavaScript heroes: the Promise
395(6)
JavaScript heroes: await and async
401(1)
Using async in Tiny Survey
402(1)
Handle file errors
403(2)
Create error-handling middleware
405(4)
Database storage
409(1)
Start with MongoDB
409(3)
Mongoose and schemas
412(2)
The SurveyManagerDB class
414(3)
Testing asynchronous code
417(2)
Refactoring Tiny Survey
419(1)
Create route files
419(2)
Tiny Survey deployment
421(1)
Manage environment variables
421(2)
Code and deploy with the nodemon package
423(4)
Create a README.md file
427(5)
What you have learned
432(4)
11 Activity tracking and sessions
436(50)
User tracking
438(1)
Create a Globally Unique Identifier (GUID)
438(1)
User tracking ethics
439(1)
Use activity diagrams to describe workflow
439(2)
Cookie approval workflow
441(1)
Create tracking middleware
442(7)
Store survey creators
449(1)
Recognize survey creators
450(9)
Tiny Survey improvements
459(1)
User sessions
460(1)
Store user details
460(1)
Register and login workflow
461(1)
Register a user
462(1)
Hashing passwords
463(1)
The register route
464(3)
User login
467(2)
Access tokens
469(4)
Create an access token
473(2)
Authenticate tokens
475(1)
Session renewal
476(1)
Role-based security
477(3)
Creating the admin user
480(1)
What you have learned
481(5)
12 JavaScript technologies
486(38)
Make your own cloud
488(4)
Installing node
492(1)
Host an application
493(3)
Use MongoDB on your server
496(1)
Shut down the server
496(1)
Running a server
497(1)
Control hardware from a server
497(1)
Browser-controlled light
497(4)
Remote button
501(4)
Use WebSockets to send values from a server
505(1)
Make a WebSocket
505(4)
Use MQTT
509(1)
MQTT in a node.js application
510(3)
Create an Internet of Things network
513(1)
Create your own IoT devices
513(2)
Manage devices using the Connected Little Boxes server
515(1)
Create a game using Phazer
516(1)
Serving static files from Express
516(2)
Further development
518(1)
Typescript
518(1)
React
518(1)
Electron
518(1)
Graphql
519(1)
Socket.io
519(1)
M15.js
519(1)
Espruino
519(1)
What you have learned
520(4)
Index 524
Rob Miles spent more than 30 years teaching programming at the University of Hull in the United Kingdom. He's a Microsoft MVP with a passion for programming and creating new things. He runs a tiny company promoting the use of software and devices in the community and loves building things and putting code into them. He reckons that programming is the most creative thing you can learn how to do. He claims to know a lot of really good jokes, but nobody has ever heard him tell one. If you want an insight into the Wacky World of Rob Miles, you can read his blog at www.robmiles.com and follow him on Twitter as @RobMiles.