HNHacker News
TopNewBestAskShowJobs

atsjie

430 karma · joined December 17, 2016

submissionscomments
atsjie··on Show HN: Why you should not use feature branches
This.

All teams I've worked for in the last few years basically did this.

Although we never distinguished between features/topics explicitly, the proces would be the same.

Having one branch per story is just very simple from a management perspective; it aligns user requirements, graphics design, development, code review and deployment into one trackable unit.

Stories are never too large so in practice code branches don't exist for too long, a couple of days usually. If two or more developers work on the same story they'll use the same branch. If two stories are code-wise interdependent they'll reuse each other's branches as they see fit.

atsjie··on Matrix.org hacked
no, but I wouldn't be surprised if my colleague got the idea from him. It was around the same time (end of 2014 I think).
atsjie··on Matrix.org hacked
> Escalation could have been avoided if developers only had the access they absolutely required and did not have root access to all of the servers. I would like to take a moment to thank whichever developer forwarded their agent to Flywheel.

I'd feel so small if I were this developer right now :-|

A couple of his issues appear to have to do with the use of SSH. An Ops-guy whom I worked with had setup a bastion host with ip whitelisting that automatically shut down after 1 hour. He didn't like it as his credo was "if you're using SSH when using a cloud provider you're probably doing something wrong"; meaning to say you should automate and be able to recreate any infra at all times with logs accessible without the need for SSH. I never forgot that.

atsjie··on Moving from Go to PHP Again
Funny this, +/- 6 years ago when I last worked with Doctrine I had the same feeling about Doctrine itself. I thought it was a poor replacement compared to Hibernate / JPA.

I'm getting old ;)

Obviously things will have matured since then.

Doctrine implements the Unit of Work pattern. From what you're saying GORM is more like an Active Record ORM.

You're right, that wouldn't make it a good direct alternative.

atsjie··on Moving from Go to PHP Again
No.

And there alternatives. The best known is probably Revel: https://revel.github.io

For a doctrine (ORM) alternative you have for example https://github.com/jinzhu/gorm

The point about Go; using those types of tools is generally frowned upon in the community. It's overkill for most (micro)services.

But few gophers build a full-stack website in a single application.

I'm a gopher; I wouldn't want to use Revel or Gorm. I feel I'd be using the wrong tool for the job. I'd more likely use Django or Symfony when I'd need to build a full-stack SSR.

If a backend API is used by different clients (mobile apps, SPA, servers, ...) using a full-stack SSR framework like Symfony or Django doesn't make much sense anymore. You wouldn't use 90% of the framework's features. It feels like bloat.

But many websites don't need to serve different clients.

The author's decision to go from Golang to PHP makes perfect sense if he's building SSR websites.

atsjie··on Why are we templating YAML?
Anyone working with cloudformation would wonder why we ended up writing json?
atsjie··on Memory usage of a toy C# server and client with 500K concurrent connections on
This whole C# async/await hype I don't get? I've come to see async/await more as a hindrance rather than as a good thing. In C# if you're not careful your codebase gets littered with tasks everywhere, even in code that has nothing to do with concurrency originally.

Async/await makes concurrency bubble up. This is a great article that explains this issue: http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...

It's also why I tried Golang. Once you use goroutines it's hard to go back, since the code is synchronous code.

(I use JavaScript with async/await in my day job)

atsjie··on What Makes .NET Core So Special?
I was working for a company that was making the switch from Nodejs to C#/.NET Core.

Having taught and worked 4 years professionally with Java I believed I'd make the switch to C# easily.

This was not the case. But not by lack of understanding C# or .NET Core.

Mainly .NET Core and C# felt like a few years back in time. A lot of boilerplate, configuration, and a lack of libraries/alternatives.

I don't necessarily need or want a full-bodied UoW ORM when designing a microservice. It felt like I was trying to practice DDD designed for a monolith; while many of the programmer practices of DDD feel cumbersome when designing a more minimal microservice. Even the concept of a "Controller" feels misplaced for a microservice; request handler functions seem more appropriate.

Some findings I had when I tried it:

- Model validation is very optimistic; casting JSON numbers to strings automatically and vice-versa. To me this feels completely unacceptable. I've never seen something as surprising with regards to validation. While there are ways around this that requires a lot of work and code. In the end I worked around this by parsing the JSON input using JSON Schemas and ignore .NET Core model validation completely.

