HNHacker News
TopNewBestAskShowJobs

drinchev

3,581 karma · joined October 4, 2011

Freelance web developer, based in Berlin.

http://www.drinchev.com

[ my public key: https://keybase.io/drinchev; my proof: https://keybase.io/drinchev/sigs/DoNkf0DJhCHcuXXwrX-M5M-qqQV3NqJQJO518YFb8zY ]

submissionscomments
drinchev··on A Taxonomy of Technical Debt
Funny enough, most companies I worked for, I had to follow "You can refactor if the PM doesn't catch you spending those precious minutes for this".

There was only one time, where we had every Friday, time to improve the codebase. 2 months later it became every 2nd Friday, though.

I'm really pissed that technical debt is considered as "Hey the dev guys are complaining again".

drinchev··on Ask HN: Raw SQL vs. ORM?
> good-practice security measures

+1 for that. Even for super small projects, I use an ORM, because there is always some user input that needs to go to the database query string. Life is too short to maintain every single query.

drinchev··on Ask HN: Resources for catching up on modern JavaScript for Python/C++ Programmer
Definitely it will slow down learning, but most of all you will be quite confused in the end, what is JavaScript and what is TypeScript.
drinchev··on Project from Hell (2008)
> The company recovers daily penalties by billing ever-increasing change requests to the government. The year is 2008.

I hope you didn't miss that sentence. It's the irony that probably lives in every government project.

drinchev··on Project from Hell (2008)
There are lots of people on the pipeline that take their share of our taxes to deliver to "the letter of the contract" [1], without considering the intend.

Closest I've been is when an agency sold my time to another agency which sold my time to the end client, who paid me with "profit" from insurance money ( the end client was an insurance agent ).

And as I'm not in my 20s anymore and I look at how government related IT services work, I'm so much afraid about everything else happening around me. Questions like "What about the tram I use every day? There should be a company maintaining these things. Probably is hell there as well."

1 : https://en.wikipedia.org/wiki/Letter_and_spirit_of_the_law

drinchev··on Post-Mortem and Security Advisory: Data Exposure After travis-ci.com Outage
> The shell the tests ran in unknowingly had a DATABASE_URL environment variable set as our production database. It was an old terminal window in a tmux session that had been used for inspecting production data many days before. The developer returned to this window and executed the test suite with the DATABASE_URL still set.

I was expecting something like this. I remember, I configured my terminal windows to change their background when I'm on production systems [2], after around I read about gitlab database incident [1].

1 : https://about.gitlab.com/2017/02/01/gitlab-dot-com-database-...

2 : http://www.drinchev.com/blog/ssh-and-terminal-background/

drinchev··on The dots do matter: how to scam a Gmail user
I don't agree with "It's gmail fault" and also I don't think Netflix should validate the e-mails. Why?

Most of the startups I work for don't require a valid e-mail when you enter your payment information. Reasons are multiple - conversion drop, "we took your money, we don't care", the e-mail is anyway entered with the payment provider, etc.

Also what comes to your e-mail and you act on is your responsibility. I don't know about you, but I don't pay for more than a dozen services with my card and I usually am aware when / what is being paid, so a scam like this would be easy to detect.

drinchev··on Stripe Billing
I think most difficult problem is still proper accounting. I'm with a client right now, based in Europe and we had >really good time< integrating Recurly with Stripe and use it as their payment provider, but we got stuck when we figured out that there was a need to hire an accountant to handle the cancelations for us.

Having a service like Cleverbridge [1] / Avangate [2], where they end-up having someone to manage this for them for a bigger % of the sale, was the better deal.

Not sure how the startup-scene will solve this, but it's actually still really hard to do this properly.

My best solution would be to have Stripe doing whole-sale solution, where they invoice customers and you simply invoice them each month.

It just takes too much efforts to do this >legally< in Europe if you are on your own.

1 : https://www.cleverbridge.com/corporate/

2 : http://www.avangate.com

drinchev··on JavaScript: prototype vs. class
I sometimes see difference between TypeScript's compiler and babel.

For example in this case TypeScript doesn't care so much about `defineProperty`. I guess the rules are not so strict, since it assumes that the rest of your code will be passed through TypeScript itself.

Anyway in both cases, I prefer TypeScript's way of enhancing the class inheritance in JavaScript by introducing private / readonly and many more.

https://www.typescriptlang.org/play/index.html#src=class%20D...

drinchev··on JavaScript: prototype vs. class
When comparing ES2015 and how it was before. I usually take the babel playground [1] and see what the closest alternative would be.

For a simple es2015 it looks a bit more complicated than the prototype extension [2].

    class Dog {
      bark() { console.log( "Bark!" ); }
    }
Compiles to :

    "use strict";

    var _createClass = (function() {
      function defineProperties(target, props) {
        for (var i = 0; i < props.length; i++) {
          var descriptor = props[i];
          descriptor.enumerable = descriptor.enumerable || false;
          descriptor.configurable = true;
          if ("value" in descriptor) descriptor.writable = true;
          Object.defineProperty(target, descriptor.key, descriptor);
        }
      }
      return function(Constructor, protoProps, staticProps) {
        if (protoProps) defineProperties(Constructor.prototype, protoProps);
        if (staticProps) defineProperties(Constructor, staticProps);
        return Constructor;
      };
    })();

    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }

    var Dog = (function() {
      function Dog() {
        _classCallCheck(this, Dog);
      }

      _createClass(Dog, [
        {
          key: "bark",
          value: function bark() {
            console.log("Bark!");
          }
        }
      ]);

      return Dog;
    })();
