Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
As @AleCx04 reminded me to not be an insulting bitch few days ago...
What is wrong with you?
I mean it.
Inconsistent code style or as in your case just mixing all code styles together makes no sense at all.
Especially not for something so trivial as identifying a scope and the property / function belonging to it.
I could understand utilizing / mixing two to three styles, e.g.
PascalCase - class
SCREAMING_CASE - Globals / constants
Snake case - everything else
But throwing everything together and adding a form that could be easily identified as Hungarian notation but not having anything to do with Hungarian Notation at all...?
Ouch. Just ouch.
I'd highly recommend you switching to something a linter supports and can do for you automatically...
Especially if you don't want to work solo on all your projects, which I'd recommend also - being shut in in your own world is just sad.
@IntrusionCM okay, I see your point, considering the fact that it may confused other people. I'm not reinventing anything. Those cases already exists.
You know that there are some time where a function is called without parentheses, how will a reader know it's a function and not a variable
Root83441160dAdd those lovely Hungarian notation warts and be happy.
Really though: PascalCase for objects, and SCREAMING_SNAKE_CASE for constants is pretty standard, and all that you really need.
You could prefix local vars with an _, but gets tiring pretty quickly.
NotJeckel149160d@Ohiorenua You could simply NOT omit the parentheses from function calls, so then you wouldn't have to make up an additional convention to identify them.
What you're suggesting is a violation of the rule of least surprise. When someone reads your code, they should be able to expect it will follow standard conventions, ideally of the language at hand, but if not then at least some other standard that is easily understood.
@NotJeckel You're wrong.
Whats lacking here is the understanding of function declaration vs reference.
A function and a reference are not the same.
The reason why this works is that everything - be it method / function / ... is generally an object.
So calling function with parentheses is directly invoking the function, passing the function without parentheses is a reference so that the function can be called whenever it seems appropriate (in the method the reference got passed on).
NotJeckel149160d@IntrusionCM My bad, I thought the poster was talking about calling a function, not declaring or passing one.
But, still, if we're talking about passing a function reference, then there's still no need for extra naming conventions as in that case it's clear that it's a function being passed.
aswiftionato0160dMost frameworks have their own notation. One should not go ahead and decide how to case code elements by what better suits them. It’s important to read about best practices and how to case properly. Today you may be working alone but tomorrow you may be working in a team, today you may be the one creating the code base from scratch tomorrow you may be the one to be included in an ongoing project, so it’s important to use standards. Happy coding!
JannikHv2When you realize that you're googling an error message you've implemented yourself
inf3cti0n955That's exactly how I started, am I a Machine!? ... learning Machine Learning
PieInOblivion5Teacher: "Whats that key thingy?" Class: "You mean the keyboard?" Teacher: "Yes, that one!" I shit you not, s...