Below are many examples of function hoisting behavior in JavaScript. Ones marked as works
successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)
Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:
- It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
- It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
- It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.
This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne
#!/bin/sh | |
echo | |
if [ ! -d "deps" ] || [ ! "$(ls -A deps)" ]; then | |
printf "\e[32m=> Fetching dependencies and building the application...\e[0m\n\n" | |
echo "+ mix do deps.get, compile --verbose" | |
mix do deps.get, compile --verbose | |
echo | |
fi |
$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/