soon!
This is the multi-page printable view of this section. Click here to print.
Docs
1 - Setting Up Your Development Environment
There’s a lot to install and setup. In total it may take close to an hour.
β±οΈ Track your time?
Yo, help a prof out π and see if you can track π about how long all this takes you.OS-Specific Setup
- If you’re on Windows, please install the Windows Subsystem for Linux (“WSL”) as indicated on our corresponding docs page.
- Our intention is to have a development environment that is as similar as possible across all OSes. It seems like WSL can help us achieve this.
- After you’ve done that, you should be able to proceed with the rest of the instructions here.
Files
- Create a directory (i.e. a “folder”) somewhere on your computer for this course, perhaps you’d call it
cs343
. - Inside your
cs343
directory, create a directory callednotes
.- this would be a great place to put:
- the class’s slides if you download them
- your own notes from the in-class mini-lectures
- your own notes from your out-of-class time working on the preps, labs, and projects
- this would be a great place to put:
- If you didn’t already as part of the aforementioned WSL setup (then we hope you’re not on Windows or you missed a step! π), inside your
cs343
directory, create a directory calleddev
- all the code you write for this course should go in your
dev
directory, ideally in a subdirectory ofdev
named for the thing you’re working on
- all the code you write for this course should go in your
Browsers
- Install Firefox if you don’t have it already (ensure you have at least 2 browsers installed).
- For whatever browsers, install extensions:
- a userscripts extension like ViolentMonkey
- an accessibility checker extension like WebAIM’s WAVE
- add a bookmark(let) for the validator
- this HTML validator
β οΈ Safari
tl;dr - don't use Safari in this course
Listen, in general Safari is an excellent browser in many ways. Unfortunately, their excellent privacy-protecting defaults defeat many popular websites' code, esp. when linking to things like protected files. Very likely you will not be able to download provided code from Canvas with Safari (unless you disable their privacy-protecting features, which are themselves excellent and most of the reason to use Safari...).API Exploration
- Install Postman
- PostMan has been adding various paid tiers, please don’t pay money for it at this time, just use the free tier.
Editors
π«΅ VSCode is Required
tl;dr - You must us VSCode in this course
If you have strong feelings about your editor, please know you’re almost certainly right. Tell anyone you wish we said so. That being said, in-class and out-of-class until at least the end of Milestone 2, please use vscode.
- Install VSCode:
- Windows folks (should have already done this when they competed the prerequisite WSL install steps… π) do it this way (because we want you to be in this WSL context).
- Ensure if you’re asked by the install wizard, that you enable/select the following:
Explorer context menu
Add to PATH
- Ensure if you’re asked by the install wizard, that you enable/select the following:
- Everyone else: Visual Studio Code
- Windows folks (should have already done this when they competed the prerequisite WSL install steps… π) do it this way (because we want you to be in this WSL context).
- Install these vscode extensions:
- Live Server
- Live Share ExtensionPack(weirdly can’t seem to reach that link any more even though it’s still listed on the Live Share Extension page π€·ββοΈ)
- Remote Development extension pack
code
is available from command line (“CLI”):
-
Restarting Shell
Note any time youβre trying to make new apps or commands available to your command line interface, you may need to re-launch your CLI after installing or configuring the new app/command.
- Windows: the installer should have done it, try opening Windows Terminal or PowerShell or whatever and just type
code
and hit enter. - MacOS
- Linux: the installer should have added it to your path already, try it in your shell
Git
If you don’t already have git installed (it’s installed by default on macOS and some linux distros), install it (and make sure it’s added to path where you can use the git
command from the CLI).
Windows
The git install wizard defaults are probably fine, but if you happen to notice this, consider answering a few of the steps as follows:
- Default editor:
- vscode
- Git Pull something:
- rebase
- Extra Options:
- β enable symlinks
(On Windows) Ensure that once you install git, you have git bash, and that in git bash you have curl
. This post may help if you don’t have curl on Windows.
Not Windows
Probably you already have git installed, try it in your shell by opening a terminal and running git
Configuring Git (all OSes)
- Open a terminal
- Windows: open
git bash
- mac or linux open a terminal
- Windows: open
- run the 2 commands found at the following link, but:
- don’t type the
$
that’s at the beginning and - change the placeholder values for real ones
- note: the username and email you set do not have to match things github already knows about
- ok, here’s the link - Git::First-Time Setup:YourIdentity
- don’t type the
GUI for Accessing Files Remotely
- Install Filezilla
GUI for Git
One of the best GUIs for Git isn’t available on linux π€¦ββοΈ. So in the interest, everyone should Install the GitHub Desktop app.
2 - Setting Up Your Development Environment - Start with WSL
There’s a lot to install and setup. In total it may take close to an hour.
Overview
To try to establish a common development environment, we’d like students running Windows on their computer to install the Windows Subsystem for Linux (WSL). Almost certainly these days you’ll actually be using WSL2. Per Microsoft,
WSL 2 uses virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine (VM). Linux distributions run as isolated containers inside of the WSL 2 managed VM.
tl;dr
Install
- Follow the steps at https://learn.microsoft.com/en-us/windows/wsl/setup/environment
- In doing these steps, you will have to create a user for your WSL instance. This user is separate from your windows user. You will need to remember the username and password you create here.
Files
- The files you work with in WSL will be in a filesystem that the rest of Windows will find at
\\wsl$\Ubuntu\home\<the username you created during the WSL install process>
. - Consider making a directory in that location called
dev
and doing all of your work for this course in subdirectories of that directory. This will make it easier to find your work later.- so the
dev
directory’s full path will be\\wsl$\Ubuntu\home\<your_user>\dev
- so the
Terminal
For your command line interface (CLI), it is probably best that you use Windows Terminal (click here to install it if you don’t have it already).
Windows Terminal can launch many different “shells”. Typically for our class work, you’ll want to use the Ubuntu shell. You can launch it from the drop down menu in the Windows Terminal tab bar.
Windows Terminal Window Behavior
- in many Terminal apps (Windows Terminal included), you can paste text into the terminal by right-clicking. Unlike the usual behavior in Windows, including in its own predecessors to the Windows Terminal, right-clicking does not open the context menu. It just pastes immediately.
- unlike many linux shells, highlighting text in Windows Terminal does not automatically copy it. You must use Ctrl+c to copy text.
- so then ctrl+c is overloaded in the Ubuntu shell running in Windows Terminal:
- if you have text selected, it copies the text
- if you have no text selected, it behaves like many other (e.g. Linux) shells and sends the ctrl+c signal to the shell, which is the signal to cancel the current process.
- so then ctrl+c is overloaded in the Ubuntu shell running in Windows Terminal:
VSCode
Install VSCode as directed on the Microsoft WSL VSCode page, except:
β οΈ Watch it! π
When I was doing this, it seemed that possibly 1 step of those instructions was out of order. After doing Install VS Code and the WSL extension and Update your Linux distribution, please:
- Ensure that you are in Windows Terminal in an Ubuntu tab before you try Open a WSL project in Visual Studio Code: From VS Code. If you get any error continue to the next step here β¬οΈ.
- Just skip the optional
Open a WSL project in Visual Studio Code: From VS Code
step, and proceed from Open a WSL project in Visual Studio Code: From VS Code.
When you open certain directories with VS Code, it may ask if you trust all authors of the code in the directory you’re opening. For the simple cases in our class, it’s probably best to say yes, so that … code in your project folder can be executed by VS Code and extensions without your explicit approval
.
Random Other Windows Trivia
Software
- Open Broadcaster Software (OBS) is great for streaming or screen recording.
- Clipboard history
- omfg, i can’t believe it’s finally built in now y’all. Back in my day we had to trust a third party for this, y’all don’t know how good you have it!
Hotkeys
So in the video I mentioned some hotkeys… here’s the ones I mentioned there or that I remembered later to add to this list after using them in class.
- Open Explorer (a file/folder browsing jobber)
- Win+E
- Put caret in address bar (keeping hands on the keys, focus the address bar of the currently focused app, e.g. the aforementioned Windows Explorer, Firefox, etc.)
- Ctrl+L
- Show the Desktop
- Win+D
- Open Task Manager
- Ctrl+Shift+Esc
- Switch between open windows
- Alt+Tab
3 - Firefox DevTools
Overview
Most browsers (Firefox, and the lessers too) have some built-in tools to support web developers. Firefox’s are called “DevTools” and they’re pretty great. The most comprehensive documentation for Firefox’s DevTools is in the MDN’s What are browser developer tools?.
Configuring DevTools
The default settings are pretty good, but you may want to make a few of the changes I use.
Rulers
Sometimes it can be helpful to see the dimensions of the viewport.
HTTP Cache
Some of the code we write in developing for the clientside could be cached by the browser. Generally, that’s great, but when we’re actively working on a page and the browser stops showing us the most up-to-date view of it, it can be confounding.
Responsive Design Mode
Firefox’s DevTools have a great Responsive Design Mode that facilitates you in testing how your page will look on different devices (e.g. with different known viewport sizes, network speeds, etc.).
4 - Usual Start for Coding Activities
Overview
People organize their files and information in different ways. Some folks haven’t adopted any organization strategies because they don’t know how, or haven’t previously had the need. Now’s the time, you got this!
Create a Directory
- in your
dev
directory create a subdirectory for the activity you’re beginning.- in case you end up needing to work with this directory on the command line, you may find it simpler if you exclude capital letters, spaces, and special characters from the subdirectory name.
- open your newly created subdirectory named for the activity you’re beginning in vscode.
5 - Additional WebDev Resources
HTML
- MDN's Learn web development π₯
- Codecademy's HTML: Codecademy has some really good resources, many of the intro web courses are $FR.EE π€
CSS
- Codecademy's CSS
- specificity
- Practice your CSS Selectors with CSS Diner
- Practice Flexbox with Flexbox Froggy
- Practice justify vs align in flexbox with Flexercise the Stevens
- y'allllll this thing needs work, wasn't great when I ripped off Dr. Johnson in the first place π , and hasn't aged gracefully. pull requests welcome π
- CSS Tricks's nice visual guide to flexbox/
- CSS Tricks's nice visual guide to CSS Grid
Javascript
Design and Style
- Color Palettes
Accessibility (“a11y”)
- You'll never guess who I link first!
- Color Contrast Checker
More
- Dr. Kirkpatrick has some nifty short demos/exercises
- try the "select module" and subsequently "select exercise" buttons
- Dr. Chris Johnson may be annoyed with me, but the first 1/3 ("Content and Style") of this short "e-book" he put together is also helpful for our course
- https://jsbin.com/ can be useful for sharing short samples/examples to test your understanding or to ask for help figuring out a bug
- "MPJ" (Mattias Peter Johansson) one of very few "celebrities" I like. π¨Head's up: he makes use of expletives on occasion
- FunFunFunction (his youtube
channelaccount's ) content is all around great! - Specifically, for the most precisely relevant content to topics in our class, I can recommend:
- var, let, const
- arrow functions
- destructuring
- Object creation in JS (list)
- bind and this shows: some of the strangeness of scope in js (By default
this
is bound to the scope where a function is called, not where it was defined π±.) - Examples of bind and this: shows more of the same ^
- the rest of the object creation list is sort of beyond scope for our course
- bind and this shows: some of the strangeness of scope in js (By default
- Functional Programming in JS (list)
- videos 1-4 might be useful reviews of things related to the built-in array functions like map and reduce.
- video 8 on Promises will be relevant to the topics we will cover on asynchronous execution and interacting with (3rd-party) APIs
- the 9th video (labeled "Functors - FunFunFunction #10") onward in this list are beyond the scope of our course
- FunFunFunction (his youtube