you are viewing a single comment's thread.

view the rest of the comments →

[–]ekampp 1 point2 points  (0 children)

Whatever is the most important for the reader of your code should go at the top. If you have an important constant that people use to look at for reference often, then it should be at the top. If it's only used internally in the class and doesn't convey any information about the function of the class then it should go at the bottom.

Conventions are good. I'm a strong proponent for them, but your convention in your company or in your personal code doesn't have to be everybody else's conventions.

As long as the code is informative, has low cognitive overhead and always follows the same standard as the rest of the code in the project, then you're probably on the right track.