1.  

    My first thought is: People still use Rails?

    Of course when I think about it, there is that famous curve where you have a huge uptick in a lot of coverage of a thing, with relatively few users in the grand scheme of things (but it appears like everyone is using it depending on what news bubble you are in). That been quite a few years ago now, so it is probably fair to say that Rails is quite mature at this point.

    The only thing I don’t know: this the mature phase where usage increases slowly, or where usage decreases such that it eventually disappears?

    As an aside, with the link to the Rails Doctrine I find it interesting to note when it talks about “Rails Migration of 2.x to 3” being painful, leaving a lot of people behind, and souring of others - it has a version number inline with python…

    This article should be written for every framework or library :-).

    1. 5

      Notably, this site is written in Rails.

      1.  

        That is interesting actually. I wouldn’t have excepted that.

      2.  

        I’m still finding rails astonishingly productive if your team can handle the (significant!) ops overhead.

        So many little details that work well.

        1.  

          That is probably one of the things that kept me from ever bothering with it TBH. I find stuff like asp.net more straightforward.

          1.  

            It really depends on how much programming work is going to be required. If you’re planning to spend 6 weeks building and 6 years operating a site, rails doesn’t really make sense. If you expect to continually have multiple programmers work on the site, the operational overhead is negligible compared to the productivity advantages.

      1. 2

        Why are they calling the new API Temporal instead of just Time?

        1. 7

          Not breaking widely used scripts. Look for Array.prototype.flatten (aka smooshgate) in your favorite search engine.

          1. 1

            Totally get that, and I understand why they’re not just changing the semantics of Date. But Time isn’t in use, so why not use that?

            1. 2

              With Array.flatten they had broken websites with JS libraries as old as MooTools (iirc), I wouldn’t be surprised if there was a popular libraries that breaks when there’s a built in Time. That all being said, I am just guessing.

              1. 1

                Time appears to be part of it.

          1. 9

            What is your favorite pitfall in Date?

            Well, the usual magic type conversion applies of course :-)

            >>> var d = new Date();
            undefined
            >>> var d2 = new Date();
            undefined
            
            >>> d - d2
            -1737
            
            >>> d + d2
            "Mon Aug 03 2020 03:19:54 GMT+0800 (WITA)Mon Aug 03 2020 03:19:56 GMT+0800 (WITA)"
            

            It’s especially surprising/confusing since - works as expected (you get a difference between the dates) but + acts like string concatenation.

            So want to add 30 minutes to a date? Use new Date(d - -1300000) as d + 1300000 will result in the formatted date with 1300000 appended as a string. You need to re-parse the result in a new Date object as well, as it returns a timestamp rather than a date object; another weird thing IMO.


            By the way, getYear() was the only method included in the original Netscape 2 release. That’s right, in 1995 they released a programming language with y2k issues 🙃 It wasn’t until Netscape 4 in 1997 that this was fixed with the addition of getFullYear(). People complain about Internet Explorer, but let’s not forget what an absolute mess Netscape was as well.

            Perhaps designing a programming language in 10 days wasn’t the best of ideas. Then again, I doubt anyone 25 years ago could foresee what a success it would become; hindsight 20/20 and all that.

            1. 2

              It’s especially surprising/confusing since - works as expected (you get a difference between the dates) but + acts like string concatenation.

              What exactly would you expect from adding two dates together?

              1. 4

                I would expect new Date() + 1300000 to add 30 minutes, and new Date() + new Date() to either throw an error, or be some time in March 2071 (i.e. do: new Date(new Date().getTime() + new Date().getTime())).

                1. 1

                  This is sort of what Julia does, which I like. There are separate types for dates, datetimes, and amounts of time (Days, Hours, Minutes, etc).

                  You can add an amount of time to a date or datetime and get a new date or datetime. You can add amounts of time together sensibly, but you can’t add two dates together directly (that’s a type error). You can subtract them, to get an amount of time.

            1. 4

              Moment.js is a much nicer experience in general when dealing with time and dates, and has many saner defaults and helper functions, although it’s ultimately backed by the native date object so it doesn’t paper over everything perfectly.

              I’ve found https://js-joda.github.io/js-joda/ to be a really robust library for more complex date time stuff, it is especially easier to reason about and manipulate date times with time zone offsets. It’s a port of a java library and the api reflects this and is quite clunky, but it’s also using its own immutable representation instead of the native date.

              1. 8

                I’d recommend going with date-fns instead of Moment.js, for reasons like immutability, tree-shaking and performance.

                1. 2

                  I regretted going with moment.js for an angular app. It is HUGE and isn’t really easy to reduce size. I shouldn’t have to do some fancy build steps to do it.

                1. -1

                  Being it a lot simpler than vim, most people (including myself) use vim.

                  1. 8

                    I like how the commands are listed at the bottom. I always use it on servers.

                    1. 6

                      I disagree with the notion that most people use vim. Even among sysadmins I know, few of them prefer vim.

                      1. 4

                        Being a programmer that works with sysadmins on a daily basis, I can confirm that almost none of them use vim.

                        EDIT: Not that, that’s a problem. I could care less. Just an interesting tidbit.

                        1. 2

                          In your experience what editor is the most used?

                          1. 6

                            notepad.exe

                            :(

                            1. 1

                              Don’t take it the wrong way, but perhaps you need to widen your connections. The vast majority of sysadmins/devops folks I know are vim enthusiasts.

                              1. 1

                                Huh, that’s very different from my experience. I definitely wouldn’t say that the sysadmins that I’ve worked with are vim enthusiasts, but they all use vi since they can trust that it’ll be installed on a system. Many have had familiarity with ed as well.

                                1. 1

                                  I would say a bit under half know how to use vi/vim. Most probably know the very basics (insert mode, :wq), but in general I don’t know many people who use vim as their editor of choice. There’s a couple emacs guys, but the most common editor I see used on Linux servers is Nano. Most of my current and former coworkers are <30, which might have something to do with it.

                            1. 2

                              So has anyone made an “opengl” level api on top of vulkan?

                              1. 3

                                The WebGPU api is a higher level, easier to use layer on top of Vulkan, Metal and DX12. Native WebGPU libraries are available for Linux, MacOS, Windows, Android and iOS, plus the API will also be natively supported by javascript in web browsers, and it will be the standard GPU API for WebAssembly programs executed either inside or outside of a browser. There are two open source library implementations with a C language interface: Dawn, made by Google, written in C++, and wgpu, made by Mozilla, written in Rust. The API is still a work in progress, partially implemented, the design not yet complete. It is hoped to be finished at the end of this year. WebGPU is a portable API (write once, run anywhere), and only supports features that exist in Vulkan, Metal and DX12. It is not as powerful as Vulkan, and there will be a significant lag between bleeding edge features becoming available as Vulkan extensions, and those same features becoming available as WebGPU extensions (if they ever do). However, WebGPU is a more modern API than OpenGL, with a similar philosophy to Vulkan (asynchronous command queues), and with higher performance than OpenGL.

                                1. 2

                                  Yep! GLOVE can be used as an intermediate layer between OpenGL ES and Vulkan.

                                  This also means you can run OpenGL ES applications on macOS like so: OpenGL –> (GLOVE) –> Vulkan –> (MoltenVK) –> Metal

                                1. 1

                                  Seems slightly evil. At least the APL is readable… /s

                                  1. 1

                                    I have had a love/hate relationship with CMake. Its syntax is not the tool I would want, but it is definitely an improvement over autotools for cross platform. Although not exactly the same job.

                                      1. 16

                                        I switched to fastmail years ago after hosting my own email.

                                        1. 2

                                          I know pretty much all of this, but it is also useful to bring up the obvious to remember some of these things too. I cannot even remember when I learned about this - but it definitely wasn’t at the beginning.

                                          1. 3

                                            The conclusion mentions being happy with the performance improvements but the chart suggests they’re more or less the same. Did I miss something?

                                            1. 2

                                              Kinda faster for smaller inputs and overall same speed. When rewriting simulation code that was used for ages in fortran, a language we still rely on for pythons math libs, because it’s “unmatched” (and kinda is), I call that a win.

                                              1. 2

                                                Similar question was asked on reddit thread

                                                Well currently the researchers are using the Fortran version, but plan to use the Rust version for the range of inputs that are faster.

                                                I mean happy is probably putting it strongly, obviously I’d have liked to have achieved more, but any simulations that need to be run at that size can now be done significantly faster.

                                                1. 1

                                                  I thought it looked like a “rounding error”.

                                                1. 2

                                                  As a Canadian I can say without reservation that this is true, eh.

                                                  1. 4

                                                    The devil in me wants to ask what the “one line” means in this context, as they are longer than that.

                                                    But all really cool things I should be using.

                                                    1. 4

                                                      I think it refers to the yellow-highlighted line in each example, that’s doing the work to build that particular type of layout.

                                                    1. 7

                                                      Thank you @adamnemecek for the invite a while back on HN. Lobsters has been a favourite site of mine for years. I love the fact that there’s so many BSD developers here. It’s a nice balance to HN’s linux startup full stack devops focus.

                                                      1. 5

                                                        Its kind of funny that you say that about BSD developers. I showed a friend of mine a recent active thread that was kind of pro default javascript vs. anti default javascript on the web. She said “so that is where all the BSD people went”. :/

                                                        I love this site because it is so clean of politics and generally the more disagreeable trolls aren’t around.

                                                        1. 5

                                                          “so that is where all the BSD people went”

                                                          “Systems programmers are the high priests of a low cult.” - Bob Barton :)

                                                      1. 18

                                                        The expectations of a professional/licensed engineer can be fulfilled whether producing code or writing emails as much as they can by building bridges. I studied electrical engineering (and computer science) but haven’t touched a circuit in 4 years. Currently I’m applying for professional recognition, and of the 16 competencies the body wants to see, there is no requirement for anything physical.

                                                        This body’s definition of what makes an engineer includes:

                                                        • ethical behaviour
                                                        • how you analyse problems
                                                        • how you keep up to date on industry practice
                                                        • how you communicate with peers and stakeholders
                                                        • how you manage risk

                                                        Some lessons I feel can be learnt from software practices: Agility, being able to plan for uncertainty particularly for problems where the solution is not known immediately; Revision management, version control was one of the first things I learnt in software and I’m constantly explaining to traditional engineers why it’s important for any publication.

                                                        Some lessons I feel software practices could learn from traditional engineering: Stakeholder management; problem analysis (surprised how few sketches and produced for software systems compared with even the management systems I work with); communication.

                                                        I’d say anyone working with software - from coder to management - can fulfill the behaviours expected of an engineer; many engineers build their communities without ever touching CAD or concrete.

                                                        1. 4

                                                          Forgive my ignorance but how exactly do they define ethical behaviour?

                                                          I’d argue that someone working on literal bombs is highly likely more of an engineer than I am, yet I find that much much much less ethical than anything I’d ever work on.

                                                          1. 3

                                                            They would define it in a way that doesn’t touch anywhere close to that. I think it is the same way that Christian theology was able to exclude war acts from the “do not kill” thing. Any government recognized organization would be expected to do the same leaps.

                                                            I suspect any safety considerations attached to ethical behavior would be for things not including when the thing drops from the sky. Like not accidently blowing up when being hit lightly by a hammer…

                                                            1. 3

                                                              Search for “{name of institution} code of ethics” to answer this. Some examples:

                                                              And specifically in computering:

                                                              1. 3

                                                                Bombs are not unethical.

                                                                You could use bombs to excavate a mine. You could use bombs to stop a horde of murderers coming to your town.

                                                                If it is ethical to kill in self-defense, then it is ethical to build tools that could be used to kill in self-defense.

                                                                1. 3

                                                                  Maintaining ignorance towards what your employer will use your work for, because hypothetically it could be used for something not-unethical, is not ethical behavior. You can assume that in OP’s question they’d be working for the military industrial complex.

                                                                  The only thing necessary for the triumph of evil is for good men to do nothing. As an engineer, you can make a difference. You’re a scarce resource. Simply choosing to work in a place that does good takes labor away from places that do evil or do “nothing”. And your wage will always be good enough to not have to do “nothing” at a place that does evil.

                                                                  1. 3

                                                                    The idea that it is ethical to kill in self defence is not universal. There are some that argue it is better to die than to kill. Also, though you could use a bomb to excavate a mine, that is not it’s purpose. Bomb is defined in wiktionary as “An explosive device used or intended as a weapon”. If an explosive device is designed and used for excavation it is not a bomb.

                                                                    Sorry to nitpick, I know these points are very niche. I simply want to point out that the statement ‘bombs are not unethical’ is open to debate.

                                                                  2. 2

                                                                    The other response to your comment (leeg) is spot on. For example, the organisation I’m seeking to recognise me has a code of ethics defined by: Demonstrate integrity, Practise competently, Exercise leadership, Promote sustainability. Deeper definitions are available in their code, and these definitions would allow defence workers, infrastructure builders, and software implementers to practice within their ethical framework.

                                                                    Part of such recognition is picking a professional body which is compatible with your personal code of ethics. If you are seeking people who have such recognition, then you could use the recognising body’s code of ethics to evaluate these people.

                                                                    Coincidentally, hours after my previous post I met an engineer who worked with bombs, though his were used to dig tunnels for highways and rail ;)

                                                                  3. 1

                                                                    When I took some EE a decade ago (switched to computer science, didn’t have the will to endure EE), I remember they had some specific reason why “software engineering” wasn’t an engineering discipline. I only wish I could remember what it was. I believe in Canada it wasn’t recognized at the time. The engineers saying this were certainly within the bounds of “physical engineering” - that is to say, their craft built upon real physical things instead of upon an “world”/architecture we as a species defined.

                                                                    I much prefer the list you have. I feel that is the a great direction for the industry.

                                                                    1. 2

                                                                      If you’re interested in further depth on this, Engineers Australia is the organisation I’m referring to. People who undertook accredited study and work with software, whether it be computer games or medical devices, can be recognised as professional engineers based on their behaviours rather than strict preconceived notions (such as typically evidenced by exam).

                                                                  1. 12

                                                                    Note this is a rough draft: I’m working on a more polished version as well as a series of articles. But people seem to like it so far so I figured I’d share the current version.

                                                                    1. 4

                                                                      Interesting video.

                                                                      Though I don’t understand why people want to be engineers so badly. Is it an ego thing?

                                                                      Software development has more similarities with pigs wallowing in their own shit than with any serious engineering discipline from my perspective.

                                                                      No quality standards, no punishment for gross misconduct, no loss of privileges for incompetence.

                                                                      1. 3

                                                                        Software development has more similarities with pigs wallowing in their own shit than with any serious engineering discipline from my perspective.

                                                                        Just to be clear here, you’re saying you disagree with the entire video, right?

                                                                        1. 2

                                                                          Yes.

                                                                        2. 2

                                                                          If the only reason you can think of and think is constructive to discuss here is one you already know no one will endorse then I don’t think you are behaving virtuously.

                                                                          1. 1

                                                                            Oh, I forgot the comment section only exists to voice agreement.

                                                                            1. 5

                                                                              No, it exists for thoughtful discussion, which you aren’t making even a token attempt to provide.

                                                                              1. 2

                                                                                Yes, of course, the charitable, empathetic, imaginative and otherwise totally reasonable and only possible interpretation of my comment is that that is what I am saying.

                                                                                I could also just have repeated the comment you are responding to, because you’re just doing it again.

                                                                            2. 1

                                                                              I share that suspicion. Giving workers a fancy job title seems to be a common way to motivate them (or at least avoid demotivating them).

                                                                              On the other hand, I also think that construction of some software systems should be done in accordance with an engineering discipline. Control software in airplanes and cars for example. People who practice such discipline deserve to be called engineers. Even if they don’t want to be, they should be because it makes them aware of their accountability.

                                                                              If you’re just making a video game, I don’t care how you do it (putting ethical questions about addictive game mechanics aside for a moment).

                                                                              1. 0

                                                                                I don’t want programming to be a regulated engineering field, for the specific reason that I’m worried about regulatory authorities defining “quality standards”, “gross misconduct” and “incompetence” in politically-biased ways in order to use “loss of privileges” as a stick to prevent types of software that they dislike from being written. Imagine if there was a regulatory body that had the power to strip a license from a programmer if they contributed to social media software that didn’t censor speech that body judged to be harmful to marginalized people (an inherently political judgment); or that kept selectively enforcing code quality standards on cryptocurrency software because a lot of the individual members of the regulatory body thought that cryptocurrency was bad for society.

                                                                                1. 13

                                                                                  Just because there are bodies that certify (and de-certify) electronic engineers doesn’t mean that I can’t build circuits in my own time, or even do so professionally. It just means that if Boeing were to hire me, and then a system I built caused an airplane to crash, the people affected would have significantly better grounds to sue Boeing.

                                                                                  Engineering certifications are not nearly as effective an instrument of state power as you suggest here.

                                                                                  1. 2

                                                                                    Isn’t this more about “professional engineers”? The type of person that has a “stamp of approval”.

                                                                                    Anyone can work in an engineering field (with training, schooling) but not many are the final approvers who have a professional liability far beyond mere mortals.

                                                                              1. 2

                                                                                Interesting. I have enjoyed doing some scheme in the past.

                                                                                1. 1

                                                                                  Wow they moved fast! I remember Guido van Rossum talking about PEG making pattern matching possible on a conference just last fall. I thought it’d take years :-)

                                                                                  1. 1

                                                                                    Why is it that the PEG parser enabled pattern matching?

                                                                                    1. 3

                                                                                      I don’t know exactly, but I’m guessing it has something to do with the introduction of match (and case) as new keywords even though they’re still valid identifiers in the language. PEG with its ability to backtrack arbitrarily complex expression makes it possible to recognize match as a keyword only after it parses the rest of the statement, and distinguish it from something an assignment like match[i].attr = "value".

                                                                                      1. 1

                                                                                        Ah, that makes sense. Hence the use of soft keyword. I had never heard that term before.

                                                                                      2. 2

                                                                                        In the link it says “The match statement uses a soft keyword, and it is one of the first major Python features to take advantage of the capabilities of the new PEG parser. This means that third-party parsers which are not ‘PEG-compatible’ will have a hard time with the new syntax.”

                                                                                        But I am still not sure about what this actually means.

                                                                                    1. 20

                                                                                      It boggles the mind that “when you make web sites, make sure they aren’t fundamentally broken” is a fringe, “hot take” kind of a message, but here we are.

                                                                                      1. 2

                                                                                        Another way to look at this is that a web browser comes with javascript enabled. So my website will work. Now you turn off javascript, and it breaks - then you complain.

                                                                                        1. 9

                                                                                          The most effective ad blocker, tracking blocker, and load speed enhancer, is blocking JavaScript.

                                                                                          The web with JavaScript is half broken because of JS abuse, and only enabling it selectively on sites I trust is my best defense. There are things that light use improves, but they’re often not worth the downsides. On top of it, the sites that rely heavily on javascript often don’t implement the accessibility things that they should when they reinvent behavior.

                                                                                          I wish JS prompted for permission the way that notifications, webcam access, and similarly intrusive things did.

                                                                                          1. 8

                                                                                            Is not that all sites should be no-JavaScript sites, but the very basic navigation and basic features should work without the need of JS. People disable JS in order to avoid tracking and ads, not because they want to bother developers. At least that is the way I see it.

                                                                                            1. 7

                                                                                              A lot of time it only stops working without JS is that it reinvents standard UI with a broken surrogate thereof. You (an abstract “you”, not you personally) break the back button, break scroll, make fake buttons. Then the result sucks real hard for people who disable JS and for people who use accessibility tools. But guess what? It sucks for everyone. I can’t search the page content for the interesting post I’ve seen 10 minutes ago. I can’t scroll to it without the JS messing up with that feed. I can’t go back to the previous page of search results. Some people refuse to accept it as the new normal—to few to make a difference for now.

                                                                                              1. 2

                                                                                                In many frameworks there are ways to accommodate this through routing and diligent use of anchors.

                                                                                                If I can use a regular UI element with styling on my site, that will be where I go.

                                                                                              2. 6

                                                                                                That’s inaccurate; some browsers come with it enabled and others don’t.

                                                                                                1. 3

                                                                                                  Perhaps I should clarify: when I say “a web browser comes with javascript enabled” I am referring to browsers whose usage is above a rounding error.

                                                                                                  1. 9

                                                                                                    This is starting to sound exactly like the rhetoric people defended IE6, and then Flash with. ;)

                                                                                                    1. 1

                                                                                                      Don’t worry, the next one will probably be javascript vs webassembly.

                                                                                                    2. 2

                                                                                                      There are only three currently-maintained browsers that support Javascript, and two of the three are controlled by a megacorp with a long history of abusing their users rights. (the third one is arguably as well since that’s where the funding comes from, but that’s more of a grey area)

                                                                                                      A web that can’t be used without Javascript is a web that tells anyone without billion-dollar-deep pockets that they aren’t welcome.

                                                                                                      1. 1

                                                                                                        I think there are technically four. I am not sure exactly which ones you are counting, but Microsoft’s Edge does have some differences from Chrome, and Apple has Safari.

                                                                                                        I am not going to say that this is the ideal situation, but it is the situation we have. The effort to make a browser is not what it once was. I assume you are referring to the making a browser in the last bit. I think it does actually get worst because of the DRM on codecs.

                                                                                                        I checked with a friend who is in network support and IT. He often browses with Javascript disabled as well.

                                                                                                        I think the fundamental problem is that inclusiveness is expensive. The products I make at work are apps that just won’t work without javascript. That isn’t to say it couldn’t be made without javascript, but it would work like an application from 2000 and wouldn’t be particularly attractive to our customers.

                                                                                                        My own sites, it isn’t about money but more about time. Most of what I plan on doing on my site are apps or very interactive pages, but there is a front end section that is more descriptive. Is there was any part that should work without javascript it is likely that. My preference would be for a framework to be able to generate those sections for me, so I can get the advantages of it without adding extra time to the effort.

                                                                                                        This whole thread has gotten me thinking about the alternative to Javascript. It is like the tricks that people used to do for menus in javascript that eventually people figured out how to do in CSS. A real solution to the issue could be a declarative system that allows for advanced UI yet not arbitrary code. It might rely more on the backend for certain processing, but you could be sure that the front end couldn’t run arbitrary code.

                                                                                                  2. 3

                                                                                                    Web browsers shouldn’t come with JavaScript enabled. Just as with Flash back in the day, it should be disabled and the user should have to enable it specifically for a site.

                                                                                                    JavaScript is inimical to everything the Web stands for. It has destroyed the web of linked documents and replaced them with walled garden, unlinkable SPAs. It requires readers to run a heavyweight graphical browser when the lightweight lynx or eww. They have led to a world of dynamic applications performing the job of static pages, breaking caching.

                                                                                                    There is absolutely no reason to grant every website execute permission when all it needs is to display text and images.

                                                                                                    1. 2

                                                                                                      Browsers come with a lot of stuff enabled, does your site then have to use all those bells and whistles?

                                                                                                      1. 2

                                                                                                        Interesting way to put it but seems specious, I wouldn’t exactly group javascript with “all the bells and whistles” it is a very basic feature on the modern web.