HNHacker News
TopNewBestAskShowJobs

jestar_jokin

305 karma · joined February 8, 2010

submissionscomments
jestar_jokin··on First look: adding type annotations to JavaScript
As you say, it's just a matter of familiarity. Sounds like you just need exposure to more programming languages/paradigms, as it's a pretty common convention. I believe it comes from the ML family. OCaml[0] springs to mind. As others have mentioned, Rust[1], Kotlin[2], Haxe[3], Nim[4], Swift[5], Elm[6], Dhall[7], and Scala[8] all use this convention.

The current syntax seems better for type inference and gradual typing.

[0] https://learnxinyminutes.com/docs/ocaml/

[1] https://learnxinyminutes.com/docs/rust/

[2] https://learnxinyminutes.com/docs/kotlin/

[3] https://learnxinyminutes.com/docs/haxe/

[4] https://learnxinyminutes.com/docs/nim/

[5] https://learnxinyminutes.com/docs/swift/

[6] https://learnxinyminutes.com/docs/elm/

[7] https://learnxinyminutes.com/docs/dhall/

[8] https://learnxinyminutes.com/docs/scala/

jestar_jokin··on First look: adding type annotations to JavaScript
Sounds like a problem with some API trying to make everyone happy.

Could be avoided by having more functions, one for each case.

(Only if you control the code, of course.)

jestar_jokin··on Richard ‘Lowtax’ Kyanka, founder of Something Awful, has died
I know Tom Scott, known now for his YouTube videos, was on the forums (I produced a remix for a charity single he made). He's turned out overwhelmingly wholesome and level-headed.
jestar_jokin··on YAML: It's Time to Move On
There's libraries that let you define a schema programmatically, and then infer the types.

https://github.com/sinclairzx81/typebox

jestar_jokin··on Ask HN: What kind of projects make a junior candidate stand out from the rest?
So a candidate has to know someone who's already in the company? Which means they probably went to the same school/uni. Rough for anyone outside your bubble.

Or they cold-call people at the company, hoping to get the goss. Staff knowing about the candidacy should not respond. Others would hopefully be suspicious - how can you trust staff who tell company problems to any old "candidate"?

jestar_jokin··on Yale removes Java to enhance security
Are they also going to remove Python, Ruby, NodeJS, PHP, and every other programming language runtime? Why not?

Hopefully Graal gets more traction, so these Java (and Ruby, NodeJS, Python etc) apps can be compiled to native code, if just to bypass odd decisions like this.

jestar_jokin··on You may not need Moment.js
Libs provide something out of the box to do this, e.g. `ts-essentials` provides `Opaque`, so you just write `type DateString = Opaque<string, 'DateString'>`
jestar_jokin··on You may not need Moment.js
No good if you need to convert between time zones, IME.
jestar_jokin··on You may not need Moment.js
date-fns does not support time zones, so it's not really comparable.

