119 karma · joined Feb 13, 2012 (14y ago) · 202 submissions
comment 7y ago · link · parent
But they can Google. They can study for interviews that quiz you on computer science trivia.
The interview process on the coasts is broken. In the midwest I don't have to deal with that shit.
comment 7y ago · link · parent
I don't really see that much benefit in converting from MySQL to Postgres.
While Postgres is a legit database, so is MySQL. If you're looking to scale MySQL, I recommend the book High Performance MySQL.
For greenfield projects I'd be comfortable with either MySQL or Postgres.
comment 7y ago · link · parent
You will likely find, as I did, that enterprises literally have thousands of databases of all kinds and many crazy data models.
They have tomes of huge SQL procedures that are still to this day running their business processes. Maybe even a nice older gent that is the only one that really understands how any of that shit works?
If this sounds familiar to you, then don't waste too much time on ORMs. In my experience, they're only good for mapping out your POJO or POCO objects and performing simple CRUD operations.
Use them to stand up simple REST routes that do CRUD on your entities. That can be the API that you use to do development and testing, and possibly even use those CRUD routes to do larger business operations.
But in reality, the business "requirement" is going to come down to you, the developer, in the form of some old terrible blob of shit SQL. Two thousand lines. Ten thousand lines.
You're probably not going to bother deciphering all that and re-writing it. The ORM is going to barf all over itself if you even try to use its API to execute that query. Even if you could express all those joins and case statements via the ORM, it is going to pick an execution plan where the query finishes sometime after the next Hanukkah.
At this point, don't bother with the ORM. Drop down to some driver where you can just run raw SQL and run the raw SQL.
Create a REST route that just calls this whack query directly.
This all may sound cynical and it is. But I know what I'm talking about. Do yourself a favor and remember what I said.
comment 7y ago · link · parent
Pay your own quarterly and payroll taxes and write off your expenses. Get your own health insurance.
You’ll come out like a bandit. Since they aren’t paying payroll taxes or giving you any benefits, the spread they keep is pure profit.
So why wouldn’t they agree to $140 an hour? Why indeed..
comment 8y ago · link · parent
If a user tells you the data is wrong then follow the data. Trust but verify. The data may lead you to other data and the solution.
If there's no indicator of bad data then follow the code. There's always a reason. You'll be amazed at what you find.
comment 8y ago · link · parent
I would recommend temporary feature branches, that frequently merge into master and also release branches for the code that you want to push to production. You can always do hotfix branches off of the release branch.
There's always that wet dream of no branches at all, every edge case automatically tested and pushing right to production if the tests pass. But this is really not practical for most places of business.
But if you can promote some meaningful amount of: 1) Unit tests 2) Integration tests 3) Functional tests That automatically run when code is pushed, that's a good first step.
Also, if you can get them on a regular release cadence of monthly or better, that would also be preferable, and you should be able to release code to pretty much any environment with the click of a button and with little to no manual intervention.
Oh and use Vault. :)
Stick with the basics and it will take them a long way.
comment 8y ago · link · parent
comment 8y ago · link · parent
My opinion of the code is this.
It's pretty tight, which I can respect.
I haven't run it, but it PROBABLY works.
But it's hard to read.
Things are named poorly.
Many edge cases are missed (not checking args properly).
These functions are not pure and therefore, harder to test.
Maybe true 1337 H@X0Rz don't need to write tests, but some of us have mortgages to pay...
I didn't re-write all of this mess, but check out the few util functions that I re-wrote.
As a developer, which version would you rather work with?
If you said the original version that's cool with me.
But don't try to come work on my team.
// isNull :: a -> Boolean
const isNull = x => x == null
// isNullOrEmpty :: String -> Boolean
const isNullOrEmpty = string => string == null || !string.length
// $ :: String -> HTMLDocument -> HTMLElement
const $ = (id, _document = document) => {
if (isNullOrEmpty(id)) return null
if (isNull(_document)) return null
return _document.getElementById(id) || null
}
// findClassInElement :: HTMLElement -> String -> [HTMLElement]
const findClassInElement = (el, className) => {
if (isNull(el)) return []
if (isNullOrEmpty(tagName)) return []
return el.getElementsByClassName(className) || []
}
// findTagInElement :: HTMLElement -> String -> [HTMLElement]
const findTagInElement = (el, tagName) => {
if (isNull(el)) return []
if (isNullOrEmpty(tagName)) return []
return el.getElementsByTagName(tagName) || []
}
// findClass :: String -> HTMLDocument -> [HTMLElement]
const findClass = (className, _document = document) => {
if (isNullOrEmpty(className)) return []
if (isNull(_document)) return []
return findClassInElement(_document, className) || []
}
// elementHasClass :: HTMLElement -> String -> Boolean
const elementHasClass = (el, className) => {
if (isNull(el)) return false
if (isNullOrEmpty(className)) return false
return el.className.includes(className)
}
// addClass :: HTMLElement -> String -> Boolean
const addClass = (el, className) => {
if (isNull(el) || isNull(el.className)) return false
if (isNullOrEmpty(className)) return false
if (el.className.includes(className)) return true
el.className = `${el.className} ${className}`
return true
}