News for hackers. Stuff that matters.
Re:SumatraPDF Reader by commandersaki on Monday October 23, 2023 @10:49PM (#37994363)
Great retrospective of SumatraPDF from the author: https://blog.kowalczyk.info/article/2f72237a4230410a888acbfc... .
Re:SumatraPDF Reader by jcparkyn on Tuesday October 24, 2023 @12:56AM (#37994951)
Interesting read. I was very surprised by the mention of adding editing features at the end. That sounds like a proverbial black hole of potential feature requests and "bloat".
Re:SumatraPDF Reader by arp242 on Tuesday October 24, 2023 @01:44AM (#37995190)
Lessons learned from 15 years of SumatraPDF, an open source Windows app - https://news.ycombinator.com/item?id=27968900 - Jul 2021 (133 comments)

Lessons learned from 15 years of SumatraPDF, an open source Windows app (2021) - https://news.ycombinator.com/item?id=35065785 - Mar 2023 (173 comments)

Re:SumatraPDF Reader by zerr on Tuesday October 24, 2023 @03:27AM (#37995787)
> The problem is that Gtk is ugly, Qt is extremely bloated and WxWidgets barely works.

Seems like the author didn't look at cross-platform toolkits since 90s.

Re:SumatraPDF Reader by pjerem on Tuesday October 24, 2023 @03:32AM (#37995818)
What changed exactly ? Gtk is still ugly on anything that is not Linux, Qt is still bloated and wxWidgets, well here I don’t know.
Re:SumatraPDF Reader by KRAKRISMOTT on Tuesday October 24, 2023 @03:34AM (#37995826)
Flutter is decent, most of the browser/Skia based UI kits are more consistent and made by people who have an appreciation for design and aesthetics. But I think Sumatra predates most, if not all of them.
Re:SumatraPDF Reader by Sakos on Tuesday October 24, 2023 @04:34AM (#37996279)
> appreciation for design and aesthetics

Sure, but not accessibility or UX design. There's more to a good UI than looking pleasant. Far more. I wish we hadn't unlearned that in the past decade, because Flutter and browser-based UI kits throw all of that out the window.

Re:SumatraPDF Reader by OvbiousError on Tuesday October 24, 2023 @03:45AM (#37995910)
What does "Qt is bloated" even mean. It's a big framework, split into separate libraries, you include only what you use. Qt is free (most parts are LGPL) and is developed by 100+ professional developers. The quality of the implementations, API and documentation is very very good.

Discarding it out of hand by "qt is bloated" just feels disingenuous to me. You can add to that the fact that qml on the desktop if finally maturing into a viable alternative for widgets, and UI development with qml is such a breath of fresh air.

Re:SumatraPDF Reader by dspillett on Tuesday October 24, 2023 @05:22AM (#37996624)
> What does "Qt is bloated" even mean.

From a user perspective I remember that being a big thing some time ago when people didn't have anything already using Qt install did an “apt install” or “yum install” on something that did and saw the small tool they were wanting was going to drag half a desktop environment in with them as dependencies. The same could likely be said for GTK in reverse, I'm not sure what their relative sizes for similar features are these days.

Some use bloated to mean the memory footprint. IIRC GTK has more of a reputation for eating RAM than Qt, but again maybe people notice a single Qt app using a lot of resource (that would be shared if running multiple apps against the same libs) when it is the only one they run.

As you suggest, just stating that “<whatever> is bloated” without reference to some details of what is meant by that, sounds a bit like someone parroting old information and/or group-think rather than having looked into it recently.

Having said that the author has a minimal dependency stance in order to try to maintain a small footprint for the app (“I avoid unnecessary abstractions.” in the section about keeping things small) so any framework that isn't little more than a cosmetic wrapper could legitimately be called more bloated than using nothing at all and talking more directly to the standard OS libs. Also in context (discussing why the product is not cross-platform and is never likely to be) this is not the only reason being given and probably not the most significant one (there may be significant selection of cross-platform issues beyond the UI framework).

The key to a lot of what is in that document is the “It’s my project and I act like it” part. All too often we forget this very important side of things, especially with one-man or small-team projects, and people comment on project decisions as if using the product gives some automatic expectation that the creator will mould it around the needs/wants of a given user or someone's idea of “the community”. For an open source project the community has the option of forking the project or offering to fund the changes they want that aren't otherwise on the creator's roadmap (though obviously the larger the project, the less practical these options may be)…

Re:SumatraPDF Reader by LinAGKar on Tuesday October 24, 2023 @05:41AM (#37996749)
Sumatra is know for being small, with the portable version currently being 15.3 MiB. QtCore and QtGui together is some 11 MiB (checking the DLLs used by KDE programs on Windows), so those alone would increase the size significantly.
Re:SumatraPDF Reader by whizzter on Tuesday October 24, 2023 @03:39AM (#37995856)
Honestly, this is a guy who uses GDI, so most of the above options will feel bloated already when looking at the source tarball sizes.

That said, has there been any fundamentally groundbreaking crossplatform classic UI toolkits released since the 90s? (IMGui is the only one that has seemed interesting but that's specialized and not a general one really)

[dead]
Re:SumatraPDF Reader by whizzter on Tuesday October 24, 2023 @03:03PM (#38003689)
I think that's the sticking point, declarative toolkits didn't mesh too well with C++(or C) projects so we have a bunch in Rust but that's not too interesting for those with existing codebases, I started on a C++ 20 prototype myself a few years back (because to make it even remotely elegant I felt that I wanted designated initializers from C++20) but it kinda turned into a huge hairball of templates to even approach something like react style jsx/tsx rendering.

I'm pretty sure that something based on IMGui could be more or less isomorphous to React style rendering, it'd be up to someone to implement it though (and it'd probably be worth it since building applications at scale you win back a lot of time by not fiddling with state manually all over the place).

Using Chromium however is explicitly not where we should want to go (it's basically a kitchen sink in itself), but we go there anyhow (me included often) because it's just so much more quick thanks to progress in dev experience in the webdev area.

Re:SumatraPDF Reader by slikrick on Wednesday October 25, 2023 @11:29AM (#38013843)
if by plethora you mean different web implementations, sure. but there has basically been less than a handful cross platform UI toolkits since GTK/QT
Re:SumatraPDF Reader by kjksf on Tuesday October 24, 2023 @06:44AM (#37997143)
(I wrote the post).

That's fair in the sense that I did not look closely at latest Gtk or Qt or WxWidgets.

That being said they certainly did not get lighter.

Last I checked Qt was over 10 MB of libraries). Sumatra is 12 MB and I'm guessing over 8 MB is fonts needed to render PDF documents.

So just Gtk or Qt code would be more than the whole app.

Latest Gtk4 does seem to look nice so maybe calling it ugly was uncalled for.

Re:SumatraPDF Reader by a1o on Tuesday October 24, 2023 @07:07AM (#37997320)
Thanks for caring about file size!
Re:SumatraPDF Reader by signaru on Tuesday October 24, 2023 @08:11AM (#37998004)
The reason I never had to install Adobe Reader for more than a decade now is that Sumatra was/is such a tiny install. Thanks!

Edit: I just checked and Acrobat Reader requires 450/900/380 MB for Win32/Win64/Mac respectively [1]. One might argue that it does more than just read PDFs. But in many cases, reading PDFs is all that I need.

[1] https://helpx.adobe.com/reader/system-requirements.html

Re:SumatraPDF Reader by aidenn0 on Tuesday October 24, 2023 @12:10PM (#38001223)
What about Tk?
Re:SumatraPDF Reader by zerr on Tuesday October 24, 2023 @05:35PM (#38005996)
If you are counting MBs at that order, then wxWidgets would be the best option. It can be statically linked easily. The size overhead is about 2.5-3 MB. It is a thin wrapper on top of native controls, so e.g. you can always get to the underlying HWND on Windows. Even for the Windows only app, I'd still pick it due to the sane API.
Re:SumatraPDF Reader by mvonballmo on Tuesday October 24, 2023 @05:02AM (#37996487)
From the retrospective.

> And yet I do know that you can write complex, relatively bug free code without tests, because I did it.

> I do know that you can write complex, relatively bug free code without anyone looking over your code, because I did it.

> If no one uses your app then who cares if it crashes.

> If many people use your app and it crashes, they’ll tell you and then you’ll fix it.

Those four statements are contradictory. What they're saying is not that you don't need testing or code reviews, but that you can get your users to test for you.

I figure the author probably does test their code (everybody tests, even if that just means running the app), but not rigorously or in a way that you could say gives one the security of regression tests.

No-one worth discussing the issue with claims that it's impossible to write complex code without automated testing. I'm a huge proponent of automated testing, and I wrote a relatively large, cross-platform renderer without a single automated test back in the late 90s/early 00s ... it just took a long time, and I became increasingly terrified of making changes.

Edited for formatting.

Re:SumatraPDF Reader by kjksf on Tuesday October 24, 2023 @06:37AM (#37997082)
(I wrote that blog post).

What I was trying to say is: there's dogma about tests and code reviews.

At Google you would get fired for suggesting skipping code review.

Even at smaller Silicon Valley companies (smaller == less than 10 devs) it's unthinkable to not do code reviews. I haven't worked outside SV so it might be different.

That's the dogma.

My point is that maybe we should apply a bit of common sense on top of that.

I'm not saying Google should stop doing code reviews - the cost (to Google) of google search breaking is so high that you do 100x more than just code reviews.

But maybe those smaller companies don't need to dogmatically review the checkin for a documentation fix.

Re:SumatraPDF Reader by VHRanger on Tuesday October 24, 2023 @08:15AM (#37998044)
The problem with tests is the TDD dogma, which wastes time and makes code harder to change (because even reasonable changes break a bunch of tests).

There's a good rule of testing top level behaviors described in this talk [1]

For code reviews, it's about knowledge handoff. No one disputes you can write great code alone. The problem is that singular geniuses writing functional but unmaintainable code only they understand and then getting hit by a bus or changing jobs is a real issue.

1. https://m.youtube.com/watch?v=EZ05e7EMOLM

Re:SumatraPDF Reader by RNAlfons on Tuesday October 24, 2023 @09:34AM (#37998966)
I work in Health IT here in Germany and for the past 3 years we've been "testing" those "smaller companies" for different parts of our business.

It's a mess. We've been paying them serious money for a product. We've never been warned that their product isn't finished yet or that we're the beta testers for the product they'll sell to other clients. Or that we have to invest our own personal and their time to fix their problems and talk to their useless support.

This has become a pattern and I'm done with it. We are slowly moving back to older and larger companies who actually do their work properly before they roll out products and updates.

Re:SumatraPDF Reader by noAnswer on Tuesday October 24, 2023 @08:47PM (#38007776)
What "older and larger" company do you have in mind? What ever you do, never choose CGM! They wouldn't even be able to spell "test" if their live depended on it! Nothing new ever works, like at all. Everything older needs at least one or two server restarts a day!
Re:SumatraPDF Reader by RNAlfons on Wednesday October 25, 2023 @04:22AM (#38010531)
medavis for example.

I know CGM from medico...their KIS is a nightmare. We have to communicate with it in hospitals. What an ugly monster and somehow no hospital IT is able to admin it properly.

Re:SumatraPDF Reader by cstork12 on Wednesday October 25, 2023 @12:13PM (#38014320)
Wow, didn't expect to see medavis mentioned here on HN. I'm currently writing Data Warehouse software (and more) interfacing with their RIS. However, I don't really know what their testing practices are.

Which of their products are you considering?

Re:SumatraPDF Reader by RNAlfons on Thursday October 26, 2023 @02:39AM (#38022452)
Right now we switched back from DoctoLib to booking4med but we're using all kinds of RIS modules here.

What Data Warehouse software do you write for RIS? Maybe I can use it :D

...and yeah Radiology communities are rare. I'm still looking for one...if I have time.

Re:SumatraPDF Reader by cstork12 on Thursday November 02, 2023 @03:49PM (#38119022)
Interesting! From where I'm sitting DoctoLib seems to win over the market.

The DWH software writes snapshots of db_direct into a temporal DB (implemented in Postgres using multiranges) and then uses dbt to transform the data into usable tables. Right now, I use Power BI for visualisation and reporting.

Re:SumatraPDF Reader by RNAlfons on Tuesday November 07, 2023 @07:16AM (#38175947)
Yes they are since Corona unfortunately.

However it's good for usual Doctors offices. It's terrible for Radiology Planning. Also many institutions just put a link to their homepage or phone number in there. This way they're on DL but don't have to deal with the calendar.

Re:SumatraPDF Reader by wolverine876 on Tuesday October 24, 2023 @11:29AM (#38000527)
> My point is that maybe we should apply a bit of common sense on top of that.

...

> But maybe those smaller companies don't need to dogmatically review the checkin for a documentation fix.

It's not dogma, it's just the necessities of large groups of people working together. A small organization can use common sense, a function that scales up to (20? 50?). 10,000 people can't operate on common sense; they need another function: rules.

Re:SumatraPDF Reader by wg0 on Tuesday October 24, 2023 @10:00AM (#37999294)
Now I'm ready for massive downvotes here but hear me out.

Much of our professional habits are part of the corporate chains which is optimised to deliver and squeeze as much as possible.

Software developed in the wild does not have those corporate obligations and the sole purpose is to enjoy the process, the sheer joy of creating something. Of programming as a creative medium.

You don't get your paintings code reviewed. It's just that artistry. You like it, then you like it, end of the story, you're not playing for the gallery.

Corporate enslavement works differently. It has moved and distributed the part of the factory shift in charge to the dude sitting next to you, cleverly. Many are just complaining to make sure they're considered the quality sensitive cooperate loyals.

You two might like different pigments for the grass and he'll strike down your painting with a red ballpoint if not to his taste.

Happens to all of us and if not, wait for it.

Declaring a single boolean flag in a corporate environment might cost more then an hour to get to a consensus because one I-am-dffierent-I-care-too-much guy has some objection about some ambiguity in the flag name in some far future and has now swayed roughly half the team on his side.

That doesn't exist in open source. Open source is all about anti status quo. It is pure rebillion. It started that way, it is about hippies and naysayers. The very root of the GNU toolchain, Herd etc are probably there.

EDIT: Typos + corporate software development environment.

Re:SumatraPDF Reader by naasking on Tuesday October 24, 2023 @10:24AM (#37999582)
> I became increasingly terrified of making changes.

That's the main value of automated tests.

Re:SumatraPDF Reader by TehShrike on Tuesday October 24, 2023 @11:35AM (#38000625)
I rarely feel like tests make it easier for me to make changes later. Types do give me that feeling pretty reliably, though.
Re:SumatraPDF Reader by naasking on Tuesday October 24, 2023 @12:11PM (#38001239)
Agreed that types are better, but good test suites contain plenty of reminders of corner cases that you probably forgot to consider during your refactor.
Re:SumatraPDF Reader by al_be_back on Tuesday October 24, 2023 @12:12PM (#38001256)
I'm with the author (op) on this, unless it's critical code, launching a buggy project that gets some use & feedback is way better than holding-on for perfection and face certain project failure.

seek forgiveness rather than permission - gets you launched - gets you better