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

Engineering Memes

1439 readers
1 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
660
Get Dated (lemmy.dbzer0.com)
submitted 1 month ago* (last edited 1 month ago) by HootinNHollerin@lemmy.dbzer0.com to c/engineeringmemes@lemmy.world
 
you are viewing a single comment's thread
view the rest of the comments
[–] tetris11@lemmy.ml 2 points 1 month ago* (last edited 1 month 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 1 month ago* (last edited 1 month ago) (1 children)

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

[–] tetris11@lemmy.ml 1 points 1 month ago

It's my own grammar, "Luanatic"