(Although it looks like `js-joda` doesn't contain the time zone database, for that you also need `@js-joda/timezone`, and the IANA TZ DB as generated by `moment-timezone`. Oh boy!)

jestar_jokin··on Ask HN: How do you create a cross-platform GUI without using Electron?
Windows 8 really broke the UI, to support tablets, and the OS has never recovered. :(
jestar_jokin··on Ask HN: How do you create a cross-platform GUI without using Electron?
Doesn't Flutter fail point 1: all widgets are custom rendered (OpenGL) things? So integration with the host OS's capabilities may be lacking (e.g. accessibility features).
jestar_jokin··on Pining For Feudalism As An Antidote For Modernity (2011)
What "prevailing socialist false narrative" are you talking about?

I don't see how print media, owned 62.4% by Fox News/Murdoch and 26.4% by Nine (chaired by Peter Costello, former treasurer for the conservative Liberal government), can be considered anything _but_ "prevailing".

Is there some other definition of "mainstream media" I'm not aware of?

Perhaps there is a false narrative, but it may not be the one you're thinking of.

jestar_jokin··on Australia is becoming a surveillance state
South Australia has been doing pretty well with a renewables-backed grid.

There was a smear campaign in 2016 regarding a state-wide blackout, caused by severe weather affecting the distribution & transmission infrastructure. [see #1] The incumbant political party used this as an opportunity to blame the renewable generators (and state government, from the "opposite side" of politics). [see #2]

The same severe weather event would have affected any power generator.

[1] https://www.aer.gov.au/wholesale-markets/compliance-reportin... [2] https://en.wikipedia.org/wiki/2016_South_Australian_blackout...

jestar_jokin··on Australia is becoming a surveillance state
A forward-thinking government would be incentivising a diverse economy, subsidised by the windfall from the currently profitable industries.

Instead, the incumbant governments just subsidise the inumbant industries; or rather, the existing "winners". (E.g. subsidising Murdoch media, mining companies, all pulling in millions/billions in profit.)

Australia has one of the lowest rankings in terms of economic complexity [see #1]. Until the government can subsidise emerging markets, there's no reason for businesses to take risks - the low population can't support it.

Propping up existing industries will eventually be a failing strategy. When Australia's "luck" (exploitable resources) runs out, "what comes after will not be so comfortable". But there's still time to steer away from that discomfort. (Unlike the imminent ecology collapse...)

[1] https://www.aumanufacturing.com.au/astralias-low-economic-co...

jestar_jokin··on Windows 11 will create heaps of needless trash
I think this article misunderstands the list of supported processors. The Microsoft page is for hardware developers, e.g. laptop and desktop manufacturers. They shouldn't be using CPUs that aren't currently manufactured/supported anyway. I don't think it restricts anyone running Windows on their existing older hardware.

I'm still on an i7 4790K, and it's not listed as a supported CPU in the lists for Windows 10.

jestar_jokin··on Programming is hard
It's German punctuation.

https://www.thoughtco.com/german-zeichensetzung-punctuation-...

jestar_jokin··on Comparing Svelte and React
The danger is that a developer will use `svelte.each()`, thinking it uses the same rules as normal JS syntax, but it turns out Svelte applies its own rules which _are_ slightly different (hypothetically).

So the developer must remember a new rule: "JS rules when calling foo.each(), Svelte rules when calling svelte.each()". A little harder to remember. Having a unique non-JS syntax makes the distinction obvious.

(Just playing Devil's Advocate here)

jestar_jokin··on Find the Hard Work You're Willing to Do (2018)
> the algorithm has transformed our world in its image

So it is, and so it will ever be.

https://en.wikipedia.org/wiki/Historical_materialism

> history is the result of material conditions rather than ideals

jestar_jokin··on Ishkur's Guide to Electronic Music
I remember it from 2001...! It was very helpful in exposing me to genres I would never have otherwise known about from my semi-rural upbringing.
jestar_jokin··on Bad TypeScript Habits
I've got a team that insists all types go into `.d.ts` files. For every type internal to the app (an API backend). The types are never exported, not even to the frontend. Apparently because the tech lead thinks importing types is noisey.

My pleas, of "just fold the imports in your editor" and "it makes the types globals, so it's not modular" and "interface /declaration merging becomes an issue" all fell on deaf ears.

Some people like their bad habits because it makes sense to them, I guess.

jestar_jokin··on Asciidoctor
I evaluated formats for online docs for a Node.js library I was writing. Asciidoc(tor) was the only one I found that was available as JS lib (thanks to Asciidoctor.js), but more importantly, it could include marked sections from external code files within the docs.

This meant I could write code examples within unit tests, and include sections of those tests in the docs, keeping the docs in sync with the actual code and making sure the examples are still valid.

Does anyone know another doc format that supports this?

jestar_jokin··on Greenland Melting Fastest Any Time in Last 12,000 Years
The Competitive Enterprise Institute is an industry advocacy group, with ties to Koch, coal, tobacco.

https://www.sourcewatch.org/index.php/Competitive_Enterprise...

Their "scientists" have no relevant credentials and are actually "public policy advisors", and usually spread their opinions across multiple unrelated fields (which happens to coincide with whatever disinformation they're trying to spread).

I recently encountered them on Reddit, where people were trying to say the Australian bushfires were just caused by arsonists; these people are from the US and have no idea what's going on in Australia (how did they uncover evidence of arson before the local police?), there was absolutely no evidence for arson, and it didn't explain why it spread so far & rapidly.

Please make sure you get your information from credible sources; as in, sources without a vested interest in industries that have a long history in disinformation campaigns.

jestar_jokin··on Show HN: Warp, a Python based music-theory aware MIDI sequencer
A MIDI sequencer just outputs MIDI instructions, it doesn't generate sound unless it implements a synth (sound generator) of some sort.

You'd need to install something like loopMIDI, and direct the output of the sequencer to the input of a VST host, where you can load whatever synths you want.

jestar_jokin··on Dumb Rules That Make Your Best People Want to Quit (2017)
Right, because managers never need feedback on how well they're managing their staff...?!

Some shops have "360 degree reviews", where you need to get reviews from your colleagues and people you serve (or to use an ungenerous phrase, your underlings), not just your boss.

jestar_jokin··on Best project management software for a system migration?
As a low-cost option, maybe Google Forms? You could define it as a survey, defining your "process" and "signoff" fields. The results can be automatically recorded into a "Google Sheets" document, for easy reporting and analysis.
jestar_jokin··on Capitalism Killed Our Climate Momentum, Not “Human Nature”
I don't think renewable energy will solve all our upcoming issues, trying to keep our current global population fed and living nicely. (Plastic contamination of the biosphere, food production capabilities, deforestation for farmland & renewable crops, climate migration, etc.)
jestar_jokin··on Ask HN: As a CTO, what is your most frustrating problem with technical debt?
Given the uncertain business direction, you will definitely need to make the code easy to change. Low quality code inhibits that.
jestar_jokin··on Be Nice and Write Stable Code
In programming, type contracts are not. Wouldn't it be nice if we had some sort of infallible static analysis tool that absolutely determines what constitutes a breaking change in your codebase?
jestar_jokin··on Be Nice and Write Stable Code
The issue is that because not everyone follows SemVer, you have to assume that no-one follows SemVer and act defensively, otherwise you will have problems.

Ideally, there would be a tool that can inspect your entire codebase and determine if the change is "breaking". This still has issues if the change lies outside of your codebase (perhaps such as changing the configuration of your AWS services).

jestar_jokin··on Ask HN: Why do you dislike Jira?
I've noticed the UI to be a bit schizophrenic. The list view has one way of displaying a ticket, but a ticket's details has another way of displaying the ticket. It's slowly becoming standardised, but I always have to hunt around to find the fields I'm looking for (often having to go into the details view).
Page 1 of 6Next →