"[" is a command. It's actually syntactic sugar for the built-in command test which checks and compares its arguments. The "]" is actually an argument to the [ command that tells it to stop checking for arguments!
why > and < get weird inside single square brackets -- Bash actually thinks you're trying to do an input or output redirect inside a command!
the [[ double square brackets ]] and (( double parens )) are not exactly commands. They're actually Bash language keywords, which is what makes them behave a little more predictably.
The [[ double square brackets ]] work essentially the same as [ single square brackets ], albeit with some more superpowers like more powerful regex support.
The (( double parentheses )) are actually a construct that allow arithmetic inside Bash.
If the results inside are zero, it returns an exit code of 1. (Essentially, zero is "falsey.")
the greater and less-than symbols work just fine inside arithmetic parens.
exit code 0 for success.
exit code 1 for failure.
If the regex works out, the return code of the double square brackets is 0, and thus the function returns 0. If not, everything returns 1. This is a really great way to name regexes.
the stuff immediately after the if can be any command in the whole wide world, as long as it provides an exit code, which is pretty much always.
""[" is a command. It's actually syntactic sugar for the built-in command test which checks and compares its arguments. The "]" is actually an argument to the [ command that tells it to stop checking for arguments!"
PHP provides a function that lets you override the default session mechanism by specifying the names of your own functions for taking care of the distinct tasks
The handler PHP uses to handle data serialization is defined by the session.serialize_handler configuration directive. It is set to php by default.
REPLACE
REPLACE, which behaves exactly like INSERT, except that it handles cases where a record already exists with the same session identifier by first deleting that record.
the _write() function keeps the timestamp of the last access in the access column for each record, this can be used to determine which records to delete.
Libraries installed through a packaging system can be installed system-wide (known as “site packages”) or scoped into the directory containing the app (known as “vendoring” or “bundling”).
A twelve-factor app never relies on implicit existence of system-wide packages.
declares all dependencies, completely and exactly, via a dependency declaration manifest.
Before accessing variables within objects and collections make sure they are there! PLEASE!
If that variable is a constant or won't be changed then use the Const keyword in applicable languages and the CAPITALISATION convention to let users aware of your decisions about them.
The name of a method is more important than we give it credit for, when a method changes so should its name.
Make sure you are returning the right thing, trying to make it as generic as possible.
Void should do something, not change something!
Private vs Public, this is a big topic
keeping an eye of the access level of a method can stop issues further down the line
Gherkin is a Business Readable, Domain Specific Language created especially for behavior descriptions.
specify the 3 main points of a test, including what you expect to happen using the following keywords GIVEN, WHEN / AND , THEN.
look at how the code is structured, make sure methods aren't too long, don't have too many branches, and that for and if statements could be simplified.
Use your initiative and discuss if a rewrite would benefit maintainability for the future.
it's unnecessary to leave commented code when working in and around areas with them.
Do not use directories as a dependency for generated targets, ever.
Parallel make: add an explicit timestamp dependency (.done) that make can synchronize threaded calls on to avoid a race condition.
Maintain clean targets - makefiles should be able to remove all content that is generated so "make clean" will return the sandbox/directory back to a clean state.
Wrapper check/unit tests with a ENABLE_TESTS conditional
= 在執行時擴展(values within it are recursively expanded when the variable is used, not when it's declared)
:= 在定義時擴展(values within it are expanded at declaration time)