this post was submitted on 16 Jan 2025
644 points (98.2% liked)

Engineering Memes

1365 readers
302 users here now

About:

Memes about engineering for all disciplines.

Rules:

General Rules:

  1. No hate speech
  2. No harassment, calls to violence
  3. No advertisement

Posts:

  1. Must be a meme/joke/observation/attempt at humour
  2. Must be engineering related (software engineer humour probably better suited for programmer humour communities, though not explicitly banned)

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] tetris11@lemmy.ml 2 points 21 hours ago* (last edited 21 hours ago) (1 children)
function validate(val) 
   try:  
       cast val as numeric
   except:
      print "Oops, not a number"
      cast val as general  ## date or whatever 
end

validate(12.5)     ## returns 12.5
validate("12.5")   ## returns 12.5
validate("12 . 5") ## returns a date maybe

[–] PoolloverNathan@programming.dev 3 points 17 hours ago* (last edited 17 hours ago) (1 children)

Oh my god what cursed Python, Lua, and SQL offshoot is this

[–] tetris11@lemmy.ml 1 points 14 hours ago

It's my own grammar, "Luanatic"