Better HN
topnewbestaskshowjobs
Log inSign up

hackthemack

854 karma · joined Dec 10, 2018 (7y ago) · 159 submissions

Submissions

comment 12mo ago · link · parent

I agree. But, I think the execs just say, "How can we get the most bang for our buck? If we use X, Y, Z technologies, that are the new hotness, then we will get all the new hordes of hires out there, which will make them happy, and has the added benefit of paying them less"

comment 12mo ago · link · parent

I agree. Perhaps, "by design" is not the correct phrasing. Many decisions and effects go through a multi weighted graph of complexity (sort of like machine learning).

comment 1y ago · link · parent

I have a theory that the churn in technology is by design. If a new paradigm, new language, new framework comes out every so many years, it allows the tech sector to always want to hire new graduates for lower salaries. It gives a thin veneer of we want to always hire the person who has X when really they just do not want to hire someone with 10 years of experience in tech but who may not have picked up X yet.

I do not think it is the only reason. The world is complex, but I do think it factors into why software is not treated like other engineering fields.

comment 1y ago · link · parent

One thought I recently had, since using deepCopy is going to slow things down, is if the source code for QuickJS could be changed just make copies. Then load up quickJs as a replacement for the browsers javascript by invoking it as wasm.

comment 1y ago · link · parent

> It's unclear to me what the author thinks OOP is

I rather liked the old post "Object Oriented Programming is an Expensive Disaster that Must End" written over 10 years ago.

https://medium.com/@jacobfriedman/object-oriented-programmin...

Many complained the post was too long, and then debated all kinds of things brought up in the article (such is the way of the internet).

But the one thing I really liked is how it laid out that everyone has a different definition of what OOP is and so it is difficult to talk about.

comment 1y ago · link · parent

I am a fan of immutability. I was toying around with javascript making copies of arguments (even when they are complex arrays or objects). But, strangely, when I made a comment about it, it just got voted down.

https://news.ycombinator.com/item?id=45771794

I made a little function to do deep copies but am still experimenting with it.

  function deepCopy(value) {
    if (typeof structuredClone === 'function') {
      try { return structuredClone(value); } catch (_) {}
    }
    try {
      return JSON.parse(JSON.stringify(value));
    } catch (_) {
      // Last fallback: return original (shallow)
      return value;
    }
  }

comment 1y ago · link · parent

Fair point.

I did not usually see a free roaming cart though. Maybe times have changed. Usually, people would prop them up against a curb, or ditch them into a grassy spot, or they would put them by a low spot in the parking lot next to a drain, or put them next to a column on the sidewalk.

Just my anecdotal experience, it seemed like people would put their cart back if there was a cart corral in the center of every parking row.

comment 1y ago · link · parent

I worked at a grocery store for a while in my teens and early twenties. It is really a surprise to me that this has become an internet topic and even more surprising how strongly people feel like it is a litmus test for good vs bad. I just do not think it is a good litmus test. People are busy, some people have kids. Who is really being inconvenienced?

One thing I want to point out is that everyone I worked with at a grocery store loved going out and getting the carts. The employees saw it as a mini-break from the drudgery of the day.

From having to go get carts many times, I will say, that if someone leaves their cart in a parking spot... well that is bad behavior. But if they just push it into the grass, or out of the way, who cares if it is tucked away there, or tucked away at cart corral. Someone has to go out and get the carts anyway, and it broke up the day, got you outside.

99.

The US Is Rebuilding the Airfields That Staged the Hiroshima Nuclear Strike(rferl.org ↗)

5 points · by hackthemack · 1y ago · 3 comments

100.

DeepSeek may have found a new way to improve AI's ability to remember(technologyreview.com ↗)

3 points · by hackthemack · 1y ago · discuss

comment 1y ago · link · parent

Thinking on this subject a bit more. I have to wonder if C++ made references just so there is a fast an efficient way to mutate without having to make a copy?

Maybe someone should work on a way to make references in javascript land. Sort of like immer but baked in.

https://immerjs.github.io/immer/

comment 1y ago · link · parent

I guess in javascript world, the phrasing I am looking for would be

I wish all arguments were copies unless I put some symbol that says, alright, go ahead and give me the original to mutate?

It seems like this way, you reduce side effects, and if you want the speed of just using the originals, you could still do that by using special notation.

comment 1y ago · link · parent

It is a similar idea to what Carmack is writing about. Golang, Clojure does something similar to what I am talking about above so not sure of the motivation behind the voting down of the comment.

comment 1y ago · link · parent

One area that I like to have immutability is in function argument passing. In javascript (and many other languages), I find it weird that arguments in function act differently depending on if they are simple (strings, numbers) versus if they are complex (objects, arrays).

I want everything that passes through a function to be a copy unless I put in a symbol or keyword that it suppose to be passed by reference.

I made a little function to do deep copies but am still experimenting with it.

  function deepCopy(value) {
    if (typeof structuredClone === 'function') {
      try { return structuredClone(value); } catch (_) {}
    }
    try {
      return JSON.parse(JSON.stringify(value));
    } catch (_) {
      // Last fallback: return original (shallow)
      return value;
    }
  }

105.

Trump orders immediate resumption of US nuclear weapons testing(france24.com ↗)

30 points · by hackthemack · 1y ago · 38 comments

comment 1y ago · link · parent

