• 0 Posts
  • 20 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle






  • I once developed an electronic program guide for a cable TV company in New Zealand and I’d lose my mind if I had to use timezones. The basic rule of thumb was:

    a) Internally you use UTC religiously. UTC is the same everywhere on Earth, time always goes forward, most languages have classes that represent instants, durations etc. In addition you make damned sure your server time is correct and UTC.

    b) You only deal with timezones when presenting something to a user or taking input from a user

    Prior to that I had worked for a US trading company that set all their servers to EST and was receiving trades through the system which expressed time & date ambiguously. Just had to assume everywhere that EST was the default but it was just dumb programming and I bet to this day every piece of code they develop has time bugs.


  • Rust isn’t really OOP like C#, Java or C++ - it has structs with functions that you could consider an “object” but there is no inheritance. Instead Rust uses traits which are a little bit like interfaces in some languages.

    The way the kernel is using Rust at the moment is to produce safe bindings for modules to be written in Rust, i.e. you can create a module in Rust source which will be correctly loaded up, the code is safe by default and will have access to kernel services via bindings. I expect over time that more of the kernel will become Rust, but the biggest impediment right now is Rust relies on LLVM and LLVM only supports a subset of targets that a kernel could potentially support with another compiler like gcc.



  • arc@lemm.eetoProgrammer Humor@programming.devIs this a Nut?
    link
    fedilink
    arrow-up
    9
    ·
    edit-2
    6 months ago

    The only reason people use JS is because it’s the defacto language of browsers. As a language it’s dogshit filled with all kinds of unpleasant traps.

    Here is a fun one I discovered the other day:

    new Date('2022-10-9').toUTCString() === 'Sat, 08 Oct 2022 23:00:00 GMT'
    new Date('2022-10-09').toUTCString() === 'Sun, 09 Oct 2022 00:00:00 GMT'
    

    So padding a day of the month with a 0 or not changes the result by 1 hour. Every browser does the same so I assume this is a legacy thing. It’s supposed to be padded but any sane language would throw an exception if it was malformed. Not JavaScript.






  • I’ve been in the industry some time but here are some of my most hated software I’ve been forced to use:

    • IBM Clearcase. Absolutely the worst dogshit source control system ever to exist. Complex, fragile, arcane, slow, network intensive. The company had to employ people fulltime on each of its sites whose only job was creating branches and mirroring repos on other sites. The operational & licensing costs of running it must be insane. Some defenders might claim “but it’s so powerful!” or “look how we can create fancy layered views” as if that excuses it for being terrible in the most basic ways. Fixing it must have been intractable because IBM Clearcase eventually produced a faster remote client that talked to a proxy of the view running on a server somewhere. More expense and complexity.

    • IBM/Lotus Notes & Domino. Another complex, arcane, slow, unintuitive, frustrating product by IBM (though owned by HCL now). Originally a content management system with an email / calendar with its own terminology and workflows completely divorced from any other email / calendar system in existence. Various iterations attempted to rework the front end to appear more user friendly but it was illusory - click button or two and you were confronted with dialogs that hadn’t changed in 30 years.

    • Internet Explorer. I’ve worked in company after company that had some really awful in-house expenses system or clock-in/clock-out or some enterprise junk that NEEDED Internet Explorer and no other browser would do because it was so badly written that it couldn’t render properly or it used an ActiveX control.

    • HP/Microfocus ALM. Another over-engineered, arcane, unintuitive piece of enterprise software. This time for tracking bugs, features, testing etc. Complicated and slow, heavily dependent on Internet Explorer and other deprecated Microsoft tech.

    • Trend antivirus. Almost every corporate antivirus is bad but this one has been the bane of my existence. I write code which does stuff like encryption and compression/decompression and this piece of shit would constantly trigger warnings and delete binaries I was trying to build and develop. When it wasn’t interfering with my work, it would just be constantly hogging CPU and slowing down disk activity.

    • Enterprise software in general. This crap is sold like Kirby vacuum cleaners - a pushy salesman convinces a clueless CTO to buy junk that can seemingly do everything and a sign contract for $$$. And then this stuff is there FOREVER. Management will ignore complaints and the obvious shortcomings of the system because its paid for and the sunk cost fallacy kicks in.


  • The problem is, that most languages have no native support other than 32 or 64 bit floats and some representations on the wire don’t either. And most underlying processors don’t have arbitrary precision support either.

    So either you choose speed and sacrifice precision, or you choose precision and sacrifice speed. The architecture might not support arbitrary precision but most languages have a bignum/bigdecimal library that will do it more slowly. It might be necessary to marshal or store those values in databases or over the wire in whatever hacky way necessary (e.g. encapsulating values in a string).


  • We had tens of thousands of lines in our rake files to build a bunch of targets, none of which were even Ruby. I think if I needed to build another complex build system that was a directed acyclic graph I think I’d use Gradle, for a several reasons - we had some Java targets so we save on an additional developer runtime, it would run faster & Gradle is more mainstream and easy to get various plugins & documentation for.


  • It probably wasn’t a big deal when it was a niche project until Twitter imploded. Then all the public instances got overloaded with new users and the limits became obvious.

    A better design is Lemmy which is written in Rust so it has far more scalability. It’s compiled and because it’s tokio / actix based, it can also do a lot more stuff asynchronously so it’s not spawning thousands of threads to cope with concurrent requests.


  • There is a lot of magic in Java. Try Spring Boot for example, and things magically connect together with annotations, or somehow methods get injected onto interface on the fly, or an http interface maps onto a function with parameters because the runtime is doing it. This is most evident when you set a break point in some class and there might be 4 or 5 mystery functions it passed through between it and where you thought it was calling from. Sl4j, Lombok, Hibernate are doing the same kind of thing.


  • I wrote extensively in Ruby but for Rake - using Ruby as a build system. Can’t say I liked the language although it was okay for how we used it. We have 20 sub projects with some very complex build targets and dependency scanning going on and the Rake syntax was okay. Personally I think its biggest shortcoming was the documentation was very poor and stuff like gems felt primitive compared to other package management systems. One thing I liked from the language was blocks could evaluate to a value which I really use a lot in Rust too.

    I think if I were doing an acyclic dependency build system these days I’d use Gradle probably.

    As for Rails I expect failed to catch on because even compared to Python, Ruby is a slow language. And Python isn’t fast by any stretch. Projects that started with Rails hit the performance brick wall and moved to something else.