Understanding WebAssembly Architecture

WebAssembly fulfills the long-awaited promise of web technologies: fast code, type-safe at compile time, execution in the browser, on embedded devices, or anywhere else. Rust delivers the power of C in a language that strictly enforces type safety. Combine both languages and you can write for the web like never before! Learn how

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Chapter 8 Working with Files

Exercises for Programmers — Pragmatic Programmers (68 / 91)

👈 What You Learned | TOC | Name Sorter 👉

All the programs you’ve worked with so far have taken input from the end user or used hard-coded values. But many programs use files to store data. Your operating system and its programs write logs to files constantly, as do the websites you visit. And many apps use files to hold configuration data. Games use files to store your saved data when you reach a checkpoint.

Even programming languages, like the one you’re using to work through this book, work with files. You type your source code into a file, and a compiler or interpreter turns what you wrote into something the computer can run.

The exercises in this chapter ask you to work with files and folders, and you’ll need to investigate how to do this in your programming language. Some languages have built-in features to read from a file. Others don’t have the features built in but do have libraries you can use to work with files.

You’ll want to investigate different approaches, too. You might find that your program performs faster if you can process the file line by line or as a stream of data. Some files are just too big to load all at once, but some situations may require you to read the whole file first before you can process it.

One quick note: if you’re using JavaScript inside the web browser, you won’t be able to do these exercises without modification because browsers prevent you from reading and writing to the local file system. You can use Node.js instead.

👈 What You Learned | TOC | Name Sorter 👉

Add a comment

Related posts:

How to Cause Diffusion

You now have an overview of how to build Brownian motion, Geometric Brownian motion, and Jump Diffusion. This section will show you how to get random numbers for the stochastic part of the…

7 Things I Wish I Knew When I First Started Blogging

I started blogging as a side hustle to make more money and sponsor my own food while studying in college. I was shy to ask my father to give me money every week. This isn’t easy to make money while…

your undivided attention to someone makes you match

The reason I feel this way is I have never heard them talking badly about others. Consequently, I feel the freedom to show the most authentic version of myself with no fear of what they might think…