- The JSON deserialization is a separate step before the model validation; throwing 500 errors if JSON is formatted improperly. If you want consistent error handling and more than just the basic error output across your entire application (deserialization, model validation, business rules, app errors, etc...); good luck. .NET Core makes it difficult to achieve that goal. Same here I used a JSON Schema parsing library to overcome most of my problems and completely ignore .NET Core out-of-the-box features.

- Entity Framework feels as defacto standard; where basic SQL would do in Node or Go. It's a difficult sell to your colleagues if you'd argue EF is redundant and overly complex for the task at hand.

- I first tried to write .NET Core in VS Code like I do Nodejs, Python and Golang. It worked, but I would recommend anyone to use either Visual Studio or Rider instead. The auto highlighting, code hints and refactor tools are just so much better using those tools. Also I frequently ended up deleting the *.sln files and recalculate them using the CLI tool using VS Code. VS Code support for C# + .NET Core is just not mature yet.

- To set an environment variable in Linux the convention is UPPER_CASE. C# / .NET Core uses UpperCase__Double__UnderScore. I know it's minor, but it just feels weird and out-of-touch with linux devops, probably due to a windows-first approach.

- Lack of a popular alternatives like Kotlin or Groovy that provide a more lean & mean approach to tackle simple tasks or build basic microservices. (I don't count F# which is more in the functional domain)

- No out-of-the-box support for measuring test coverage in Linux. Community alternatives are lacking.

- ...

I'm convinced .NET Core is a step forward for the C# community. I'm not convinced it's a step forward for others.

atsjie··on Notes on the Go2 Generics Draft
The proposal reads like an attempt to add generics to a language that was not conceived to include it in the first place.

It looks complex.

atsjie··on MacBook Pro? No
I'm using my MacBook Pro with an external mouse, keyboard and screen both at the office and at home. Haven't opened it in months now. Perhaps Apple had that in mind when they thought of adding "Pro(fessional)" to their MacBook?

No complaints here!

atsjie··on Ten years in, nobody has come up with a use for blockchain
A solidity developer I spoke to a couple of times told me much the same as this article. He believed in the blockchain as a concept; but its current overall benefit to human society is meagre (and some might argue destructive). This represents a first awkward phase for everyone.

We'll definitely see blockchain become dominant in a some or multiple fields of business. When? Perhaps not for 20 years. Internet as we know it took decades for it to fully develop and take off. We could get a crash before this succes happens, the word "blockchain" and "cryptocurrency" might become toxic for a while. Thinking of the 2000 IT bubble, so much money poured into any crazy business proposal with "web" in it; and suddenly the music stopped. Billions evaporated.

All the while I'll just be grabbing popcorn and hoping to sell my coins on time ;-)

atsjie··on What ORMs have taught me: just learn SQL (2014)
Sorry, I should have been more precise. Not all ORM's are designed the same, far from it.

Many ORMs are built using the Unit of Work / Data Mapping patterns. Such ORM's map your data into a separate domain model and manage this model for you. If your orm has something like an "EntityManager" it has likely implemented this Unit of Work pattern.

A key thing the Unit of Work achieves is to commit changes to the database in a single transaction. You often need to update multiple records in an atomic way within enterprise software.

You might not be faced with such challenges in a simple app, but in monolothic enterprise software it's a core feature of what a good backend server does.

Active Record-based ORMs or query builders aid you only a little in this task; they expose the transaction handling logic so much so that it starts to read as a normal SQL database transaction (and might only be cumbersome to use at worst). Here you, the programmer manages it, similar to a normal SQL transaction.

The Unit-of-Work based ORM is more intelligent. It manages the database transaction for you and figures out any changes that were made to the managed entities. In my experience all Java-built enterprise software (I used Hibernate, EclipseLink and Toplink) are designed this way and make heavy use of it. I've used it with Doctrine in PHP quite a lot, and my guess is C#'s Entity Framework is also built around such concepts. That is a big slice of the ORM market.

Here is where the state comes in; different parts of the applications contribute to creating a single database transaction until flush-time. You as a programmer should know when "flush time" actually happens and understand which entities were marked dirty. That is a lot of hidden state that is managed for you; it is in fact the core of what such ORM's do; managing state until it's ready to be flushed. To make it really advanced, powerful ORMs (the popular enterprisey ones) do a lot of caching too, at different times and at different scopes.

When tackling with such tools the distance to normal SQL becomes very large. I think that is where quite a bit of the hate comes from. It's become very powerful magic.

I've been in places where I had to really understand how this magic works to solve serious performance issues with it. I learned a lot, solving problems that shouldn't have existed in the first place.

I don't like magic. It makes me hide in the corner and cry a little.

My comment was targeted towards the UoW / Data Mapper stuff and much less so to Active Record ORM's.

atsjie··on What ORMs have taught me: just learn SQL (2014)
> This is analogous to saying "don't use frameworks". Sound ridiculous? Yes, yes it is.

When developing API's in Golang or for microservice / serverless architectures not using a framework might actually make a lot of sense. Also microframeworks (trimmed-down versions compared to opinionated frameworks) are very popular in almost any language.

atsjie··on What ORMs have taught me: just learn SQL (2014)
I've used http://bookshelfjs.org/ but I'd stay away from it, only felt cumbersome. No productivity gain.

It's built on top a query builder Knex (http://knexjs.org/) which is decent.

atsjie··on What ORMs have taught me: just learn SQL (2014)
The most cringeworthy thing I heard about ORM's actually happened two weeks ago when I explained our use of a query builder rather than an ORM. The new senior developer was talking about speed (??? uhm… k...) and the benefit of being able to switch between PostgreSQL and... MongoDB. I just cringed up, didn't know what to say. Using the same domain model in an RDMBS as a Document Store? I really didn't know how to respond to that.

On the other side you have juniors, just starting development and working with an ORM/ODM the first time. It's not uncommon for them to spend years in development while learning very little SQL at all, hardly understanding the database (apart from what they learn in school). I don't blame them. I hardly know TCP/IP at all and still I write technology for it everyday. But ORMs are a more leaky abstraction; a lot of complexity is made easier by just switching to SQL.

More principal points:

- Why do we want to abstract away further from the most important part of the business: data. Data usually outlives the applications built on top of it.

- Best practice is to keep backend API's stateless and requests short-lived. ORM's promote the use of state. In client-side applications state is a much more interesting long-lived thing, but a backend API these days? It has actually become a lot simpler there since I've started doing development; few modern backend servers render views these days.

I understand why the author (re-)embraced stored procedures but I never will. Blame the overzealous PL/SQL Oracle seniors I've met, god forbid any human bestows such complexity on it's fellow colleagues. It's also hard to automate tests for them and promote it through DTAP alongside an application, hence I keep putting all logic in the application.

I can imagine if the language and ecosystem are very strongly geared towards ORM you shouldn't try to do anything else. That's just painful. But in most languages other than Java and C# I'd make a good consideration if you really need/want an ORM (coming from Java, I never took non ORM design seriously there, but perhaps I shouldn't have).

Not sure where I'll stand in a few years time on this… but for now just happy with plain old SQL and query builders.

atsjie··on Never edit a method, always rewrite it?
When writing functions often I end up deciding fairly quickly if the function I am writing is intended to be reusable or not. If it is reusable I'll write it as a utility function, helper, lib, ... whatever the project's convention and language paradigm might be. Usually similar reusable functions already exist within the project.

A significant portion of functions fall in another category; functions that actually get some real work done. They are specific and not intended for reuse at all.

Applying the "never edit a method, always rewrite it"-rule to those helper/utility functions would just be painful. The public API you designed is designed with a certain purpose and reuse intent. Improving it slightly to fix an issue and forcing yourself to entirely rewrite it would just break things. Most likely you'll end up writing lots of small copies of the original method (how painful this exactly might be depends on the language you're using).

Applying that rewrite-rule to specific functions/methods makes slightly more sense. Here the logic is more tightly bound by business rules/logic, which if they change will quite often warrent a rethink. Particularly because business likes to just slap a feature on top of everything else; which means for us finding ways to keep everything sane in the codebase requires continuous refactoring. Rewriting a function here does not intend to make the function more reusable, it attempts to make the code more clear. Sometimes reusable patterns emerge, but often they don't.

Obviously the above is a simplification of things. Often programmers are obsessed with abstractions and design patterns (read too much GoF, Martin Fowler & Uncle Bob); or don't bother with anything at all (script kiddies, prototype developers, or any code written during a PhD...). The truth lies somewhere in the middle.

atsjie··on Chrome/macOS users in The Netherlands cannot visit google.com or google.nl
Had the same issue. Restart didn't work and Safari was working fine.

For me what worked was removing Google's DNS server 8.8.8.8 from my network settings and voila; it worked.

atsjie··on Why Our Super Bowl Ad Failed
Had the same doubts... although the ad obviously makes no sense with no company/product name being shown.

Pretty sure it's satire, but as a non-american I don't understand it either.

← PreviousPage 3 of 3