☆ Yσɠƚԋσʂ ☆

  • 493 Posts
  • 114 Comments
Joined 5 years ago
cake
Cake day: January 18th, 2020

help-circle




















  • 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"
    



















  • What I’m saying is that most good static typing systems do not practically have such limitations, you’d be very hard pressed to find them and they’d be fairly illogical. Most static typing systems that are used in enterprise do have limitations because they are garbage.

    Of course they do, it’s silly to claim otherwise. Some type systems are certainly more flexible than others, but each one necessarily restricts how you can express yourself. Not to mention the fact that advanced type systems introduce mental overhead of their own. The more flexible the type system is the more complex it is as a result. There was even famously a debugger for Scala type system illustrating just how absurd things can get. I’ve used plenty of typed languages including Haskell, so I understand perfectly well how modern static typing works.

    Meanwhile, I’d argue that Typescript provides incredibly weak guarantees in practice, and the impact of transpiling on the workflow is not insignificant.

    My experience is that immutability plays a far bigger role than static typing. The best pattern for ensuring correctness and maintainability is to break things up into small components that can be reasoned about independently. Any large project can be broken up into smaller parts, and that’s by far the best approach towards ensuring correctness that I’ve seen.

    Again, that’s my experience working with many different languages for over two decades now. I’m not suggesting other people can’t have their own preferences.


OSZAR »