1 : https://babeljs.io/repl/

2 : https://babeljs.io/repl/#?babili=false&browsers=&build=&buil...

drinchev··on Ask HN: Will my comments/topics on HN be deletable under the GDPR law?
AFAIK logs should not contain personal data at all and backups ... you need to figure out a way to delete the already deleted user data when you restore a backup.

Interestingly enough. When I request to delete my data from HN, I would expect HN to send algolia (3rd party) a request to do so too. It should all propagate to even Google's search.

That's all like too complicated to implement and here ( at least ) in Berlin companies are in huge trouble about the details.

drinchev··on Half of European flights delayed due to system failure
From dev-experience I would be surprised if SpaceX rockets run with decades old assembler code-base.

I still believe we can create bug-free solution with modern toolset. It's a matter of zeros behind the project funding.

drinchev··on Show HN: See GitHub issues on a Kanban board
Sorry for hijacking the topic, but how is Zenhub doing, compared to GitHub Projects?

I haven't compared them recently, but maintaining a project, "on-top" of GitHub front-end, seem quite a difficult task.

drinchev··on Microsoft is putting Windows on the back burner
What excites me is even the smallest possibility of Microsoft going towards Linux desktop.

Let’s see.

drinchev··on Ecuador cuts off Julian Assange's internet access at London embassy
> The move came after Assange tweeted on Monday challenging Britain’s accusation that Russia was responsible for the nerve agent poisoning of a Russian former double agent and his daughter in the English city of Salisbury earlier this month.

So it's actually not so wrong to think that Russia is not >proven< guilty after all.

I doubt that here, on HN, most of us would go so deep with conspiracy, but rational thinking did not lead me to the conclusion that Putin is responsible this time.

Of course we don't know the whole story, but shouldn't people like Assange reveal it?

Also, why would the UK-Ecuador relations be in danger of a tweet of a fugitive?

drinchev··on I usually run 'w' first when troubleshooting unknown machines
I remember I used `w` to check if someone is in the box and then use `talk` to open a chat with that user.
drinchev··on I usually run 'w' first when troubleshooting unknown machines
Mostly `root` with ssh-keys for authentication. Some provisioning scripts ( ansible ) that run under root and pretty much that's it.

I haven't seen human users in passwd, since virtualisation kicked in couple of years back.

drinchev··on Ask HN: Weirdest hack that you ever saw in production?
Not an actual bug, but I found this a couple of days ago. And it seems like an elegant hack, allowing `/` in directory, files, etc.

Typing `mkdir foo:bar` in my macOS's terminal leads to a directory, that Finder shows as `foo/bar`.

drinchev··on Managing database schema changes without downtime
Having no-down-time when doing migrations is not an easy topic.

> These defer drops will happen at least 30 minutes after the particular migration referenced ran (in the next migration cycle), giving us peace of mind that the new application code is in place.

Pretty much that's what I've seen before. You do series of deployments + migration scripts.

Usually :

- Migrate with backward-compatible modifications of the schema

- Release application logic that takes advantage of both migrated / to-be-deprecated tables

- Possible extra migration to sync the new / old tables.

- Release application logic that stops using the to-be-deprecated tables.

- Migrate with destructive modifications to remove the old table.

Usually that's a huge complicated process which might be replaced with one migration and a few minutes of downtime. Sadly some companies can't afford it, so they do such changes with weeks planing.

I usually vote for having some planned non-working-hours downtime.

drinchev··on Why German companies fail at digital innovation
100 times this.

Also freelance taxes are not so much better than regular ones. Usually at the end of the year I take holidays, just because I know that if I earn more, my profit will be deducted by the taxes.

This is a double-penalty. First you "take the risk" of being on your own and second after around 60k [1] income 1/3 of what you earn goes for taxes, so you can't "save money for rainy days". At this point is becoming demotivating and you better take some months off.

1: https://en.wikipedia.org/wiki/Taxation_in_Germany#/media/Fil...

