-1

I've noticed that colleagues of mine use the following comments in Java classes to mark a group of declarations as coherent parts.

I've noticed that these comments are used frequently. Where do they come from? What do they mean? Why do people do this? Is this some sort of trend or does it come from another language that I have never heard of?

// age verification ::

private boolean verifiyAdult(UserAccount a) { ... }
private boolean verifyBornInPast(UserAccount a) { ... }
private boolean verifyNotBornInFuture(UserAccount a) { ... }

// :: age verfication

I can understand why someone would want to mark a large segment as cohesive, but I can't understand what the two colons are for.

sueszli
  • 97
  • 9
  • 1
    Have you asked your colleagues? What is their explanation? – jaco0646 Oct 18 '22 at 13:25
  • @jaco0646 we don't know who exactly was responsible for these – sueszli Oct 18 '22 at 16:06
  • I don't mean to belabor the point, but do you not have a version control system that tracks edits to the code base? A VCS can tell you who wrote these lines and when. – jaco0646 Oct 18 '22 at 16:39
  • This convention is specific to Java, perhaps specific to a tool used by Java programmers, and has nothing to do with OOP. (For that matter, there are many arguments against calling Java an OO language.) Anyway, if you want to understand why your coworkers did something, **ask them**. We aren't mind-readers. – Karl Knechtel Oct 18 '22 at 18:11

1 Answers1

0

Turns out that the reason some Java developers use it, is because it is an IntelliJ idea feature: Java equivalent to #region in C#

sueszli
  • 97
  • 9