The Luanti client lets you search and install mods from content.luanti.org

It differentiates between mods and games. A game changes the core game to be much more different, but sometimes a game is just a collection of some other mods.

https://content.luanti.org/packages/?type=game

Personally, I find it more fun to just go and click on about 6 to 8 mods that are interesting and see how the game goes.

https://content.luanti.org/packages/?type=mod

Some of my picks are...

https://content.luanti.org/packages/ElCeejo/animalia/

https://content.luanti.org/packages/random-wizard/gear_up/

https://content.luanti.org/packages/TenPlus1/farming/

https://content.luanti.org/packages/FreeLikeGNU/goblins/

comment 1y ago · link · parent

I much prefer just writing stuff for Luanti (formerly minetest).

You can, pretty much, get the Minecraft experience by downloading mods. Or just use the VoxeLibre game mod.

https://content.luanti.org/packages/Wuzzy/mineclone2/

The mods are written in lua and you can find the source code for most of them.

One I like is Zoonami which turns the experience into a Pokemon like game.

https://content.luanti.org/packages/isaiah658/zoonami/

comment 1y ago · link · parent

I do not use ai image generating much lately. It seemed like there was a burst of activity a year and half ago with self hosted models and using some localhost web guis. But now it seems like it is moving more and more to online hosted models.

Still, to my eye, ai generated images still feel a bit off when doing with real world photographs.

George's hair, for example, looks over the top, or brushed on.

The tree added to the sleeping person on the ground photo... the tree looks plastic or too homogenized.

comment 1y ago · link · parent

I guess I just never encounter code like this in the big enterprise code bases I have had to weed through.

Question. If you want to do one email for expired users and another for non expired users and another email for users that somehow have a date problem in their data....

Do you just do the const emails =

three different times?

In my coding world it looks a lot like doing a SELECT * ON users WHERE isExpired < Date.now

but in some cases you just grab it all, loop through it all, and do little switches to do different things based on different isExpired.

comment 1y ago · link · parent

It has been so long since I worked on the code that had chaining functions and caused problems that I am not sure I can do justice to describing the problems.

I vaguely remember the problem was one function returned a very structured array dealing with regex matches. But there was something wrong with the regex where once in a blue moon, it returned something odd.

So, the chained functions did not error. It just did something weird.

Whenever weird problems would pop up, it was always passed to me. And when I looked at it, I said, well...

I am going to rewrite this chain into steps and debug each return. Then run through many different scenarios and that was how I figured out the regex was not quite correct.

comment 1y ago · link · parent

Yeah. I did not mention what I would do, but what you wrote is pretty much what I prefer. I guess nobody likes it these days because it is old procedural style.

comment 1y ago · link · parent

I never liked encountering code that chains functions calls together like this

email.bulkSend(generateExpiryEmails(getExpiredUsers(db.getUsers(), Date.now())));

Many times, it has confused my co-workers when an error creeps in in regards to where is the error happening and why? Of course, this could just be because I have always worked with low effort co-workers, hard to say.

I have to wonder if programming should have kept pascals distinction between functions that only return one thing and procedures that go off and manipulate other things and do not give a return value.

https://docs.pascal65.org/en/latest/langref/funcproc/

113.

Casey Muratori interview, math education failures and switching away from OOP [video](youtube.com ↗)

2 points · by hackthemack · 1y ago · discuss

comment 1y ago · link · parent

For anyone curious, the draw a circle code in Circle.asm appears to use Bresenham's circle drawing algorithm.

https://www.geeksforgeeks.org/c/bresenhams-circle-drawing-al...

The secret is to draw 1 arc of a 45 degree angle and the reflect it (redraw it with different coordinates).

comment 1y ago · link · parent

I feel like this was known years ago, but never gained traction. Here is a 2022 article in wired about bots.

https://www.wired.com/story/bots-online-advertising/

And before that, in the 2010s, an employee of ebay discovered the perverse incentives of online advertising. Freakonomics did a podcast on the subject. It is a two parter, but really worth your time if you want to get some of the behind the scenes thoughts and machinations of the advertising industry.

https://freakonomics.com/podcast/does-advertising-actually-w...

comment 1y ago · link · parent

QuickJS is amazing. You can put in javascript code, run it through QuickJS and make little binary utilities to run on their own.

Someone took QuickJS and put it in wasm so you can run QuickJS in the browser or in node.

https://github.com/justjake/quickjs-emscripten

Fabrice Bellard is on another planet when it comes to programming. He also wrote FFmpeg and QEMU (among other things).

comment 1y ago · link · parent

I remember a Doctor Who episode where he said, paraphrasing, "You never get credit for the crisis you prevented before it happened".

Sort of https://en.wikipedia.org/wiki/Preparedness_paradox

comment 1y ago · link · parent

I find the use of "illegible" in the title weird myself. To my mind, the word they should use is Intangible.

comment 1y ago · link · parent

The content of the article about how do you measure software talent hit home with me. I am not saying I am some x10 developer, but all the metrics used at the companies I worked at just do not capture what makes a good software developer employee.

Today's hiring process feels like you have to go memorize algorithms instead of valuing things an employee actually has done in the past. And if the thing that was done in the past is something older, like Ruby on Rails, or an old PHP project it actually has a negative connotations in respect to hire-ability.

123456