drinchev··on Why German companies fail at digital innovation
For these rights people literally kill themselves to come to Germany.

Unfortunately with the decentralised IT industry, having the same benefits it's just a matter of negotiation. On top of that the amount of taxes that you pay for having "cheap" country to live in always averages those benefits.

Having a family here would be great as well, if they don't charge me a percentage of my income for kindergarten [1], a percentage of my income for health insurance, a percentage of my income for religion tax ( happily I'm an atheist ). Those all sound fair for low-skilled jobs, but not so much when you are heavily in demand IT-person ( the tax-bracket is too steep ).

1: https://www.expatica.com/de/education/Preschool-in-Germany_1...

drinchev··on Why German companies fail at digital innovation
IMHO Germany also lacks the culture of paying for talent. Employee options doesn't really work here and nobody will give 100k for an employee.

They will gladly pay :

- 10k for missed opportunities ( I've seen companies looking for devs for more than half an year )

- 10k for a recruiter

- 80k for the employee

Not to mention I've seen consulting companies "renting" good freelancers to conglomerates, for double the price of what they are paid.

drinchev··on Guide to Slack import and export tools
Looking at all positive comments here, this is generally a bad news.

Not sure how much compliant this is with the law, but in this case the law should be more protective towards employees.

I imagine the following situation

I write on a company-owned piece of paper - "My boss is an idiot". Then take this piece of paper put it in an envelope ( owned by the company as well ), write the name of my colleague and seal the envelope. Then put the envelope on the recipient's desk.

I bet it would be illegal for my boss to take that letter, open it and read it.

P.S.

Looks like with e-mails the law is more protective towards employees :

[1] : https://www.reuters.com/article/us-privacy-emails-echr/europ...

[2] : http://www.internationallawoffice.com/Newsletters/Employment...

[3] : https://www.womblebonddickinson.com/uk/insights/articles-and...

drinchev··on Show HN: Sheet2Site – Create Websites Out of Google Sheets
This looks like a really cool idea.

What I noticed is that is somehow hard to understand how to create the page. ( Click here, then there, then copy paste, then click publish, etc... ). If this process was more it would be awesome.

Keep going the good work! I checked your $1k goal and wish you all the best in achieving it!

drinchev··on CSS: The bad bits and how to avoid them
I'm a huge fan of 1 & 2, so I end up using CSS with only class names.

This helped me deliver maintainable and reliable stylesheets that other devs like.

Most importantly using only class names you will gain :

1. Your HTML / CSS is easier to maintain.

2. Is faster to develop.

3. Is faster to refactor.

4. Is more portable.

5. Is faster for the browser.

I even wrote a blog post about it [1].

http://www.drinchev.com/blog/css-with-only-class-names/

drinchev··on #deletefacebook
> 30 years from now, candidates for president of the United States will have their old social media posts under a microscope. Whatever dumb thing they posted in their teens will be brought to light.

Considering that the leader of the free world is currently using twitter the same way as some of my friends do it, I really doubt that the social media will be such a significant way to check politicians.

More or less it will happen the opposite ( already happening ), where the politicians will judge the "average" citizen, by analysing tons of social media posts and reactions to them.

drinchev··on New Raspberry Pi Model B+
> This product should be operated in a well-ventilated environment and, if used inside a case, the case should not be covered

Does this make the B+ model more dangerous in case of overheating?

I have a couple of Pis running inside official Pi case they hold between 35 - 53 degrees. ( 35 meaning unheated room ). I would be sad if I upgrade the devices and then loose my sleep in case of overheating.

drinchev··on JavaScript and Node performance coding tips to make applications faster
These tips are all great. Thanks for the article.

My 2 cents from working over 5 years with NodeJS is to be careful when you sacrifice code readability over performance.

`.forEach`, `.map`, `.filter` are way more readable / maintainable than a 20 lines `for loop` with n+ var assignments.

As for `try..catch`, I use ( readability - again ) to follow a Promise chain.

    return new Promise( resolve => resolve( JSON.parse( req.body ) ) )
                  .then( body => db.update( body ) )
                  .catch( err => /* will catch JSON.parse as well as db.update */ )
drinchev··on Developer Survey Results
I have 3-4 public github repos ( <20 stars ) and I sometimes participate in definitely typed typescript moderation. I remember that I checked “participate in open source” on that question
drinchev··on Developer Survey Results
I’m actually surprised that around 64% of the developers are having a “Computer science, computer engineering, or software engineering” degree.

I do my personal statistics for colleagues I’ve met and the percentage having no degree or degree in another field is around 7 out of 10.

Maybe that’s because I primarily work for startups and do my survey in the startup culture, but still it’s fascinating how much of those developers took the decision to become one at around high school age.

← PreviousPage 5 of 30Next →