News for hackers. Stuff that matters.

kosmotaur

Re:I Don't Like Magic on Saturday February 21, 2026 @06:29PM (#47106187)
> I get that. But I still draw a line. When it comes to front-end development, that line is for me to stay as close as I can to raw HTML, CSS, and JavaScript. After all, that’s what users are going to get in their browsers.

No it’s not. They will get shown a collection of pixels, a bunch of which will occupy coordinates (in terms of an abstraction that holds the following promise) such that if the mouse cursor (which is yet another abstraction) matches those coordinates, a routine derived from a script language (give me an A!) will be executed mutating the DOM (give me a B!) which is built on top of more abstractions than it would take to give me the remaining S.T.R.A.C.T.I.O.N. three times over. Three might be incorrect, just trying to abstract away so that I don’t end up dumping every book on computers in this comment.

Ignorance at a not so fine level. Reads like “I’ve established myself confidently in the R.A.C. band, therefore anything that comes after is yucky yucky”.

Re:Philips Hue will soon force users to create an account on Thursday September 21, 2023 @05:14AM (#37595149)
what's HA?
Re:DRY is an over-rated programming principle? on Thursday July 07, 2022 @10:51AM (#32014855)
> copypaste is a friend of readable and mantainable specs

Another generic statement: copypaste (as I understand you mean the opposite of extracting common code) between specs goes against single responsibility. Rather than `setupUser()` you open a connection, create a user fixture, write it to the db, and then paste that across all the specs. Doing quite a lot.

I can imagine a spec with let's say 20 cases. Arrangement of each takes about 6 lines to load something, change some state the test subject depends on, the usual stuff, like in the above example.

A week from now, 10 cases need an extra line of setup, which you dutifully paste across the specs which require them. You put it somewhere in the middle, as it needs an id from the first step of 6.

This happens once or twice. The commonality of the original 6 copy pasted all over the place is hashed up, interspersed with calls specific to each test. The linking factor between those 6 lines is now obscured and requiring careful analysis if only those 6 need to change.

This can be avoided if you extract the common bits out early on. Rule of three is your friend if you don't want to rush it.

Re:My Path to Financial Independence as a Software Engineer on Sunday December 26, 2021 @06:02AM (#29691399)
What proportion that must have been compared to the base! Even if it was 60% the base is still mind blowing.
Re:My Path to Financial Independence as a Software Engineer on Sunday December 26, 2021 @05:48AM (#29691321)
625k a year? Doing what exactly? Good for you, but I have never seen a spec with even a third of that salary. Or is it that it's only FAANG who's paying that big?
Re:Ask HN: Who Is Firing? on Thursday April 16, 2020 @06:09AM (#22887836)
Equal Experts UK replaced me with a cheaper offshore contractor