• 0 Posts
  • 218 Comments
Joined 1 year ago
cake
Cake day: November 14th, 2023

help-circle

  • Excellent write-up. People who complain about Haskell and purely functional languages just don’t understand it, I think. Take me for example. I tried learning Haskell many years ago, and while I learned so many new and incredibly useful concepts from my short adventure, that I use everyday in my career, I just couldn’t wrap my head around the more abstract concepts, like monads e.g. And the feeling I got was that Haskell is a difficult language, but probably it’s the terminology and abstract mathematical concepts which are the real issue for me here. Because the syntax isn’t really that complicated. Especially the way space is used to call functions. I’m really sick of all the parentheses in other languages.

    But, if you understand all about functional programming, for those that do, it seems to really enrich the way they write and maintain code from what I’ve seen. People who dog on it just don’t understand (including me). Of course it’s hard to maintain something you don’t understand. But if you do understand it, it’s easy to maintain. 🤷‍♂️ Seems logical.

    What next, where is the line drawn for what kind of code we can write? Why introduce more useful concepts in programming if we risk losing maintainability because some devs won’t learn the new concepts?

    Life means change. Adapt. Learn new things. Expand the mind. Learn how to do things in a good way, and then do the things in that good way. Why stagnate just because we don’t understand something. Better to learn a new thing to understand the better way, than to dumb it down to a worse state just so we understand it.

    Bah.


  • Victor@lemmy.worldtoProgrammer Humor@programming.devstop
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    5 days ago

    I dabbled in some Haskell a few years ago but quit trying when I got to the hard parts like monads and functors and stuff. All those mathematical concepts were a little too abstract for me.

    But what I did bring with me from the experience changed my way of programming forever. Especially function composition and tacit (point-free) style programming. It makes writing code so much faster and simpler and it’s easier to read and maintain.

    You can utilize some functional programming concepts without being too hardcore with it and get the best of both worlds in the process. 👍




  • Fish syntax is still fairly ugly compared to most programming languages in my opinion.

    subprocess.run(["fd", "-t", "d", "some_query"])
    

    vs

    fd -t d some_query
    

    Which is cleaner? Not to mention if you want to take the output from the command and pipe it into another one.

    It’s not about folks with weird opinions or otherwise, it’s about use cases. 🙂 I don’t think python is any more “natural” than most other imperative languages.

    Fish is probably even more natural, actually, due to it being more high level and the legibility of the script is basically dependent on the naming of the commands and options and variables used within it, rather than something else, just like python. They probably have similarly legible keywords. Fish I imagine has fewer, which is a good thing for legibility. A script does a lot more with a lot less, due to the commands themselves doing so much behind the scenes. There’s a lot more boilerplate to a “proper” programming language than a scripting language.

    But if you want to do something that python is better suited for, like advanced data processing or number crunching, or writing a whole application, then I would say that would be the better choice. It’s not about preference for me when it comes to python vs fish, it’s about the right tool for the job. But if we’re talking about bash vs fish, then I’m picking fish purely by preference. 👍






  • A shell script can be much more agile, potent, and concise, depending on the use case.

    E.g. if you want to make a facade (wrapper) around a program, that’s much cleaner in $SHELL. All you’re doing is checking which keyword/command the user wanted, and then executing the commands associated with what you want to achieve, like maybe displaying a notification and updating a global environment variable or something.

    Executing a bunch of commands and chaining their output together in python is surely much more cumbersome than just typing them out next to each other separated by a pipe character. It’s higher-level. 👍

    If it’s just text in text out though, sure, mostly equivalent, but for me this is rarely the use case for a script.



  • Ever since I switched to Fish Shell, I’ve had no issues remembering anything. Ported my entire catalogue of custom scripts over to fish and everything became much cleaner. More legible, and less code to accomplish the same things. Easier argument parsing, control structures, everything. Much less error prone IMO.

    Highly recommend it. It’s obviously not POSIX or anything, but I find that the cost of installing fish on every machine I own is lower than maintaining POSIX-compliant scripts.

    Enjoy your scripting!



  • I think that is incorrect in my case. Plex did not come preinstalled on my TV – I installed it via the LG app store on the TV itself. Same with Jellyfin. I have both, and they both update when there are updates available. I have the latest versions.

    My TV supports direct play, both in Jellyfin and Plex, so I am streaming 4K HDR with Dolby 7.1 over WiFi 6 without any buffering issues ever. Streaming is not the issue. The navigation lag and startup time for Plex only is the issue.


  • I use the one for WebOS on my LG TV.

    The web client and Android client are lighting fast compared to the TV. Like normal apps loading normal content.

    The TV app on the other hand takes like 20 seconds just to get past the splash screen, and then another maybe 10 seconds to show first content. And navigation is laggy af. Just absolutely brutal.

    Someone once said this is intentional to get you to buy new TVs. I don’t know. Not all apps do this. Jellyfin e.g.


  • Plex is unbelievably slow to start and navigate through my huge library on my TV. Jellyfin flies.

    The search is also much better on Jellyfin on my TV, because I can use the system keyboard which supports voice to text via the remote. Plex on the other hand has no debouncing, so pressing each key just makes a new search and it’s slow as sh—.

    I also had it outperform Plex when Plex couldn’t play an audio language track where Jellyfin could.

    However, it doesn’t seem like Jellyfin is as good at figuring out duplicates/versions of the same media? It shows up as two identical posters of the same thing without any discernible info until you step into the media page of the thing (movie/episode).

    All in all, a very good complement to, if not replacement for, Plex. 8/10. I’m proud of them!




  • Victor@lemmy.worldtoSelfhosted@lemmy.worldIt's hard sometimes
    link
    fedilink
    English
    arrow-up
    13
    ·
    edit-2
    1 month ago

    Reminds me of when I was in University and catching up with some lab work over the summer to get a passing grade. Was doing some 3D programming assignment and I spent I think 5 weeks debugging my stuff.

    Turns out I needed to transpose two adjacent lines of code. No syntax errors, no runtime errors, just graphics pipeline not outputting what I expected. Was a nightmare. And not even satisfying to figure it out.