Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IWButtons Hotkey property and the &-sign in Captions
#13
(09-20-2019, 09:02 PM)SorenJensen Wrote: Hi Kudzu,

Or do you prefer I say Hi Chad (or chad) after reading your article.

The coding was wrong and as soon as I changed the c to a C in keyCode, the script worked as expected. I can see what camelCasing is, but fail to see the benefit of it. However, being use to a case insensitive programming language, I learned to use something similar from start. Using capital letter for every part of a word with different meaning. Like KeyCode, GetCustomer, PostItem, SaveItemsToFile and so on. I do also distinguish spelling between vars, types and procedure/function names, but mostly in the words I use. Using saying names, even though they do become a bit longer than necessary. All in the interest of understanding when reading the code 3-4-5 year later...

Thanks for the simple, yet completely unnoticed difference in the script. I'm sure it would have taken me a long time to find it.

And thanks for the link to the interesting article, to which I fully agree. A lot of time have been, and will continue to be wasted in development.

Regards
Soren

Camel case is a convention. Like any other convention related to source code it makes it easier to identify things based on how it looks. Functions in JavaScript use camelCase convention. I tend to agree with it and I use it whenever I'm writing code in languages that use it (like JavaScript and C#). I don't use camelCase in Pascal on the other hand. The convention for Pascal is that it should use (surprise!) PascalCase everywhere.
It is much better to write code that looks familiar to any developer than to develop a complete new formatting and style which will look like alien writing to other devs and vice-versa.

In IW not all JS code uses that convention for various reasons but all newer code does use it.
Reply


Messages In This Thread
RE: IWButtons Hotkey property and the &-sign in Captions - by Alexandre Machado - 09-23-2019, 09:37 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)