Four disjointed, unrelated topics on engineering delivered by a person with issues, lots of issues, in a stream of conciousness format where I can't promise I won't digress and end up talking about the Victorian infatuation with tobacco rectal inflation or the intraparty conflicts inherent to the Irish Parliamentary system.
Software Development Engineer in Test - ESO Solutions
Graduate, Maker Square Austin Cohort #21
@boyko4tx - github.com/brianboyko - http://brianboyko.us
Stop me if you get bored, and you want me to move on.
I don't know your names, so when you raise your hands to ask questions, Im'ma point to you.
This is what happens when you ignore red flags.
Google "The Joel Test." It was written in 2004, it's still applicable.
I AM SPEAKING
FROM EXPERIENCE.
In most cases, "ponzi scheme-like" companies aren't breaking the law, or being bad people, but they dug themselves a hole and kept digging.
or why you should focus on Javascript now, but as soon as you feel you're able, branch out to a second language.
Best when you have a fixed set of "things" and as you build, you add new operations on those things.
Best when you have a fixed set of operations and as your code evolves you primarily add new "things" which use those operations.
Haskell
Elm
Scala
cLISP
Clojure (JVM)
Scheme
Go
Python
C++
Kotlin (JVM)
JAVASCRIPT
Ruby
Groovy (JVM)
C#
Objective-C
Java 7/8 (JVM)
Visual Basic
More Functional
More Object-Oriented
You own a car factory.
Solved in two ridiculous ways
// your test case
describe('commonCharacters()', () => {
it('should return common characters', () => {
expect(commonCharacters('acexivou', 'aegihobu')).to.equal('aeiou')
})
})
commonCharacters = (string1, string2) =>
string1.split("")
.reduce((pv, char) =>
(char !== " " &&
!pv.join("").includes(char) &&
string2.includes(char)) ? pv.concat(char) : pv, []
).join("");
commonCharacters = (string1, string2) => string1.split("").reduce((pv, char) => (char !== " " && !pv.join("").includes(char) && string2.includes(char)) ? pv.concat(char) : pv, []).join("");
class Entry {
constructor(thing){
this.entry = thing;
}
getEntry(){
return this.entry;
}
setEntry(thing){
this.entry = thing;
}
concatEntry(thing){
this.entry += thing;
}
toArray () {
if(typeof(this.entry) == "string"){
this.entry = this.entry.split("");
}
}
toString() {
if(Array.isArray(this.entry)){
this.entry = this.entry.join("")
}
}
isIncluded (char) {
return this.entry.includes(char)
}
stripWhitespace () {
this.toArray();
let newEntry = [];
for(let el of this.entry){
if(el !== " "){
newEntry.push(el);
}
}
this.entry = newEntry;
}
stripDuplicates () {
this.toArray();
let newEntry = [];
for(let el of this.entry){
if(!newEntry.includes(el)){
newEntry.push(el)
}
}
this.entry = newEntry;
}
}
commonCharacters = (string1, string2) => {
let entry1 = new Entry(string1)
let entry2 = new Entry(string2)
let answer = new Entry("")
entry1.toArray()
entry1.stripWhitespace()
entry1.stripDuplicates()
entry2.toArray()
entry2.stripWhitespace()
entry2.stripDuplicates()
for(let el of entry1.entry){
if(entry2.isIncluded(el)){
answer.concatEntry(el)
}
}
answer.toString()
return answer.entry
}
class Entry {
constructor(thing){
this.entry = thing;
}
getEntry(){
return this.entry;
}
setEntry(thing){
this.entry = thing;
}
concatEntry(thing){
this.entry += thing;
}
toArray () {
if(typeof(this.entry) == "string"){
this.entry = this.entry.split("");
}
}
toString() {
if(Array.isArray(this.entry)){
this.entry = this.entry.join("")
}
}
isIncluded (char) {
return this.entry.includes(char)
}
stripWhitespace () {
this.toArray();
let newEntry = [];
for(let el of this.entry){
if(el !== " "){
newEntry.push(el);
}
}
this.entry = newEntry;
}
stripDuplicates () {
this.toArray();
let newEntry = [];
for(let el of this.entry){
if(!newEntry.includes(el)){
newEntry.push(el)
}
}
this.entry = newEntry;
}
}
commonCharacters = (string1, string2) => {
let entry1 = new Entry(string1)
let entry2 = new Entry(string2)
let answer = new Entry("")
entry1.toArray()
entry1.stripWhitespace()
entry1.stripDuplicates()
entry2.toArray()
entry2.stripWhitespace()
entry2.stripDuplicates()
for(let el of entry1.entry){
if(entry2.isIncluded(el)){
answer.concatEntry(el)
}
}
answer.toString()
return answer.entry
}
...it returns all characters that are not duplicates?
...it takes an array of objects instead of a string?
Tests are how you can tell whether or not your code breaks things or changes something someone else depends on.
A Dev's Best Testing Friend.
import database from 'database' //
import {config} from 'config'
let connection = database(config);
// can't test this function without actually connecting to the database.
export function addRecord (record) => {
connection.addOne(record)
}
// testable, database and config need to be defined in every single call.
export function addRecord (database, config, record) => {
let connection = database(config);
connection.addOne(record)
}
// AHA! Testable!
export const Connector = (database, config) => {
let connection = database(config);
return {
addRecord: function(record){
connection.addOne(record);
}
}
}
cannot test.
Very testable!
let testConnector =
Connector(fakeDB, fakeConfig);
testConnector
.addRecord(fakeRecord);
addRecord(fakeDB,
fakeConfig, fakeRecord);
// for every test
// and every use.
A Dev's Best Testing Friend.
// AHA! Testable!
export const Connector = (database, config) => {
let connection = database(config);
return {
addRecord: function(record){
connection.addOne(record);
}
}
}
//YOUR TEST SUITE
describe(".addRecord()", () => {
it('adds a record', (done) => {
let fakeConn = Connector(fakeDB, fakeConfig);
expect(fakeConn.addRecord({foo: 'bar'})
.then((response) => response.status))
.to.eventually.equal(200).notify(done);
})
})
//YOUR PROGRAM
db = Connector(knex, config);
db.addRecord({data: "Some Real Data"})
.then((response) => {
//do stuff
}).catch((rejection) => {
throw new Error(rejection);
})
As a job title, it's kinda meaningless.
save for one thing.
How much mentoring you need to get up to speed in the current organization
How much mentoring you are able to give to others in the current organization
These positions do require a great deal of knowledge, but there's very little mentoring/management responsibility.
I.E., they don't want to take the time to train you, but you don't have to train anyone else.
You will not just be expected to "engineer" or "develop" - you will be expected to teach others your specialized knowledge - like coming in as a Node.js expert in a room full of C# devs.
Don't strive to be a "Senior Engineer"
Strive to be the most informed, most helpful engineer.
The rest will follow.
It's easy to look brilliant when you work with idiots.
But that won't make you very happy.
makes you useful to employers.
IS WHAT MAKES YOU MIGHTY.
Finally, the # 1 thing to takeaway:
Thank you.