Is it bad practice to avoid certain 'optional' arguments in a function?

With Luau nonstrict mode, I notice that I will get a warning ‘argument count mismatch’ for using the shorter-hand version of the functions, so even though UDim2.fromOffset would typically require two arguments, X and Y, if I’m not in nonstrict mode I’m able to ditch Y if I don’t need it.

My question is, is it considered bad practice to avoid any optional arguments for cleanliness and to just use the default value, in this case 0? Or is this likely just unexpected behavior with Luau, especially since assert with only one argument was wrongly warning before?

Examples:

local var1 = Vector3.new(X, Y) -- Z missing
local var2 = UDim2.new(XScale, XOffset) -- YScale, YOffset missing
1 Like

Not quite a bad practice, but it seems easier to debug if you wrote the entirety of it. However, it is subjective.

I wouldn’t say it is. I would say so long as you use proper variable naming and keep the code commented and properly indented is definitely more important that not using optional arguments.