frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Reversing engineering is a great way to find programming trainwrecks

1•quozine•2h ago
Not that long ago, I was trying to reverse part of a piece of software so I could work with a proprietary format. Along the way, I encountered some of the worst code I have ever seen. And mind you, this was in a widely-used professional software developed by a multi-billion dollar company.

* The program was centered around a single core library. This library worked by loading several component libraries and then providing wrappers around them. The way the wrappers worked was a bit convoluted, but this was probably the least bad part of it.

* The largest component library involved creating an object and then calling its methods. Rather than implementing this directly, it was done in this bizarrely convoluted way where an object would be created and then a pointer would be put in a small, fixed-size array. The function then returned an index into that array. All the methods would then work on that index instead of the pointer directly. Some methods checked the bounds, while others didn't. If the array filled up, the program would crash.

* There was a static mapping of strings that was used as a lookup table. The table was indexed by the first two letters in each entry. Every time a value in the table was looked up, it would search through all the index prefixes until it found the matching one. It would then search through every entry in the table with that prefix. It would stop if either the entry matched, or the prefix changed. There was no boundschecking whatsoever. If the key contained a prefix not in the index, it would crash. If the key was not in the index and the prefix was the last prefix, it would wait for the prefix in the table to change, going past the end and crashing. The cherry on top was that everything was already completely lexicographically sorted, so they could have just used bsearch without having to change anything else. Oh and this was not a small amount of data in a minor part of the program, it was 5MB+ of data with 100,000+ entries that was regularly called from a loop that runs thousands of times.

* In the biggest component, nearly everything was stored in one enormous class. And I mean enormous. It was dozens of megabytes in size and had hundreds of fields. Nearly every other class and struct was embedded in it, directly without a pointer. Well actually there were some pointers but that part was even more absurd. The class contained pointers to various objects, but those objects were already in the class - but sometimes they weren't. There was a whole bunch of spaghetti code to check whether they were in the class directly, or whether the pointers pointed to classes that were allocated in the heap, or if they were null. All of this seemingly served no purpose whatsoever.

* There was a function that took a c-string of a directory path and added another c-string containing a filename. Rather than just using a malloc and strcat, it did the following: create an std::vector; parse the directory path splitting each '/', converting it to wide-character string and then appending it to the vector; convert the file name to a wstring and appended it too; create a new wstring and then append each element of the array followed by a '/'; convert the wstring back to a c-string. I'm not kidding.

This was just the tip of the iceberg.

A Guide to the Layout of a Talmud Page [pdf]

https://murals.wbtla.org/uploads/2/4/7/9/24790045/talmud_layout_(1).pdf
1•nxobject•41s ago•0 comments

ChatGPT Ads May Prioritize Sponsored Content in AI Responses

https://www.seroundtable.com/openai-chatgpt-ads-sponsored-content-40657.html
1•geox•1m ago•0 comments

Undefinable yet Indispensable

https://aeon.co/essays/the-word-religion-resists-definition-but-remains-necessary
4•Thevet•4m ago•0 comments

Two Different Paths for Psilocybin Biosynthesis in Inocybe&Psilocybe Mushrooms

https://onlinelibrary.wiley.com/doi/full/10.1002/anie.202512017
1•bookofjoe•4m ago•0 comments

Claude-Code-Remote: Control Claude Code remotely via email、discord、telegram

https://github.com/JessyTsui/Claude-Code-Remote
1•simonpure•5m ago•0 comments

Tangled: Git over ATProto

https://anirudh.fi/future
1•quaintdev•5m ago•0 comments

Laissez-Faire Listening

https://tribunemag.co.uk/2025/06/laissez-faire-listening
1•robtherobber•7m ago•0 comments

Claude helped me get a full-time job

https://www.reddit.com/r/ClaudeAI/s/dwwO53wyhh
1•theali•9m ago•0 comments

Ask HN: Why are you Christian?

2•zcase•13m ago•1 comments

Local AI apps worldwide 26 Dec 2025

https://old.reddit.com/r/Hugston/comments/1pw3oev/best_local_ai_apps_dec_2025_according_to/
2•trilogic•14m ago•1 comments

We log everything except the reason

https://www.sanju.sh/writings/capture-the-why
1•spikey_sanju•16m ago•1 comments

Asus ROG laptops are broken by design: a forensic deep dive

https://www.reddit.com/r/programming/s/3hyqIHDd4n
2•pdpi•16m ago•0 comments

Laser-assisted 3D printing can fabricate thermoset-based electronics in seconds

https://techxplore.com/news/2025-11-laser-3d-fabricate-free-thermoset.html
1•PaulHoule•17m ago•0 comments

Nvidia CUDA Tile IR Open-Sourced

https://www.phoronix.com/news/NVIDIA-CUDA-Tile-IR-Open-Source
1•rbanffy•19m ago•0 comments

Ask HN: What information do you always wish you had when debugging a bugs?

1•nishilpatel•20m ago•0 comments

LLM Awards 2025: Based on Workflow, Value and Taste

https://apurva-mishra.com/posts/4/
1•mav3ri3k•21m ago•0 comments

Show HN: Vix.cpp v1.17.0 – Production-grade web back end examples in modern C++

1•gkirira•25m ago•0 comments

LearnixOS

https://www.learnix-os.com
3•gtirloni•27m ago•0 comments

Peter Naur's legacy: Mental models in the age of AI coding

https://www.nutrient.io/blog/peter-naur-legacy-mental-models-age-ai-coding/
1•code_myx•28m ago•0 comments

Ask HN: What did you read in 2025?

15•kwar13•32m ago•10 comments

Yann LeCun: New Vision Language JEPA with Better Performance Than LLMs

https://arxiv.org/abs/2512.10942
2•bluedevilzn•33m ago•0 comments

New Linux Patches Improve ExFAT Read Performance via Multi-Cluster Mapping

https://www.phoronix.com/news/Linux-exFAT-Reads-MC-Map
1•Bender•33m ago•0 comments

Remove CapCut Watermarks with AI – Build a Flicker-Free Inpainting System

https://blog.videowatermarkremove.com/remove-capcut-watermark-ai
1•ilmj8426•34m ago•0 comments

Humanoid robots are still novelty acts, but investment is surging make them real

https://www.theregister.com/2025/12/25/humanoid_robots_investment_surge/
1•Bender•37m ago•0 comments

3.5M Affected by University of Phoenix Data Breach

https://www.securityweek.com/3-5-million-affected-by-university-of-phoenix-data-breach/
2•Bender•37m ago•1 comments

Historical mysteries solved by science in 2025

https://www.cnn.com/2025/12/23/science/historical-mysteries-solved-2025
2•giuliomagnifico•37m ago•1 comments

Show HN: Figma Alternative Free – [In Progress]

https://www.absl.design/
4•absolute7•40m ago•0 comments

Package managers keep using Git as a database, it never works out

https://nesbitt.io/2025/12/24/package-managers-keep-using-git-as-a-database.html
6•birdculture•41m ago•0 comments

Why international money transfers are more expensive than they look

https://idealremit.com
1•bk-mira•41m ago•1 comments

Show HN: Tiny-UUID – UUID v4 in 200 bytes. That's 40x smaller than UUID package

https://github.com/takawasi/tiny-uuid
1•takawasi•43m ago•0 comments