Hacker Newsnew | past | comments | ask | show | jobs | submit | franky47's commentslogin

Except you hit limits when trying to share that URL. Eg: try pasting a URL longer than 4096 bytes in Signal or WhatsApp, and they don't render it as clickable.

Thanks for mentioning it! (I'm the author)

Thanks for the feedback, Vercel domain uses nuqs [1] (I'm the author) for URL state, and I agree flooding the browser history is a bad experience.

Is there a way to update the URL (ie: keeping it reactive in the address bar) without creating those history entries, or to ask the browser to squash the last entry it created into the previous one?

[1] https://nuqs.dev


I am not aware of any approaches that work consistently across all major browsers. This matter is nothing new -- there's a Bugzilla report[0] from 13 years ago about this behavior that remains open.

Since there's no spec for global history and it's unlikely one will be introduced, the most practical solution to avoid flooding the browser history would be to debounce the changes.

This is the approach taken by Google Maps -- with maps being a well-known case where URL updates would clutter the history, as noted in the Bugzilla report.

[0] https://bugzilla.mozilla.org/show_bug.cgi?id=753264


Cursed alphabetical sorting of numbers:

8 5 4 9 1 7 6 3 2 0

Can you guess what it is?


They are sorted by their Unicode character names obviously

U+0038 DIGIT EIGHT

...

U+0030 DIGIT ZERO


The reaction (removing the package) is also similar to an inexperienced developer when confronted to their first vulnerability report.

Assuming good intentions (debugging) rather than malice was at play, communication is key: drop the malicious version of the package, publish a fix, and communicate on public channels (blog post, here on HN, social media) about the incident.

A proper timeline (not that AI slop in the OP article) also helps bring back trust.


You can run TypeScript natively in Node.js 24, actions based on that runtime don’t need a build step.

https://bsky.app/profile/danielroe.dev/post/3lxczp5apec2x


I think it just ignores types, so may not suit all use cases.


It has a (albeit experimental) flag for transforming enums, namespaces and other runtime-impacting aspects of TypeScript, if that’s what you were referring to?

https://nodejs.org/api/cli.html#--experimental-transform-typ...


And ruin a good 90’s film & series’ SEO in the process.


> One thing I was thinking of was sort of a "delayed" mode to updating my own dependencies.

You can do this with npm (since version 6.9.0).

To only get registry deps that are over a week old:

    $ npm install --before="$(date -v -7d)"
Source: Darcy Clarke - https://bsky.app/profile/darcyclarke.me/post/3lyxir2yu6k2s


What’s a good (ie: opinionated) code formatter and unit test framework for C++ these days?

I just had a PR on an old C++ project, and spending 8 years in the web ecosystem have raised the bar around tooling expectations.

Rust is particularly sweet to work with in that regard.


My go to for formatting would be clang-format, and for testing gtest. For more extensive formatting (that involves the compiler) clang-tidy goes a long way


I think you meant for more extensive static analysis. Clang-tidy is really awesome. There is also Facebook's Infer.

  https://fbinfer.com


Clang tidy does both: it can run clang's analyzer [0] (also available with clang++ --analyze or the scan-build wrapper script which provides nicer HTML-based output for complex problems found), has it's own lightweight code analysis checks but also has checks that are more about formatting and ensuring idiomatic code than it is about typical static analysis.

MVSC [1] and GCC [2] also have built-in static analyzers available via cl /analyze or g++ -fanalyzer these days.

There is also cppcheck [3], include-what-you-use [4] and a whole bunch more.

If you can, run all of them on your code.

[0] https://clang-analyzer.llvm.org/

[1] https://learn.microsoft.com/en-us/cpp/build/reference/analyz...

[2] https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.h...

[3] https://cppcheck.sourceforge.io/

[4] https://github.com/include-what-you-use/include-what-you-use


Catch2 is great as a unit test framework.

Running unit tests with the address sanitizer and UB sanitizer enabled go a long way towards addressing most memory safety bugs. The kind of C++ you write then is a far cry from what the haters complain about with bad old VC6 era C++.


> Catch2 is great as a unit test framework.

It's "great" mainly in the sense of being very large, and making your code very lage - and slow to build. I would not recommend it unless you absolutely must have some particular feature not existing elsewhere.

Here's a long list of C++ unit testing frameworks: https://en.wikipedia.org/wiki/List_of_unit_testing_framework...

And you might consider:

* doctest: https://github.com/doctest/doctest

* snitch: https://github.com/snitch-org/snitch

* ut/micro-test: https://github.com/boost-ext/ut


I guess I consider it great in comparison to CppUnit, Boost Test, and Google Test. I also like that it incorporated nonius, that's a big win.


The only formatter is clang-format, and it isn't very good. Better than nothing though.


Anthony Fu’s epoch versioning scheme (to differentiate breaking change majors from "marketing" majors) could yield easy winners here, at least on the raw version number alone (not the number of sequential versions released):

https://antfu.me/posts/epoch-semver


> People often assume that a zero-major version indicates that the software is not ready for production

I wonder why. Conventions that are being broken, maybe.


I don't know if this is the origin, but the semver spec says 0.x.y is unstable. Sure, not everybody uses semver, but it is popular enough for people to make incorrect assumptions.

https://semver.org/#spec-item-4


It's not the origin. Using 0.x for stuff like this was already a thing long before semver. For example, the very first release of Linux in 1991 was v0.01.


I agree with that sentiment.

If the guy writing and maintaining the software is stating "this software is not stable yet" then who am I to disagree?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: