Null Coalescing: Python's 'or' GOTCHA vs PHP's ??

Python's 'or' operator has a TRAP! PHP's ?? is safer! See why 0 and empty string break Python's approach. Mind = BLOWN!

#python #php #pythonvsphp #nullcoalescing #defaultvalues #nullhandling #codecomparison #programmingcomparison #pythongotchas #phptricks #programmingdebate #codingtips #pythonoroperator #phpnullcoalescing #bestpractices

https://www.youtube.com/watch?v=KbMLNBTpsOM

Null Coalescing: Pythons or GOTCHA vs PHPs ?? #pythongotchas

YouTube

Important PSA For @jack !!!

`os.truncate(path, length)` truncates THE FILE, not the path string 😳 (with no warning)

Thank goodness you were in a venv!

😅

#Python #PythonGotcha #PythonGotchas #Oops #OhNo

Friendly reminder, save yourself hours of #debugging by remembering that when you're dealing with Python regular expressions, by default, "." (Dot) does NOT match newline.

#PythonRE #Python #PythonGotchas