We just took an international trip with our baby, who is just almost 3 months old. There were a few pain points we encountered, and some things we hadn’t even thought about before flying.
At least some airlines have bassinets for babies. What I didn’t know was it was only for particular seats on the plane. Call the airline early about getting a seat with a bassinet. We tried to get the seats once we were at the gate, but it was too late.
When you don’t have a baby, you can quickly grab your carry-on and run to your…
Imagine it’s your job is to write tests for your coworker’s black-boxed code.
Your coworker comes to you on Monday and says, “I’ve written the Add function. Can you write some tests to make sure it works?” You think for a few minutes and come up with the following ideas about addition:
Wonderful. You write your three unit tests, and your coworker runs them.
package mainimport (
)// Read more about this style of unit testing at: // https://github.com/golang/go/wiki/TableDrivenTests func…
Let’s start simple.
Take a look at the two lines of Go below. How could we consicely explain what’s going on here?
x := 4
y := &x
You may say something like the following:
x is 4
y is the address of x
For a reference, let’s take a look at the same code in C or C++ so we can see the types.
int x = 4;
int* y = &x;
Let’s take a look at the C line
int* y = &x;
If we pretend
& is a function, we would write that line as
int* y =…
not a reptilian