Closed goyalyashpal closed 2 years ago
Most style guides do not prescribe a space between a function's name and opening parentheses, I'm afraid, CS50's among them!
do not prescribe a space between a function's name and opening parentheses
for functions other than if
, for
, while
; right?
update: i agree it's better to not have space b/w function name & opening parenthesis. there're some whitespace-sensitive languages like julia which do not allow this kind of space and treat it as syntax error.
syntax: space before "(" not allowed in "println (" at ...
and so, i have just settled on space inside the parenthesis for my own style. so: function( "string", argument2 )
Summary
style50 shouldnt punish the space used between function and the bracket for arguments
Details:
()
helps a lot when there are lots of arguments, or argument immediately has lots of symbolswhile ()
,if ()
,for ()
etc.Further Screenshots:
/!\
spoiler alert/!\
: can contain solution codeEnvironment:
style50 --version
: 2.7.5c9 --version
: 3.1.3534 ( https://ide.cs50.io )duplicate 🔍 : space after function