1. 25

    I think if you’re considering Gtk or Qt for it’s cross-platformness, you should probably also consider Tcl/Tk. It’s a lot smaller and faster than the others, and if one of them is good enough, Tcl/Tk almost certainly is better.

    And if Tcl/Tk isn’t good enough? You know, sometimes that higher standard of quality is required for consumers, and if it is, you’ll waste so much time trying to get that quality out of a “cross-platform GUI framework” that you might’ve just as well used a “native” framework and written your code twice, because your program will always be bigger than your competitors, and slower than them, and it’ll always feel a little bit off even if you do everything else right.

    For me, I’ve completely written off this kind of “cross-platformness” because that kind of hassle just isn’t worth it.

    1. 10

      I come here to say about Tcl/Tk and FLTK: both are way lighter options.

      1. 10

        Accessibility is a quality that is arguably even more important for business applications than it is for consumers, and Tk doesn’t have it, at all. That should be a deal-killer, unless you’re developing an application for a task that’s inherently visual (e.g. working with graphics).

        1. 2

          Do you know if command line tools are inherently accessible to screen readers, or does something additional have to be done?

          1. 2

            Yes, command-line tools are inherently accessible.

            1. 5

              Although I’ve always had trouble with the ones which add pseudo-gui elements.

          2. 2

            To the person who downvoted my comment as a troll, do you have any suggestions on how I could have written it better? I’m not trolling; I’m genuinely advocating for accessibility (check out my profile). If it came off as too harsh, that’s just because I feel strongly about this subject.

            1. 0

              I’ve also been getting a bunch of frivolous “troll” flags on comments I made in good faith. Perhaps someone is abusing the comment downvoting system? I don’t think you should have to back down from what you said, it was a good point and not harsh at all.

            2. 1

              This is also one of the reasons why Electron is awesome(ish): you get all the web platform accessibility tools and APIs. And there is tons of content about how to make accessible applications with web technologies, which IIRC was not the case with QT/GTK.

              1. 1

                But (and you may have anticipated this point) is a framework really all that accessible if every application written with it is ginormous and requires a whole bunch of CPU and RAM just to get up & running?

            3. 2

              To paraphrase a common refrain in Functional Programming circles, “islands of backend logic in a sea of GUI code”.

              1. 2

                Agreed, particularly when there are good choices for writing your business logic that will run and interoperate more or less cleanly no matter where you are. You technically don’t even have to write (most of) your code “twice”, just the UI bits, which are probably going to be quite different anyway because of the different UI metaphors prevalent on different platforms.

                1. 3

                  going to be quite different anyway because of the different UI metaphors prevalent on different platforms.

                  Count on it!

                  And it’s hard to be fluent in those metaphors when they’re so different from system to system unless you force yourself to use those other systems often enough that you wouldn’t put up with a Qt or Gtk build of your Mac or Windows app anyway.

                2. 0

                  I have been thinking electron/react native as cheap way (in time and money) to get cross platform applications. And as money<->time<->quality dependency chain dictates, you will lose certain amount of fit and finish when you take that approach. Lot of times it is correct call to do (I rather take non-native application than no application at all) but it is always a trade-off which needs to made, not just defaulted to.

                1. 2

                  Not sure whether you need a web or desktop version or both?

                  I literally cannot imagine a scenario in which I would need a web-based IDE. A nice little code editor with syntax highlighting for snippets and such? Sure. But a full IDE? Yet there are quite a few out there (though none have taken off AFAIK). Does anybody actually use one of these web-based IDEs? What for? Why?

                  1. 1

                    Many companies are integrating them into their cloud offering. Most of infrastructure is now yaml in many shops, so that’s all you need. But a built in terminal is important in this case, which both this and Amazon’s acquisition (cloud9) support.

                    Many people are now treating their local machine as cattle and not a pet, which this supports. It gives you local IDE latency without the local Host being able to die resulting in data loss.

                  1. 21

                    See also:

                    The two books I recommend to everyone are

                    • Making Software, which is all about how we empirically research software engineering and some of the things we’ve learned about it.
                    • Engineering a Safer World, about how to use a systems-theory approach to analyzing software safety. The book is available for free under the “Open Access” tab.
                    1. 5

                      SICP might be in the category of “books programmers start to read”. There seem to be a lot of questions on the Internet about which Scheme implementation to use for it; fewer have actually finished reading the book and even fewer seem to have finished a significant number of the exercises. I think that’s okay; you can safely recommend SICP because you enjoyed it yourself without having finished it. That’s less true of the Dragon Book and TAOCP.

                      I’ve read through chapter 4 and have finished the exercises through the end of chapter 2. It’s been more enlightening to take it slowly and let the material sink in, I think.

                      1. 4

                        People recommending that others, particularly beginners, read TAOCP or even Introduction of Algorithms (in a cover-to-cover way) is a pet peeve of mine.

                          1. 1

                            I dunno, TAOCP is quite useful as a reference, I’ve found. You could work through it (and I have tried), but it’s just so dry and many things are not immediately applicable in your daily work. But when you need it for certain techniques, it’s a great place to go back to. I don’t think I would recommend it to a beginner at all, though.

                        1. 5

                          Cool, but the next wave of ad blockers will need a completely novel approach once SSAI (server-side ad insertion) takes off unless we all just collectively reject ad monetized video content.

                          DAI (Google’s SSAI solution) is already in what amounts to a prerelease for larger customers

                          1. 5

                            Could you explain quickly what SSAI is?

                            1. 6

                              Sure! I will limit my explanation to the bounds of HLS (HTTP Live Streaming) since the concept is the same for both HLS & DASH (Dynamic Adaptive Streaming over HTTP) and these are the two most important ABR (Adaptive Bitrate) content types.

                              1. You have a manifest example.m3u8 file that declares a list of where your video fragment files <N>.ts are, this file usually sits somewhere “private”, maybe even encrypted with a key that only the SSAI server knows if the company has enough technical expertise to handle running the infra for it.
                              2. Browser asks for example.m3u8 from some URL that the SSAI server sits in front of, the server fetches the actual manifest (or maybe has a local cached version already available) and looks for special places where the manifest declares an Ad can be inserted, SSAI fetches the Ad (bidding/etc) and inserts the resulting .ts files into the example.m3u8
                              3. SSAI server sends the resulting spliced example.m3u8 back to the client with a few extra .ts files in it, and updated metadata (this is a big thing I’m glossing over) so it doesn’t break metadata in the browser about video duration, etc.

                              Here are some more resources:

                              1. 3

                                Who controls the SSAI server? Would that be Google in this case and the content is made available to them by the company that owns the page where the video will be displayed? So does that mean that in order to host a ad network that uses SSAI you basically have to proxy all traffic for your customers?

                                It seems weird to do the ads on the server since (as I understand it) advertisers don’t trust content providers not to cheat, and that’s why ads are fetched on the client from separate servers (which can then be blocked with relative ease).

                                Maybe I just totally don’t understand what’s happening here.

                                1. 3

                                  Advertisers don’t trust content providers in general not to cheat.

                                  However, Google have been caught ‘cant-believe-its-not-cheating’ multiple times with no impact, and it took years for it (eg putting brands next to KKK vids) to catch up with them on youtube.

                                  I suspect YT could pull it off and tell advertisers that’s the new deal.

                            2. 4

                              I think the next wave, already here, really, are service-specific user agents. Instead of cutting out the advertising, they cut out the content and make a new frame for it.

                              These take many different forms including websites (archive.is, youtube downloader sites), scripts (youtube-dl), binary apps (Frost, AlienBlue, NewPipe).

                              1. 2

                                As @whjms noted, unless they are patching the manifest files on the fly to undo the SSAI (possible, but would lead to another type of whack-a-mole) it doesn’t matter how you are showing the content

                                1. 1

                                  Wouldn’t newpipe still have to display the SSAI ads, since the ads are dynamically inserted into the video?

                                2. 2

                                  It’s already taken off. Quite a few of the youtube videos I watch–maybe as many as 50%–are sponsored by an audiobook company or a learning-video company.

                                  The only solution I can think of to this is a crowd-sourced database of video timestamps to skip between; this is is an impossible-to-complete task which grows ever larger, and it’s open to abuse.

                                  1. 1

                                    There’s a machine learning model that was trained to skip sponsorship sections, too, though, personally I’m not so bothered if they were picked by the creator and the creator is getting paid directly and reasonably well for it.

                                    1. 1

                                      The leading extension that blocks sponsorships relies on user-submitted times, what’s this machine learning driven one you’ve mentioned? Actually pretty curious about this, I’ve been planning to build an ad-blocker for the TV!

                                      1. 1

                                        It was a recurring neural net trained on the automatic video transcriptions: Reddit thread (and very good intro video); repo.

                                  2. 2

                                    My old employer, a big player in the video space, has been doing SSAI for a few years now.

                                    I never worked in that directly, because I find it gross, but I suspect you could detect differences in encoding between the “content” and “ad” segments.

                                    1. 2

                                      That sounds like it would be fun to make. I suspect you’re right, and I would not be surprised if the differences are huge and glaring. On podcasts, which I listen to much more frequently than I watch online video, the differences are often audible. I can detect the ad spots by ear in many cases, just because the artifacts change when they cut over.

                                      1. 2

                                        I bet that you don’t even need to look at the data, per se. My guess is that the primary method for all of this is HLS, where you have a top-level (text) manifest file that lists the different renditions, and each of those URLs points to another manifest that lists the actual video segment URLs. If I were building SSAI without an eye towards adblockers, I would splice the content and the ads at that second manifest level, so the URLs would suddenly switch over from one URL pattern to another. I believe the manifest also includes the timestamps and segment lengths, so you should be able to detect a partial segment just before you switch from content to ad.

                                        It’s possible that they’re instead delivering it all as one MP4 stream, but that seems out of favor these days. Or they could do HLS but have segments that bridge the gap from content to ad, but that might involve re-transcoding, and if it didn’t… well, you might see something interesting with keyframes or something, I suppose? I don’t think they’d bother with that anyhow, since it sounds more complicated.

                                        1. 1

                                          I think most of it is currently based around #EXT-X-DISCONTINUITY declarations

                                    2. 2

                                      Does SSAI get to track you across the web? TBH, I don’t care about ads themselves, especially in video (that last bit may be because I just don’t watch all that much video). What aggravates me is the whole surveillance aspect of most current online advertising. By my read, SSAI should neuter the ability to track you across different sites. I’m set to call that flawless victory, if ad supported content is forced to resort to something that can’t track me.

                                      1. 1

                                        They still build it to involve tracking, with JS and cookies and whatnot that all happens before the video stream is requested. I believe if all of that is blocked, you still get ads, just not “retargeted” ones.

                                    1. 42

                                      I really hope JS will not be mandatory anytime to be able to read wikipedia.

                                      1. 41

                                        Comment copied from HN:

                                        Hi HN – I’m one of the authors of this proposal. I’d like to clarify a few points here:

                                        • Wikipedia is not becoming an SPA
                                        • Wikipedia is not dropping support for non-js users
                                        • This proposal is not about changing our current browser-support matrix[1] (which includes IE11 as a first-class target; Vue.js ecosystem still supports IE 11)
                                        • This proposal is about changing the way we develop enhanced, JS-only features across our projects; many such features exist already, but they are written in jQuery and an in-house framework called OOUI
                                        • These features will continue to be delivered in a progressively-enhanced way on top of the PHP-rendered baseline for the forseeable future. We are interested in how server-side rendering of JS components can integrate with this but we’re still looking into how this might work
                                        • We will continue to prioritize accessibility, internationalization, and performance in everything we ship
                                        1. 6

                                          These features will continue to be delivered in a progressively-enhanced way on top of the PHP-rendered baseline for the forseeable future.

                                          I think that’s a much bigger problem.

                                          The WikiMedia codebase is a Lovecraftian fever dream of 15 years of accumulated technical debt, written in PHP.

                                          It’s like everything is barely held together with bubblegum that’s now starting to decompose; and they are not able to change anything, because all the hacks, bots and workarounds invented to deal with WikiMedia’s limitations would stop working the minute they did that.

                                          Basically: fixing WikiMedia would mean things would get far worse in the short-/mid-term, and no one is willing to pay the price for long-term improvements as the situation deteriorates further and further.

                                          1. 4

                                            The MediaWiki History page is a pretty interesting read. It’s worth reading in full, but the tl;dr is that Wikipedia started as a small experiment with a flat file database, became much more popular than expected, and developers spent a few years fire-fighting to keep up with performance/scaling demands.

                                            This quote probably sums it up quite well:

                                            Despite the improvements from the PHP script and database back-end, the combination of increasing traffic, expensive features and limited hardware continued to cause performance issues on Wikipedia. In 2002, Lee Daniel Crocker rewrote the code again, calling the new software “Phase III”. Because the site was experiencing frequent difficulties, Lee thought there “wasn’t much time to sit down and properly architect and develop a solution”, so he “just reorganized the existing architecture for better performance and hacked all the code”. Profiling features were added to track down slow functions.

                                            In early 2003, developers discussed whether they should properly re-engineer and re-architect the software from scratch, before the fire-fighting became unmanageable, or continue to tweak and improve the existing code base. They chose the latter solution, mostly because most developers were sufficiently happy with the code base, and confident enough that further iterative improvements would be enough to keep up with the growth of the site.

                                            I’m not sure if I would have done better in the same situation to be honest.

                                            1. 5

                                              I’m not sure if I would have done better in the same situation to be honest.

                                              Agreed, as someone who has spent a good chunk of his career rewriting legacy software, the rewrite never goes as smoothly as you think it will. Maybe a rewrite in 2003 would have been great, but it also could have turned out horribly and Wikipedia might have even gone defunct (who knows).

                                              1. 2

                                                mostly because most developers were sufficiently happy with the code base, and confident enough that further iterative improvements would be enough to keep up with the growth of the site

                                                That sounds like the history of PHP.

                                                I’m not sure if I would have done better in the same situation to be honest.

                                                Given the amount of money the foundation has available, I can’t imagine a worse outcome. The state of WIkimedia makes the BER look like a perfectly managed project.

                                                1. 6

                                                  Can you provide some examples ?! You seem to be biased about php code in general and comparing a working wikipedia with BER, which isn’t finished even today nor working.

                                                  1. 2

                                                    Well, they didn’t have a lot of money in 2002/2003 ($80k in 2003-2004), and it would be challenging to rewrite it all with even thousands of existing pages (never mind hundreds of thousands or millions) since you either need to maintain compatibility with the (organically grown) syntax or 100% reliably transform that to something else.

                                                    In hindsight, perhaps the biggest mistake they made was making MediaWiki generic Wiki software, instead of just “the software that powers Wikipedia”. I completely understand why they did that, but it does make certain things a lot harder.

                                                    Either way, I don’t envy the position MediaWiki developers are in, and have been in for the last ~20 years.

                                                2. 4

                                                  Do you know this because you’ve actually hacked on the code or are you guessing? Because this sounds like something anyone could say about any 15 year old code base, while that code base could actually be a reasonable state.

                                                3. 1

                                                  Bit late, but to be clear: this is not my comment; I am not the commenter who wrote this on HN. I simply copied it here, because it answered the question.

                                                4. 6

                                                  hopefully it doesn’t become a progressive web app, with all of those cpu and memory-intensive pages that these ui frameworks create.

                                                  1. 14

                                                    … is there a synonym for ‘progressive web app’ that we can use? I would really like to reserve progressive, in a web context, for progressive enhancement, but I lack an alternative term to use for these offline-tolerant web apps.

                                                    For the unfamiliar: progressive enhancement is when you design the HTML to work on its own, and then enhance it with CSS and Javascript. The effect is that the page still works without JavaScript (necessary for low-end devices), or without JS and CSS (necessary for screen readers and programs).

                                                    1. 5

                                                      the page still works without JavaScript (necessary for low-end devices), or without JS and CSS (necessary for screen readers and programs

                                                      Pretty much all screen readers can deal with CSS and JavaScript, and have for many years. And low-end devices can deal fine with JavaScript as long as it’s reasonable. Actually, a click event to load some data dynamically is less resource intensive than a full page refresh in most cases.

                                                      1. 1

                                                        Thoughtful points, thank you for that.

                                                        You’re right, I think, that Javascript is not always the screen reader / accessibility problem it once was; but AFAIK it’s still capable of overwhelming slow devices, especially the copious gunk in aaaadvertisements, which also triggers lots of requests, which doesn’t help. In that way, surfing the web with JS turned off can still be a huge battery saver for many, even though a few well-designed sites use JS to save the user’s battery. (NB: am not an expert on accessibility, and have no experience of depending on it. Take my opinions with grains of salt.)

                                                        For the screen readers I wasn’t so much thinking that they can’t handle CSS, but more that the (ordering of the) content should alread make sense as it appears in the HTML, without the CSS’s layout.

                                                        Click events to load some data dynamically can indeed be an improvement; but you can have that and progressive enhancement, and indeed most commonly find such unobtrusive Javascript on progressive pages.

                                                        There is also a category of non-progressive pages that do not work with Javascript turned off; and usually that is because they use JS for a lot more than on-click loading of data.

                                                        1. 5

                                                          Sure, excessive or low performing JavaScript is an issue, but that doesn’t mean all JavaScript is. The thing is that building complex-ish web applications that work 100% without JavaScript quickly becomes very cumbersome since you’ll be duplicating a lot of code in the backend; code which usually doesn’t get tested that well as may not even work correct.

                                                          For example the application I’m currently developing worked 100% without JavaScript in the first versions, but eventually let that go as it just became too much effort with very little return. The JS is about 800 lines of fairly straight-forward code, and I think getting an entire application in return for that isn’t too bad actually. The alternative is a desktop application with tens of thousands of lines of code.

                                                      2. 4

                                                        Annnnd it turns out that the ‘progressive’ in PWA stands for ‘progressive enhancement’! (1, 2, 3, search for ‘enhance’). But on the other hand I’m not at all sure how progressive your web app is if it requires at minimum a service worker — that feels like giving developers license to skip the ‘make the essentials work with HTML + forms + a server’ step.

                                                        Anyway, I’m getting upvotes but no suggestions, so: please suggest synonyms!

                                                        • Installable Web App
                                                        • Hybrid Web App
                                                        • Advanced Web App
                                                        • Enhanced Web App
                                                        • Local Web App
                                                        • Near-native Web App
                                                        1. 5

                                                          If your app doesn’t work without JS it’s not a PWA.

                                                          Single Page App is a term I see people use.

                                                          1. 1

                                                            If your app doesn’t work without JS it’s not a PWA.

                                                            Can you point to sources for that claim? (edit: or just say what to use instead of service workers :) )

                                                            All PWAs require at minimum a service worker and a manifest

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

                                                            says otherwise, there are sources pointing at both Mozilla and Google for that quote.

                                                            1. 1

                                                              If you have a Progressive Web Page (in the “progressive enhancement” sense), you can add a service worker (as one more step along the progression) to make it a Progressive Web App. Like any other progressive enhancement, it’s OK for the “app” part to require JS as long as without JS it regresses to an ordinary web page, and not to a pile of useless bytes.

                                                              1. 1

                                                                I’m not sure I follow.

                                                                […] you can add a service worker […]

                                                                Only if my client supports and has JS enabled, which was my argument :)

                                                                I think you’re saying that running an installed PWA (i.e. if service workers was not a requirement of installing it), doesn’t need JS to function? To me, that sounds like a saved HTML page (possibly with static assets), as in “what you get from ctrl+s in a desktop browser”. I don’t think that fulfills either the W or the A in PWA.

                                                                1. 3

                                                                  Imagine a hypothetical to-do list service, implemented as a PWA.

                                                                  If a client has no JS, you can just type to-do items and click Submit to store them on the server, or tick a box and Submit to clear them.

                                                                  If a client has basic JS, you can create and complete items in real-time and those actions will be sent to the server asynchronously in the background, without reloading the page.

                                                                  If a client support service workers and the full nine yards, if you’re offline it also caches the changes locally and automatically syncs them back to the server, and lets you install it to your home screen as an app, etc. etc.

                                                                  If a particular client doesn’t support JS, that particular client won’t be able to install the page as an app and run it offline. But that’s OK: if that client can still use the website, and other, more featureful clients can use it as an app, that makes it a Progressive Web App.

                                                      3. 6

                                                        What else would they (wikimedia) do with more money than they know how to spend?

                                                        1. 9

                                                          I always thought they should put the money into professionals making textbooks. Then, they sell them plus the course materials to colleges (esp community colleges). They start with general education just to make sure the books cost about nothing to students. They’re online for free, too, either immediately or after a time period. Then, they move into subjects like business, comp sci, etc. Gradually, we get a professional version of Wikipedia for both personal learning and career advancement.

                                                          1. 3

                                                            So, something like Wikibooks?

                                                            1. 2

                                                              I looked at them a long time ago. I can’t remember if they’re of the quality that business professionals and colleges would buy to replace existing resources. If they are, it’s a just marketing problem. If not, then it wouldn’t be what I was aiming for.

                                                          2. 3

                                                            Did wikimedia fall into a lot more money recently?

                                                            1. 7

                                                              Wikipedia gets more and more money every year: https://en.wikipedia.org/wiki/User:Guy_Macon/Wikipedia_has_Cancer

                                                            2. 1

                                                              Invest it and stop begging so much.

                                                          3. 5

                                                            This comment seems to indicate they’re serious about having server-side rendering, so it looks like that’s not a concern.

                                                            1. 3

                                                              Vue.js is pretty modular and has support for server-side rendering

                                                              1. 1

                                                                I agree with this, but I also think javascript can be used to improve the user experience. I would love to see a modern Wikipedia and would imagine the legacy site sticking around as well.

                                                                1. 1

                                                                  Core reading and editing functionality should be left alone for now. A good test-case feature would be one that provides an enhancement to functionality that has a more basic, no-JS fallback.

                                                                1. 31

                                                                  I don’t like all this centralization.

                                                                  1. 28

                                                                    All the packages were already centralized, though, and TBH I think Microsoft / Github are likely to be better stewards of the npm system, given all their resources.

                                                                    1. 10

                                                                      This. One can make the argument that there should be a fundamental shift in how we do package management, but that feels like a very different conversation. This is a critical piece of centralized architecture changing hands to an organization that is objectively better equipped to manage it, and that feels like a net win for the ecosystem.

                                                                      That doesn’t mean we can’t still have that conversation about shifting away from that centralized architecture, but I think we can still take this win.

                                                                      1. 6

                                                                        This is a critical piece of centralized architecture changing hands to an organization..

                                                                        ..that has a history of pulling crazy stunts just to make money. Uncomfortable indeed.

                                                                        1. 12

                                                                          Honestly, I was always kind of concerned that NPM, Inc. would do something insane / evil to make money. MS / GitHub don’t actually need to make money on this, that’s the benefit as I see it.

                                                                          1. 5

                                                                            What stunts are you referring to? None really come to mind in the last decade, and the Github acquisition, while admittedly still in or close to the honeymoon phase, has overall seemed to go well. On the open source side of things, Microsoft’s management of TypeScript has been fine, and I haven’t heard too many complaints about how they’ve been doing in terms of maintaining VSCode.

                                                                            1. 1

                                                                              I agree that recently, I assume after Nadella started as CEO, MS has been doing a lot of great work to clean their track record.

                                                                              So perhaps (hopefully!) things have structurally changed since the times they introduced their own version of Java, or since their tricks to retain a monopoly over internet browsing, or indeed originally their repackaging other people’s work just to sell an OS to IBM without primary experience in building it.

                                                                              1. 6

                                                                                Except for testing the waters whether it is time to be evil again.

                                                                          2. 3

                                                                            The tools for decentralized package management already exist, to some extent. Both npm and pip, for example, support directly installing dependencies from sourcecode repos (ie. git). Granted, this means you have to ‘compile’ as part of your install process, which isn’t always feasible, but most of the time that’s fine.

                                                                            1. 3

                                                                              From working with Go, installing dependencies from repos leads to less reliable builds because when a single fetch fails go’s module resolver will abort. We ended up having to wrap lots of build tasks in retries in our tooling to handle network hiccups, and that still didn’t help that a single third party server being down can break everything.

                                                                              The solution seems to be to run a centralized proxy that itself calls out to the repos to insulate your build from this problem. That is what go is doing now, and it seems to work pretty well. That gets you (theoretically) the best of being both distributed and reliable, buts it’s more involved than a centralized system.

                                                                              1. 5

                                                                                We use vendoring with Go. imho that’s the best: you do get decentralized repos, but you don’t need to download anything on dev machines or CI server.

                                                                                1. 2

                                                                                  Another benefit of the Go proxy approach is that it does not require git and hg installation.

                                                                                2. 2

                                                                                  Yep, totally agree! npm already can be run without needing an npm registry at all, but you can also run your own registry if you’d like (or use someone else’s). I was more trying to address calls for things like Entropic that always happen when npm, inc news comes up.

                                                                            2. 6

                                                                              In these trying times it’s important to remember that we need letrec.

                                                                              1. 1

                                                                                The alternative to npm is yarn, which is owned by Facebook. I’m not super comfortable with Github owning NPM, but I also think it will be fine considering you can run your own private repositories.

                                                                                1. 13

                                                                                  yarn is still based on the NPM registry.

                                                                                  1. 7

                                                                                    The alternative to npm is yarn, which is owned by Facebook.

                                                                                    This is refuted in their own Q&A: https://yarnpkg.com/advanced/qa#is-yarn-operated-by-facebook

                                                                                    1. 5

                                                                                      A more relevant alternative is Entropic, which is actually decentralized and integrates with npm as a legacy source and was specifically developed to address the SPOF of an investor-backed startup.

                                                                                      However, development seems to have stalled at the end of last year: https://github.com/entropic-dev/entropic/commits/master

                                                                                      1. 2

                                                                                        Two of the core maintainers made statements this week on twitter that they cannot really work on it for a multitude of reasons.

                                                                                      2. 1

                                                                                        At the end of the day, you’re still using the Node.js ecosystem with all of its problems, one of which is how deeply entrenched npm and its registry are. The solution would be an alternative to Node.js.

                                                                                        If server-side JS is a requirement, then Deno looks interesting.

                                                                                    1. 11

                                                                                      I didn’t count them all, but I estimate there are around 80 vim plugins listed. (!)

                                                                                      Is it just me, or is that a sort of madness? I use vim daily, and I’m sure a great number of these make some things easier. But I feel like if my environment looked anything like that, I would spend more time tweaking my tools than actually getting any work done.

                                                                                      1. 4

                                                                                        While it may seem like a lot of plugins, there are a lot of plugins that are for specific things. I’ve spent a lot of hours tweaking my rc file, but once you get it to a place where you like it, you don’t feel a need to change it anymore. I’m a big proponent to customizing your tools to suit your work habit, rather than working around the tool itself.

                                                                                        One may think that there are a lot of keybindings, but I generally find that I don’t add all of the shortcuts all at once. You slowly build up your config file to suit your needs, and you learn the keybindings as you slowly add plugins. Thus you now have a tool that suits your needs, and you don’t restrict yourself.

                                                                                        1. 3

                                                                                          It’s not just you. 80 plugins seems excessive.

                                                                                          I use the taglist plugins for vim, and otherwise tweaked my .vimrc to handle a handful of keyboard shortcuts (my .vimrc is a little over 100 lines, nothing too crazy). I used an indent guides plugin for a little while but it was inconsistent in its behavior, so I ultimately disabled it.

                                                                                          1. 2

                                                                                            I wouldn’t even be able to remember them all, let alone their key bindings. I use maybe 15 plugins and I still forget what’s available to me.

                                                                                            1. 1

                                                                                              Your estimation was pretty good: 73.

                                                                                              1. 1

                                                                                                I checked and I have 42 enabled at present, with another 15 or so commented out in a “maybe try this one day” way.

                                                                                                80 definitely seems on the high side to me, but I suppose I can imagine getting there. Worth noting that some of these are things like support for specific filetypes, colorschemes, and helpers for other plugins.

                                                                                                1. 1

                                                                                                  I have a lot of vim plugins, not 80, but probably around 30? And I don’t think I’ve touched or tweaked any of them except Syntastic, and of course setting up a few mappings.

                                                                                                1. 6

                                                                                                  I spent the past few days learning leo. I used it for research and writing, not programming. Some thoughts:

                                                                                                  • The documentation is terrible and the APIs are jank.
                                                                                                  • I haven’t yet run into issues with editing external files, but I’m not collaborating with anyone so can’t speak to that.
                                                                                                  • Node cloning is very, very cool, as is clone-find-all. You can organize and group nodes in several distinct ways simultaneously by cloning them under different outlines.
                                                                                                  • The scripting features are badly documented but seem to be where the power is. You can easily use python to walk outline trees and manipulate nodes from inside the Editor. I’ve found a couple good uses for this, but I’m limited in scope by the poor documentation. A cookbook would really help.
                                                                                                  • Potential use cases: partially dynamic files. One-off templates. File metadata.

                                                                                                  IMO plaintext files are the wrong abstraction level for code and it’s nice to see some steps towards other models of code.

                                                                                                  1. 5

                                                                                                    I used Leo a long time ago, back when I was doing a lot of text editor research, and I’ve got to say it seems like a pointless project.

                                                                                                    Outline editors exist as plugins in nearly every popular text editor.

                                                                                                    Secondly, you say plaintext files are wrong abstraction level for code. But code is just glyphs structured in whatever way the language sees fit.

                                                                                                    Really we need something like an AST-based editor - or search and replace? Code is written as text. But we interpret code as an AST. They are orthogonal so it makes sense for both to exist within the same editor to have maximum power :)

                                                                                                    1. 7

                                                                                                      something like an AST-based editor

                                                                                                      Structure editors are one of these perennial ideas that have been done many times and keep getting re-invented. (The page I linked isn’t an especially great summary, but it does have a bunch of links to examples.) I do agree that it seems like an obviously better way to go… as long as your editor can reliably parse your language. (Some proponents even suggest abandoning text entirely and storing source as binary ASTs, but that’s pretty radical… ColorForth comes to mind, but I’m pretty sure I’ve seen others.) The only communities I know of where structure editors are mainstream are Lisp/Scheme/Clojure, with paredit and its copycats. I’d argue the bar is lower for languages with uniform, trivially-parseable syntax.

                                                                                                      Implicit in the argument for structured editing is that “style” (author-customized formatting) adds little or negative value. I’m not sure I buy that for every language, but I do notice that format normalizers (gofmt, Black, etc) seem to be getting popular, so maybe they’ll pave the way for wider adoption of structured editing in other languages. The LSP may make implementations of these ideas more viable across existing editors and IDEs. Ultimately, it’s a cultural change, and probably a slow one, as people tend to get very attached to their editor setups.

                                                                                                      My favorite structured editor (and language) of the moment is Hazel, but it’s not really ready for prime time. I don’t have any use for Leo, myself.

                                                                                                      1. 3

                                                                                                        I totally agree. I’m sure many of us has heard, seen and used them but currently text still wins I guess because of universality.

                                                                                                        Edit: I just realized, that this is a good explanation for why text will be the ruler over everything for a long time, if not forever. LSPs are just enabling better manipulation of the structures we create with text to a larger audience.

                                                                                                        1. 3

                                                                                                          A good IDE, with solid support for the language you’re using, is basically a structure editor already. Code completion, bracket and indentation creation, comma and other punctuation insertion, the examples just go on and on. I don’t think about text when I write code in a language like this, I don’t have to, the IDE fills in all the boring stuff I don’t care about automatically. However, and this is a good thing, at least in my opinion, the fact that the files are just text means I can easily search them with grep, change them with sed, make quick edits with vim or any other editor, and so on. So I get the best of both worlds already as far as I can tell.

                                                                                                          1. 6

                                                                                                            he fact that the files are just text means I can easily search them with grep, change them with sed

                                                                                                            I think this is less because text is particularly good for these things and more that we haven’t developed equivalent tools that would work. I can’t grep for “foo in the body of a method”, because grep (and the text file) have no concept of what a “method” is.

                                                                                                            1. 2

                                                                                                              Yeah, I guess what I was getting at there is that I can always fall back to these extant programs that need to exist anyway for actual text files, but that I primarily interact with code through an IDE that turns the text into, effectively, a structure I can manipulate without worrying much about individual characters. I didn’t mean that grep and sed are somehow intrinsically important.

                                                                                                        2. 5

                                                                                                          Secondly, you say plaintext files are wrong abstraction level for code. But code is just glyphs structured in whatever way the language sees fit.

                                                                                                          The problem with plaintext files are that there’s no good way to distinguish metadata from actual contents. You can use delimiters, but those are also going to be plaintext and now you have to distinguish “delimiter” from “actual contents that looks like the delimiter”. It’s the same problem with escaped strings, where you have to write "a \"quote\" here" instead of "a "quote" here".

                                                                                                          Use case: I have the call chain f -> g -> h -> i and want to optimize g to get g'. The ideal correctness test to be to run the chain with random inputs with both g and g' and see if they give same results. But if all I have is text, I can’t “represent” the two possible codebases without having both simultaneously and giving them separate function names. And then I have to modify f to call each in turn. Whereas with a higher abstraction level, I could give g' as an “alternate implementation” to g and generate both “files” in turn.

                                                                                                          1. 4

                                                                                                            I won’t lie, your use case flew right over my head.

                                                                                                            1. 4

                                                                                                              Here’s another: I have to add a lot of debug information to a file. With flat text, I have to sprinkle if DEBUG_MODE {} everywhere, which is cumbersome and makes it harder to understand what’s going on. With rudimentary structured editing, I still need that code everywhere, but I can choose to hide them in the editor. With advanced structured editing, I’m turning a tree of nodes into a flat text file. So I can put the debug code in debug nodes, so that when the “debug” version of the code is generated it looks like:

                                                                                                              debug1
                                                                                                              prod1
                                                                                                              debug2
                                                                                                              prod2
                                                                                                              debug3
                                                                                                              

                                                                                                              But if I generate the “production” version of the code, the one that’s actually checked into version control, it looks like

                                                                                                              prod1
                                                                                                              prod2
                                                                                                              
                                                                                                      1. 24

                                                                                                        How this looks like to me.

                                                                                                        • C++: Yes! Welcome everywhere. It’s matured and proven!
                                                                                                        • Dart: Yes. Because “people” are using it. But in my OS code? Not a chance. Not in my workplace.
                                                                                                        • Rust: No. Because “people” don’t use it. Oh except in the my OS code. But you? Not a chance.

                                                                                                        Just my humble opinion :P

                                                                                                        I think they gonna provide more support if other languages gets more popular. But at this point, it seems they want to “encourage” people to use Dart but not Rust or Go.

                                                                                                        1. 3

                                                                                                          I had read quite some time ago that the plan was to make Go the “systems” language for Fuchsia and Dart the “application” language. Dart makes a lot of sense since, as a result of Flutter, they’re actually making language decisions with an eye toward programming user interfaces and it is intentionally “Java-esque” to make it easy to learn. C++ I find somewhat surprising, I wonder what happened to Go for low-level code.

                                                                                                        1. 3

                                                                                                          The shift click to expand selection looks nice.

                                                                                                          I really love watching this thing evolve. A really nice console / terminal was the missing link that kept WSL from being a first class Linux development environment, and Windows Terminal is filling that gap REALLY fast.

                                                                                                          I have a funny feeling that there are going to be a LOT of developers who live outside the rarefied bubble of desktop UNIX users whose work-a-day quality of life is going to be markedly improved by this.

                                                                                                          1. 2

                                                                                                            I have a funny feeling that there are going to be a LOT of developers who live outside the rarefied bubble of desktop UNIX users whose work-a-day quality of life is going to be markedly improved by this.

                                                                                                            I work (as a network server developer) in the game industry and this is absolutely transformative for my work. I have to use Windows. A lot of the tooling in the game industry only runs on Windows. I will likely start doing the entirety of my work inside of this terminal. Right now I’m running an XFCE desktop inside of a VirtualBox VM just so that I can run Konsole because the terminal emulators on Windows are all in some way insufficient.

                                                                                                            1. 2

                                                                                                              rarefied bubble of desktop UNIX users

                                                                                                              You mean, like, Mac users? I’m not even sure I know a dev who uses Windows. Not saying they don’t exist, just questioning the hyperbole here :-)

                                                                                                              1. 9

                                                                                                                I’m not even sure I know a dev who uses Windows.

                                                                                                                While I agree that “rarefied bubble” seems hyperbolic, “not even sure I know a dev who uses Windows” seems much more hyperbolic to me.

                                                                                                                Vast armies of “enterprise” developers run Windows all the time. And many who do product work are Windows first.

                                                                                                                To counter your anecdata with some of my own, on a project I worked last year, we were delivering software that ran exclusively on RHEL servers. On days when the whole team met, you’d see a dozen Windows laptops, two or three Macs and two of us running Linux. One of the Linux holdouts was a Red Hat employee, and I was the other, having switched when my 2011 17” MBP died of GPU failure and I couldn’t find anything in Apple’s lineup to replace it.

                                                                                                                Outside that group, I know plenty who run Macs, but the vast majority I’ve worked with use Windows as a daily driver.

                                                                                                                That said, every single Windows user I know who suffered from the trash fire that is the old terminal has already helped themselves in terms of quality of life by installing cmder or something like it. “Markedly improved” is probably overstatement for most, even though it will be much better than the default from before.

                                                                                                                1. 8

                                                                                                                  Hello! Nice to meet you! I am a software engineer and I use Windows.

                                                                                                                  I like coffee and tiling as many windows as Windows lets me. Now you know a dev who uses Windows!

                                                                                                                  1. 3

                                                                                                                    macOS is really popular in USA. But it’s not really the case for Europe. We struggled to find a macOS developer that is able to do system programming so much that we had to hire Linux devs and trained them with knowledge about macOS.

                                                                                                                    1. 3

                                                                                                                      Windows devs are many (I am one also). Just as any popular platform, I imagine developing is popular there too.

                                                                                                                      1. 2

                                                                                                                        You should get out more ;)

                                                                                                                        Seriously, just type “I run Windows” into the Lobsters search box and take a gander at the number of articles this yields.

                                                                                                                        Not just Mac users, but even developers who’ve been on Windows for any number of reasons (It’s what their IT department supports, for example).

                                                                                                                        Sorry about the hyperbole, it’s a core part of my personality and when I’m excited about something it’s very hard to hide, but I shall endeavor to do so in future interactions here.

                                                                                                                        1. 1

                                                                                                                          Hehe, I definitely deserved what I got here, I managed to use hyperbole in a comment calling out hyperbole! :-)

                                                                                                                          1. 1

                                                                                                                            I think your post is actually a really usefu could l window into how many developers think about this situation.

                                                                                                                            We all surround ourselves with communities of like minded people, and as a result it’s very easy to start thinking thata this represents the status quo for all developers, everywhere.

                                                                                                                            Somebody felt so strongly about my comment that they flagged it as spam!

                                                                                                                            I would love it if the greater technology community could take a giant step back and recognize that the bubbles we inhabit can narrow our perception of reality.

                                                                                                                            I think for myself I will stop interacting with Windows related posts on lobsters. I will totally cop to having been over-zealous in my interactions on the previous thread, but I was exceedingly careful in my response this time and yet still got flagged.

                                                                                                                            1. 2

                                                                                                                              I agree that we all have bubbles. Sometimes it’s hard to escape your bubble even if you want to because it has to do with geography or industry. But I do agree that we should do our best to at least be aware that those bubbles exist. Honestly, my original comment was meant to be light-hearted, trading hyperbole for hyperbole. In retrospect, it probably wasn’t a good topic for that kind of thing.

                                                                                                                              1. 2

                                                                                                                                Jokes (and lighthearted comments) often don’t land in text. Can’t add intonation beyond SCREAMING something really. Sometimes just you just have to call it out rather dryly ..

                                                                                                                              2. 2

                                                                                                                                I hear you.. I agree with you. I think it would be bad if you refrained from interacting with Windows posts.

                                                                                                                          2. 2

                                                                                                                            I’m on windows at work. I think hwayne is too. Don’t forget that there is an entire dev community built around the C# and the CLR which until recently was largely focused around windows. Not too mention lots of game devs work in windows.

                                                                                                                        1. 17

                                                                                                                          Primary author here. I am too fresh a lobster to post myself, but randomly stumbled on this post today: thanks! Ask me anything!

                                                                                                                          1. 3

                                                                                                                            Love it, all the work on types has brought me back to Python after a long, tooling-induced, hiatus and I’m having so much fun!

                                                                                                                            1. 1
                                                                                                                              1. Would you be interested in doing a writeup for Let’s Prove Leftpad?
                                                                                                                              2. Have you seen @lorddimwit’s contracts library? Just in case you might find it neat
                                                                                                                              1. 1

                                                                                                                                Let’s Prove Leftpad is super cool! It’s pretty easy to check it in CrossHair like this!

                                                                                                                                Note that CrossHair isn’t a real verification tool, and falls short of the guarantees that such tools provide. Do you think it’s worth a pull request anyway? With the appropriate caveats made clear?

                                                                                                                                Contracts is interesting. It’s also interesting to note that CrossHair has similar challenges with consumable iterators. Early on, I’d looked at the vaguely similar pyContracts library, but ended up latching on to the only thing I could find that had been proposed as a standard (PEP316). Also, because CrossHair works by proxying specific python types, I was a little biased towards a setup that presumes typing annotations. But I’d love to work with folks to come up with a standard that could reasonably support all the tooling options: symbolic execution, concrete (fuzzed) execution, and runtime enforcement.

                                                                                                                            1. 7

                                                                                                                              First of all, SOLID isn’t a design pattern, it’s essentially coding guidelines but for software design instead of source code. I personally never got the impression it was meant to be strictly adhered to 100% of the time.

                                                                                                                              Second, how can anybody disagree with the Liskov substitution principle?!? Inheritance (or “subtyping”) models an “is a” relationship - consequently a subclass can be used in place of a parent class because it is one by definition.

                                                                                                                              1. 5

                                                                                                                                Second, how can anybody disagree with the Liskov substitution principle?!?

                                                                                                                                I’ve always wondered this. To me, the LSP feels more like a law of nature or a mathematical definition than a pattern or principle. If you “violate” it then you just literally aren’t doing what you say you’re doing (creating a subtype).

                                                                                                                                If I claim to have invented a perpetual motion machine, I didn’t violate the laws of thermodynamics, I just didn’t actually invent a perpetual motion machine. I made a machine, and it might even do something useful, but it isn’t what I claimed, so the laws of thermodynamics themselves aren’t even particularly relevant at that point.

                                                                                                                                1. 4

                                                                                                                                  Second, how can anybody disagree with the Liskov substitution principle?!? Inheritance (or “subtyping”) models an “is a” relationship - consequently a subclass can be used in place of a parent class because it is one by definition.

                                                                                                                                  People don’t think about LSP because it’s usually enforced by the language itself. For a case when a language didn’t enforce LSP, check out Eiffel’s CATcall problem. Eiffel has covariant subtyping on argument inputs, which makes its type system unsound.

                                                                                                                                  1. 6

                                                                                                                                    You can still break LSP in C# or Java by overriding a method to make it incompatible with the parent class.

                                                                                                                                  2. 0

                                                                                                                                    Inheritance (or “subtyping”) models an “is a” relationship - consequently a subclass can be used in place of a parent class because it is one by definition.

                                                                                                                                    
                                                                                                                                    #include <iostream>
                                                                                                                                    
                                                                                                                                    int main() {
                                                                                                                                        class Base {
                                                                                                                                            public:
                                                                                                                                                auto g() {
                                                                                                                                                    std::cout << "My class can be instantiated into valid and useable objects\n";
                                                                                                                                                };
                                                                                                                                                auto f() {
                                                                                                                                                    std::cout << "I am part of the public interface of the base class\n";
                                                                                                                                                };
                                                                                                                                        };
                                                                                                                                    
                                                                                                                                        class Child : public Base {
                                                                                                                                            public:
                                                                                                                                                auto g() {
                                                                                                                                                    std::cout << "Mine too\n";
                                                                                                                                                };
                                                                                                                                            private:
                                                                                                                                                auto f() {
                                                                                                                                                    std::cout << "But not of the public interface of the child class\n";
                                                                                                                                                };
                                                                                                                                        };
                                                                                                                                    
                                                                                                                                    	auto b = Base();
                                                                                                                                    	auto c = Child();
                                                                                                                                            b.g();
                                                                                                                                            c.g();
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    

                                                                                                                                    I mean… even with the most pedantic possible definition you can come up with, the above would violate this and yet this is perfectly valid code. So either:

                                                                                                                                    C++ classes&inheritance are incorrect (and Python as well… and probably a lot of other ones, but I don’t really work with OOP code so I wouldn’t know)… or what you’re saying is not true. At least that’s how I’d interpret it… maybe I’m wrong ? If so please correct me, I’ve happily enough not have to work with OOP codebases in 4+ years, so I hardly remember anything about the subject.

                                                                                                                                    And again, this is the most pedantic and minimalistic and pointless definition I’m breaking here.

                                                                                                                                    If you interpret the principle as “Can be substituted” as “The code should work” rather than “Without the compiler throwing an error”… oh golly, I think it’s find to fine a single large OOP codebase in the world that fully respects that.

                                                                                                                                    1. 3

                                                                                                                                      The fact that you can write code violating LSP is the whole reason it exists as a guideline. Inheritance models an “is a” relationship, so that’s what people expect when they see it in code.

                                                                                                                                      1. 0

                                                                                                                                        So if 100% of people expect that, why do OO languages allow you to violate this principle ?

                                                                                                                                        1. 2

                                                                                                                                          why do OO languages allow you to violate this principle ?

                                                                                                                                          I can also give all of my variables, functions, and classes random 8 character names like “jk7sdkj3”, but it’s not a good idea if I want my code to be understandable by the people reading it.

                                                                                                                                          There’s no way for a language to forbid people from writing confusing or “bad” code. It’s up to the programmer to use common sense and try to make their code as readable and as easy to understand as possible.

                                                                                                                                          1. 0

                                                                                                                                            I can also give all of my variables, functions, and classes random 8 character names like “jk7sdkj3”, but it’s not a good idea if I want my code to be understandable by the people reading it.

                                                                                                                                            But it’s intuitive that you shouldn’t give your function bad names, or random names at least, as per your example. LSP is not intuitive.

                                                                                                                                            Otherwise why does LSP need to be state and “Don’t give functions bad names” is not part of solid ?

                                                                                                                                            1. 2

                                                                                                                                              I don’t understand your logic.

                                                                                                                                              On one hand your own article points to the LLVM and Linux kernel coding standards as good examples of what coding standards should be, yet they both include rules about “intuitive” things like variable and function naming, and both have arbitrary restrictions on how the implementation language can be used.

                                                                                                                                              Also in your article, you point to rules like, “Keep ‘Internal’ Headers Private” and “Do not use RTTI or Exceptions”, as good examples of coding guidelines, yet in the comments here, you’ve argued that LSP is a bad guideline because languages allow you to violate it. Doesn’t C++ allow you to violate “Do not use RTTI or Exceptions,” by including those features? Shouldn’t they be bad rules by your logic?

                                                                                                                                              Furthermore, “intuitive” is a subjective matter. It’s unfortunate that LSP isn’t intuitive for you, but it is for many people. One purpose of coding guidelines is to get everybody on the same page regarding issues and conventions that aren’t intuitive for everybody.

                                                                                                                                              As far as why LSP is in SOLID and naming conventions aren’t, you’d have to ask the people who came up with SOLID.

                                                                                                                                              Honestly, it seems like you’re just ranting against SOLID more than anything else.

                                                                                                                                              1. 1

                                                                                                                                                Ok, so it seemed to me like you were making a different claim from the one you seem to be making now, maybe I am mistaken.

                                                                                                                                                Let me try to split those claims and tell me if you are making either one or the other:

                                                                                                                                                Claim 1 – Inheritance (or “subtyping”) models an “is a” relationship - consequently a subclass can be used in place of a parent class because it is one by definition.

                                                                                                                                                Here, to me, you seemed to be claiming that inheritance, as it is implemented in the vast majority of popular language (C++, Java, Python, Javascript) models an “is relationship. Which is what my comment was specifically arguing against. That is to say, this is not the case, inheritance as we have it today in most language is not an “is a” relationship the way LSP understands it.

                                                                                                                                                But if this is not your claim, that is to say, if you are referring to “inheritance” as… idk, an abstract mathematical model under “X” definition, then disregard my previous 2 comments.

                                                                                                                                                At any rate, this has nothing to do with what I’m arguing in the article.

                                                                                                                                                Claim 2 – LSP is good, because inheritance should be treated as an “is a” relationship and if you aren’t you’re doing something really bad

                                                                                                                                                This is what you seem to be saying based on this last comment.

                                                                                                                                                I agree with this claim, broadly speaking, BUT

                                                                                                                                                That doesn’t mean I agree with the LSP. My main gripe with the LSP is not “some interpretation of it can’t be correct” my main gripe with it is “It’s high brow bs that’s not explicit about it’s prescription”.

                                                                                                                                                Namely, LSP can prescribe three things:

                                                                                                                                                a) Children shouldn’t override the parents interface (e.g. what I did above, the most conservative implementation)

                                                                                                                                                b) Parents should be replaceable with children and the code should still be valid in that it compiles.

                                                                                                                                                E.g.

                                                                                                                                                # Car_Controller -> Model_T_Controller
                                                                                                                                                # Car_Controller -> Model_S_Controller
                                                                                                                                                
                                                                                                                                                func make_sure_it_breaks_work(Car_Controller c) ...
                                                                                                                                                
                                                                                                                                                # The bellow code compiles
                                                                                                                                                c1 = Model_T_Controller()
                                                                                                                                                c2 = Model_S_Controller()
                                                                                                                                                make_sure_it_breaks_work(c1)
                                                                                                                                                make_sure_it_breaks_work(c2)
                                                                                                                                                

                                                                                                                                                c) Parents should be replaceable with children and the code should still be valid in that it behaves as expected

                                                                                                                                                E.g:

                                                                                                                                                In the above example, if make_sure_it_breaks_work is used to check a car with a controller of type Model_T_Controller and Model_S_Controller, then it won’t throw an Exception/Error unless is does for a similar object of type Car_Controller (i.e. one that has the same value for all the shared members) nor will it run successfully and result in the cars crashing and burning because the breaks didn’t actually work.

                                                                                                                                                You can argue a and b are the same, in that case just focus on b & c, I don’t think that particular argument is very interesting.

                                                                                                                                                My Issue with LSP is:

                                                                                                                                                1, It’s not clear whether it should be interpreted as c) or as b) or as a) or as something else 2. It’s not clear what it adds compared to the Open Close Principle (since inheriting a class is extending a class) , especially under interpretation a and b 3. It’s poorly worded, in a way that based on my paper reading experience smells of high-brow bs worded that way to seem more authoritative/smart. Namely, if LSP was in one of the guidelines mentioned above, it would be worded in a way more similar to how I worded a),b),c) 4. Since a version of the LSP doesn’t seem to be present in any of those guidelines, it might be that LSP (even if points 1,2 and 3 stand) is redundant and shouldn’t be mentioned to being with (much the same way we aren’t explicit about “name your functions as something that make sense, not just random jibberish”)

                                                                                                                                                …. Hopefully that makes my stance here a bit more explicit, sorry for the previous misunderstandings (if indeed you were arguing about Claim 2 and getting annoyed that I was arguing about Claim 1)

                                                                                                                                                1. 1

                                                                                                                                                  Here, to me, you seemed to be claiming that inheritance, as it is implemented in the vast majority of popular language (C++, Java, Python, Javascript) models an “is relationship. Which is what my comment was specifically arguing against. That is to say, this is not the case, inheritance as we have it today in most language is not an “is a” relationship the way LSP understands it.

                                                                                                                                                  As far as C++, Java, and Python are concerned, public inheritance is definitely intended to model an “is a” relationship. I think it’s also true in Javascript, but it’s weird because Javascript uses prototype classes and that makes things more complicated.

                                                                                                                                                  In any case, Chapter 12 of “The C++ Programming Language” makes it clear in section two, by explaining a simple employee/manager class heirarchy:

                                                                                                                                                  struct Employee {
                                                                                                                                                  string first_name, family_name;
                                                                                                                                                  short department;
                                                                                                                                                  
                                                                                                                                                  string full_name() { return first_name + " " + family_name; }
                                                                                                                                                  virtual string do_work() { return "an employee's work"; }
                                                                                                                                                  };
                                                                                                                                                  
                                                                                                                                                  struct Manager : public Employee {} {
                                                                                                                                                  virtual string do_work() { return "a manager's work"; }
                                                                                                                                                  }
                                                                                                                                                  

                                                                                                                                                  The text explains: “A Manager is (also) an Employee, so a Manager* can be used as an Employee*,” and later, “In general, if a class Derived has a public base class Base, then a Derived* can be assigned to a variable of type Base* without the use of explicit type conversion.”

                                                                                                                                                  It’s not hard to think through the three options and figure out which one it must be.

                                                                                                                                                  a) Children shouldn’t override the parents interface (e.g. what I did above, the most conservative implementation)

                                                                                                                                                  This would make inheritance pointless, so clearly it’s not the right answer.

                                                                                                                                                  b) Parents should be replaceable with children and the code should still be valid in that it compiles.

                                                                                                                                                  This is how how the lanugage works, so this explaination would be redundant.

                                                                                                                                                  c) Parents should be replaceable with children and the code should still be valid in that it behaves as expected

                                                                                                                                                  So this must be the correct answer. The benefit is that it lets users of the class treat all Employees the same where possible (they all have a full_name(), they all do_work(), etc.), and hides the low level details that differ between them (both Employees and Managers work, but they do different work).

                                                                                                                                                  1. 1

                                                                                                                                                    This is how how the lanugage works, so this explaination would be redundant.

                                                                                                                                                    So, again, you claim this is how the language works, in spite of the example above proving that many language, including C++ which is the one in question, don’t work that way. I don’t understand your argument here.

                                                                                                                                                    “The C++ Programming Language”, in spite of what anyone might tell you, is not the ISO standard for C++

                                                                                                                                                    If within the bounds of “ISO/IEC 14882:2017(E) – Programming Language C++” you can find a clear statement that means the code I wrote above is invalid, I will personally send you a video of me eating a hat and you should submit a bug to all major C++ compilers.

                                                                                                                                                    Otherwise, you really seem to be arguing in bad faith here, you are using miss-using phrases such as “this is how the language works” (with a convoluted meaning of : “This is how most people assume code should be written in the this language”) in order to not discuss the central idea. So, again, barring that I think it’s pointless to pursue this discussion further.

                                                                                                                                  1. 2

                                                                                                                                    I didn’t know Vim started on Amiga, that’s neat. Personally, I hate vimacs and use Sublime, VSCode and Idea, but neat still.

                                                                                                                                    1. 4

                                                                                                                                      I literally can’t use a text editor if it doesn’t have a solid Vim extension of some kind. I even struggle to use GUI word processors. Thankfully pretty much every programming editor in existence has Vim emulation :-)

                                                                                                                                      1. 3

                                                                                                                                        But I haven’t found one vim emulation without bugs. All of them get the basics right but even things like undo are sometimes acting very strange.

                                                                                                                                        1. 3

                                                                                                                                          ideavim (with vim-surround, the only vim plugin I personally really really need) for intellij, and evil mode in emacs both work for me. That’s from someone who used to rely on a lot of vim plugins (https://github.com/chelmertz/dotfiles/blob/master/.vimrc) but now enjoy java through an IDE (!) at work.

                                                                                                                                          1. 2

                                                                                                                                            I’ve noticed this too. Some are that real Vim just has so many freakin’ features that nobody has time to implement all of them. Some seem to be fundamental incompatibility with the host editor. In most GUI editors, window splits are top-most elements, and each has their own tab collection, while in Vim, tabs are top-most, and each one can have any number and configuration of window/splits showing any combination of files.

                                                                                                                                            Still, even basic Vim navigation and editing feels so much more productive than GUI editors.

                                                                                                                                            1. 2

                                                                                                                                              I think this depends upon your level of VIm mastery. I’ve been using Vim for years but may not plumb its depths as much as you folks since I use and love both IdeaVim and the VSCode Vim extension and find them to be fabulous for the work I do.

                                                                                                                                          2. 1

                                                                                                                                            I didn’t know Vim started on Amiga, that’s neat.

                                                                                                                                            The Amiga ecosystem created a number of seminal applications that have descendants still being used today.

                                                                                                                                            As a for-instance Lightwave 3D is a direct descendant of Videoscape 3D, the first 3D rendering package I ever used :)

                                                                                                                                          1. 2

                                                                                                                                            It’s a little bit:

                                                                                                                                            • UX model. How do you get a threaded chat app that isn’t very AIM like in Pidgin? Trying to do so within the confines of both libpurple and Pidgin would seem very clumsy to me.

                                                                                                                                            • Cultural shift. Pidgin isn’t as well maintained as it used to be, and so interest waned in Pidgin. This was brought on by things like the dream of federated messaging fading away; but perhaps it doesn’t really explain why the interest in getting things like say, Slack reverse engineered and keeping up with their treadmill has dissipated from back when the community was doing it to AIM/MSNP/etc. (Perhaps Linux users are satisfied with their Electron apps, and see no need to have it in Pidgin, as that’s how they’d previously have an app at all.)

                                                                                                                                            1. 2

                                                                                                                                              Biggest reason being that I want to have all my chats in one place. It reduces the mental load of using another application. Also I hate the resource usage of electron apps.

                                                                                                                                              1. 1

                                                                                                                                                (Perhaps Linux users are satisfied with their Electron apps, and see no need to have it in Pidgin, as that’s how they’d previously have an app at all.)

                                                                                                                                                I think this pretty much sums it up. AOL, MS, etc. didn’t ship Linux clients at all, there weren’t even browser-based clients in most cases. The marginal gain to something like Pidgin was huge because you could go from literally nothing to something that more or less worked. What’s the marginal gain from reverse engineering Slack or Teams? You don’t have to use a browser-based app or a bloated Electron app, but that’s a whole lot less motivating.

                                                                                                                                                1. 1

                                                                                                                                                  (Perhaps Linux users are satisfied with their Electron apps, and see no need to have it in Pidgin, as that’s how they’d previously have an app at all.)

                                                                                                                                                  Yup. I’d prefer a nice, slick app - but I’ve stopped using Pidgin years ago. I never loved it, but it was good enough for ICQ/XMPP - but at some point I switched to Gajim. Also didn’t libpurple have a ton of bugs?

                                                                                                                                                  I think satisfied is the wrong term, but sometimes the “least bad” option is going in a different direction for different people. I also used Slack via IRC bridge for a long time and it was often a pain, to be honest. Not getting updates if people edited messages. No threading…

                                                                                                                                                  1. 1

                                                                                                                                                    Yes the UI model is a problem, its something we’re working on… That said, there is already a slack plugin and it works well enough for many. That said I’m curious on where you’re getting your info..

                                                                                                                                                  1. 1

                                                                                                                                                    Incredibly simple landing page enumerating my web “presence”. I really ought to put links to things that might be of particular interest, especially since I’ve got 100+ GitHub repos and probably 90+ of them are uninteresting / unfinished / junk.

                                                                                                                                                    1. 1

                                                                                                                                                      And the URL is…

                                                                                                                                                      #genuinely-interested

                                                                                                                                                      1. 2

                                                                                                                                                        Ha! Knew I’d forgotten something… https://lesica.com

                                                                                                                                                    1. 3

                                                                                                                                                      Interesting post! I’ve been trying out github actions to build TeX files and commit the compiled pdf before but never got it working. Got stuck even before any token issues because I found the build environment very difficult to work with and slow to debug.

                                                                                                                                                      1. 2
                                                                                                                                                        1. 1

                                                                                                                                                          This looks very similar to Overleaf that I’m currently using. The problem with Overleaf is that exporting a PDF isn’t easily automated. Is Latexbase different?

                                                                                                                                                          1. 1

                                                                                                                                                            I don’t know about automating, I just manually do it

                                                                                                                                                        2. 2

                                                                                                                                                          I have ended up doing almost everything inside of a Docker container and just using their build environment to host the container. This makes debugging a whole lot easier since, if I really want to, I can even drop into a shell inside the container running locally and poke around.

                                                                                                                                                          1. 1

                                                                                                                                                            I tried using docker too (This image I believe) to no avail. Do you have any image recommendation or an example build config on Github?

                                                                                                                                                            Thanks!

                                                                                                                                                            1. 2

                                                                                                                                                              Here’s an example. It’s still a work-in-progress, but basically I create my own images (see the Dockerfile) so I get exactly the packages I need and I can actually make the CI environment look more or less like the development environment. Then I run everything inside a container using the same Makefile targets that I would use during development. This isn’t a silver bullet, by any means, but it seems to work out reasonably well for my use-cases so far.

                                                                                                                                                              https://github.com/TravisWheelerLab/NINJA/tree/avx

                                                                                                                                                        1. 1

                                                                                                                                                          Who is this for? I mean, it seems nifty (see below), but “nifty” seems like too low a bar for Canonical to release this as a product. What are the intended use-cases?

                                                                                                                                                          …generally fiddle about with instances of Linux.

                                                                                                                                                          1. 1

                                                                                                                                                            Guess it’s for testing/learning LXC/LXD.

                                                                                                                                                            https://linuxcontainers.org

                                                                                                                                                          1. 4

                                                                                                                                                            I legitimately don’t understand why a private equity firm would want to do this unless they had some kind of a plan to allow the PIR to make more money than it makes today. Have they stated what they plan to change? If not, how in the world can anyone just trust them blindly?

                                                                                                                                                            1. 3

                                                                                                                                                              I think the idea is that they will jack up the prices.

                                                                                                                                                              1. 2

                                                                                                                                                                There really isn’t any other way to make money off of this is there? I mean, abusing the power to do something stupid will just end up in .org losing the trust and reputation it has and everyone would flee the platform.

                                                                                                                                                                The sketchy thing will be the legal stuff like they point out in point 4:

                                                                                                                                                                What mechanisms does PIR currently have in place to implement measures to protect free speech and other rights of domain holders under its revised contract, and will those mechanisms change in any way with the transfer of ownership and control? In particular, how will PIR handle requests from government actors?

                                                                                                                                                                That’s where we might see the most change as Ethos primary objective will be to earn money. This will trump most, if not all, other considerations in the future.

                                                                                                                                                                1. 3

                                                                                                                                                                  I mean, abusing the power to do something stupid will just end up in .org losing the trust and reputation it has and everyone would flee the platform.

                                                                                                                                                                  I agree that that’s what should happen, but where would people go? I feel like .org has enough historical momentum that there might not be a better alternative, at least for quite some time. But maybe that’s what Ethos is counting on?

                                                                                                                                                            1. 2

                                                                                                                                                              New versions of Python often have new syntax, and that is the case with Python 3.8. However, other tools need to support the new syntax too—autoformatters, linters, and so on. Until they do, you can’t use the new syntax.

                                                                                                                                                              What? Just because a linter doesn’t support it means it’s completely unavailable for use?

                                                                                                                                                              1. 13

                                                                                                                                                                If you run those tools as part of your CI pipeline, then maybe, yeah. Not saying that applies to everyone, but it definitely applies to some.

                                                                                                                                                                1. 6

                                                                                                                                                                  It makes a lot of sense to wait for linter / autoformatter support in a team-based environment. Otherwise, when support is added later, you’ll see huge diffs that either:

                                                                                                                                                                  • Get associated to some automated account and cause you to lose information about the original author.
                                                                                                                                                                  • Get rolled in to someone else’s changes and cause confusion for reviewers.

                                                                                                                                                                  It’s best to wait.

                                                                                                                                                                1. 2

                                                                                                                                                                  Great, then what the hell was all of that bullshit they did to harass Aaron Schwartz about? He was scraping a public website, too.

                                                                                                                                                                  1. 8

                                                                                                                                                                    In what sense is scraping content behind a paywall on JSTOR the same as “scraping a public website?”

                                                                                                                                                                    1. 3

                                                                                                                                                                      I agree that it’s not exactly the same thing, but I do think that it’s close enough to be interesting. IANAL but this is the Internet, so here goes…

                                                                                                                                                                      If you’re on MIT’s network the site is effectively public because they “authenticate” users by their IP address. JSTOR is, essentially, using something approximating a firewall to control access. Some traffic is allowed through unhindered, and some traffic is blocked.

                                                                                                                                                                      But that’s also sort of what Cloudflare (or any firewall) does. In the case of JSTOR the traffic is blocked by default and allowed through only after payment is made. With Cloudflare traffic is allowed through by default and only blocked when whatever heuristics they use have been triggered.

                                                                                                                                                                      So it’s different, but it doesn’t feel different enough, at least to me, to make it obvious that this ruling wouldn’t have applied to Schwartz’s case. If it was (obvious), then the ruling might also not apply to any web site behind Cloudflare (or any web site running a firewall).

                                                                                                                                                                      1. 4

                                                                                                                                                                        Doing any sort of protection, even ineffective, usually legally constitutes a content restriction. See DMCA 1201 for how absurdly loose the definition can be.

                                                                                                                                                                        1. 3

                                                                                                                                                                          Agreed. All I’m saying is that it’s maybe not totally ridiculous to think that the Aaron Schwartz case might have been impacted (to some extent) by this ruling if it had been on the books at the time. At the very least it might have opened up some new, potentially very interesting, lines of argument for his lawyers.

                                                                                                                                                                    2. 5

                                                                                                                                                                      Chronology. The law is in effect until a court rules the law is not in effect.

                                                                                                                                                                      1. 2

                                                                                                                                                                        Dang fourth dimension keeping criminals criminals. And keeping law abiding citizens from becoming retroactive criminals.

                                                                                                                                                                      2. 5

                                                                                                                                                                        I might be wrong but I think Schwartz was scraping the JSTOR using MIT’s subscription. If it’s like how I remember it there are certain blocks of IPs for Universities that were allowed more access as they were tied to a specific institution. Apparently he was also causing something of a DoS issue as he was pulling a great deal of data in a small amount of time. All hearsay but something to consider. JSTOR’s post regarding the incident