News for hackers. Stuff that matters.
Re:Use the Gemini API with OpenAI Fallback in TypeScript by ilrwbwrkhv on Sunday April 06, 2025 @05:54PM (#43605283)
Typescript looks so ugly visually. It gives me PHP vibes. I think it's the large words at the first column of the eye line:

export const

function

type

return

etc

This makes scanning through the code really hard because your eye has to jump horizontally.

Re:Use the Gemini API with OpenAI Fallback in TypeScript by triyambakam on Sunday April 06, 2025 @08:14PM (#43606191)
So, like, which programming language do you think is not ugly? J? K?
Re:Use the Gemini API with OpenAI Fallback in TypeScript by sprobertson on Sunday April 06, 2025 @06:42PM (#43605598)
which of those words are large?
Re:Use the Gemini API with OpenAI Fallback in TypeScript by AcquiescentWolf on Sunday April 06, 2025 @08:02PM (#43606124)
Ah yes, such large words like const, function, or return, that only exist in TypeScript and PHP.
Re:Use the Gemini API with OpenAI Fallback in TypeScript by dcre on Sunday April 06, 2025 @10:14PM (#43606902)
Silly comment, but I concede this bit is very ugly — they should have extracted the inner type to an alias and used that twice.

    options: [
        Omit<ChatCompletionParseParams, 'model'> & { model: Model },
        Omit<ChatCompletionParseParams, 'model'> & { model: Model },
      ],
like this

    type Options = Omit<ChatCompletionParseParams, 'model'> & { model: Model }
    
    options: [Options, Options]