Skip Navigation

Search

  • My attempt of an honest answer to my best knowledge:

    As @TootSweet@lemmy.world mentioned, to make a programming language closer to spoken English language, most likely (hi, Python, I am looking at you too). Which infuriates me immensely: when programming, I do not speak languages, I express data structures and operations on them, stacked one upon another. The last thing I need here is ambiguity, loose structure and information duplication (forgot correct term for the last one) that are typical to natural languages of human communication

  • The Go programming language documentation makes a big deal about how it "reads from left to right." Like, if you were describing the program in English, the elements of the Go program go in the same order as they would in English.

    I say this as someone who likes Go as a language and writes more of it than any other language: I honestly don't entirely follow. One example they give is how you specify a type that's a "slice" (think "list" or "array" or whatever from other languages) of some other type. For instance a "slice of strings" would be written []string. The [] on the left means it's a slice type. And string on the right specifies what it's a slice of.

    But does it really make less sense to say "a string slice"?

    In Go, the type always comes after the variable name. A declaration might look like:

     
        
    var a string
    
      

    Similarly in function declarations:

     
        
    func bob(a string, b int, c float64) []string { ... }
    
      

    Anyway, I guess all that to say I don't mind the Go style, but I don't fully understand the point of it being the way it is, and wouldn't mind if it was the other way around either.

    Edit: Oh, I might add that my brain will never use the term "a slice of bytes" for []byte. That will forever be "a byte slice" to me. I simply have no choice in the matter. Somehow my brain is much more ok with "a slice of strings", though.

  • Oh yeah there is a lot you can implement to really get the most out of your architecture via docker and minimize your build times.

    One is using BuildKit with BuildX and Docker Build Cache.

    BuildX is the one I highly recommend getting familiar with as it’s essentially an extension of BuildKit.

    I’m a solutions architect so I was literally building with these tools 15 minutes ago lol. Send any other questions my way if you have any!

  • @boredsquirrel @SchwertImStein

    I remember mentions that there were methods to host static content on ipfs. But I didn't do it myself. That's not "activity pub" federated but ipfs is also distributed.

    Idk if that would serve your purpose.

  • Prefix the name with what it's for. For example, I've previously got a SoundFontError from opening soundfont file.

    "Error" is already used by std::error::Error. It might not be imported by the code that imports your error type, but I think it's better to give it distinct name.

    The other thing is that you might want to use more than one library. Typical imports at the top of the file might look like this:

     rust
        
    use bingbong::{BingBong, BingBongError, SomethingElse};
    use bogos::binted::crotchidizer::{Crotchidizer, CrotchidizerError};
    
      

    If both libraries named their error enums just "Error", the collision could be worked around, but it's an unnecessary extra step:

     rust
        
    // Not sure how renaming affects compiler hints.
    use bingbong::{BingBong, Error as BingBongError, SomethingElse};
    use bogos::binted::crotchidizer::{Crotchidizer, Error as CrotchidizerError};
    
      

    or if you want to avoid renaming:

     rust
        
    use bingbong::{BingBong, SomethingElse};
    use bogos::binted::crotchidizer::{self, Crotchidizer};
    
    /* ... */
    
        match result {
            Ok(value) => return value,
            Err(bingbong::Error::MissionFailed) => panic!(),
            Err(bingbong::Error::UrMom) => todo!(),
            _ => unreachable!(),
        }
        
        if let Err(crotchidizer::Error::SomethingsWrong) = result2 {
            // ...
        }
        
    
      

    If the screenshot had followed conventions, the message would say something like this:

     
        
    could not convert error type `BingBongError` to `MyAppError`
    
      
  • here's what DeepSeek gave me for the following prompt: write a small bash script to check if a CSV exists and if it does rename to the filename_date.CSV and upload to hdfs, keep it simple

     
        
    #!/bin/bash
    
    # Check if filename argument is provided
    if [ $# -eq 0 ]; then
        echo "Usage: $0 <csv_filename>"
        exit 1
    fi
    
    CSV_FILE="$1"
    
    # Check if file exists
    if [ ! -f "$CSV_FILE" ]; then
        echo "Error: File $CSV_FILE not found!"
        exit 1
    fi
    
    # Generate new filename with date (YYYYMMDD format)
    DATE=$(date +%Y%m%d)
    NEW_FILENAME="${CSV_FILE%.*}_${DATE}.csv"
    
    # Rename the file
    mv "$CSV_FILE" "$NEW_FILENAME"
    
    # Upload to HDFS
    hdfs dfs -put "$NEW_FILENAME" /path/to/hdfs/directory/
    
    echo "Successfully processed: $NEW_FILENAME"
    
      
  • I screwed up and confused yellow with black as @404@lemmy.zip pointed out... Sorry. D:

  • You don't grok vi.

    That's fine and you don't need to. But don't knock it if you haven't even taken time to learn it.

    Yesterday I needed to insert a tab character on every line from 2 to 31,000 something. I made the line selection keystrokes in Cursor - it immediately crashed so hard I had to restart my PC.

    Vim did it in a few milliseconds.

  • POV: You open vim for the first time.

  • Many such cases!

  •  
        
    ~ $ python
    Python 3.12.10 (main, Apr  9 2025, 18:13:11) [Clang 18.0.3 (https://android.googlesource.com/toolchain/llvm-project d8003a456 on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> ❗ = 'nah'
      File "<stdin>", line 1
        ❗ = 'nah'
        ^
    SyntaxError: invalid character '❗' (U+2757)
    >>>
    ~ $ node
    Welcome to Node.js v23.11.1.
    Type ".help" for more information.
    > const 👍 = 'test'
    const 👍 = 'test'
          ^
    
    Uncaught SyntaxError: Invalid or unexpected token
    >
    
      
  • Programmer Humor @lemmy.ml

    UX designers vs users

    Programmer Humor @lemmy.ml

    Only SPAN>s

    Programmer Humor @lemmy.ml

    that ain't legal either

    Programmer Humor @lemmy.ml

    Just a bit of CSS

    Programmer Humor @lemmy.ml

    When the code makes no sense, but it works somehow

    Programmer Humor @lemmy.ml

    We've all been there

    Programmer Humor @lemmy.ml

    Go cloud native they said...

    Programmer Humor @lemmy.ml

    Difference Between Nerd and Geek

    Programmer Humor @lemmy.ml

    CSS Humor

    Programmer Humor @lemmy.ml

    Deploying docker-compose to production

    Programmer Humor @lemmy.ml

    When the Internet gets taken over by GPT

    Programmer Humor @lemmy.ml

    ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

    Programmer Humor @lemmy.ml

    tar -vczfx123 ought to do it

    Programmer Humor @lemmy.ml

    Estimates are hard

    Programmer Humor @lemmy.ml

    Stupid people always say no

    Programmer Humor @lemmy.ml

    Whatever is Clever Public License

    Programmer Humor @lemmy.ml

    I only like pointers, not humans

    Programmer Humor @lemmy.ml

    Working on legacy projects be like

    Programmer Humor @lemmy.ml

    You gotta love these auto translations

    Programmer Humor @lemmy.ml

    OpenStreetMap's Overpass API can be used to find robbable banks