Open mhamilt opened 2 years ago
I see what you mean, it could be a matter of preference really. I prefer to have blank space in between blocks of code and /------ only when it's a new / really important piece of code that I need to draw my attention to - like a highlight. Delimiting the functions with /----- is extremely hard on the eye for me and I lose track even get dizzy! haha
I promise, there's a method to the madness, it may look messy, but's it's an organised mess
Delimiting the functions with /----- is extremely hard on the eye for me and I lose track even get dizzy! haha
You should be scanning the right margin / gutter and this will allow quick demarcation between functions. Your eye really only goes to the left or the middle when there is code, in which case you won't be looking at the banners (//----
) you'll be looking at code
Also, it isn't just about banners, but the usage of newlines and indentation to make it easy to see what is a cohesive block and what is a new statement e.g.
angleLabel = UILabel(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: 100, height: 50)))
vs
angleLabel = UILabel(frame: CGRect(origin: CGPoint(x: 0, y: 0),
size: CGSize(width: 100, height: 50)))
and
let jointsToShow : [TwoDBodyJoint] = [.right_hand_joint, .right_shoulder_1_joint,
.left_forearm_joint, .left_hand_joint,
.left_shoulder_1_joint,
.head_joint, .neck_1_joint,
.root, .right_upLeg_joint, .right_leg_joint,
.right_foot_joint, .left_upLeg_joint, .left_leg_joint,
.left_foot_joint]
vs
let jointsToShow : [TwoDBodyJoint] = [
.right_hand_joint,
.right_shoulder_1_joint,
.left_forearm_joint,
.left_hand_joint,
.left_shoulder_1_joint,
.head_joint,
.neck_1_joint,
.root,
.right_upLeg_joint,
.right_leg_joint,
.right_foot_joint,
.left_upLeg_joint,
.left_leg_joint,
.left_foot_joint
]
By reformatting you also implicitly are required to consider the code and what it does. It should give you a better understanding of what you are dealing with.
I promise, there's a method to the madness, it may look messy, but's it's an organised mess
remember, you might not be the only person reading the code.
You are making it way more difficult for yourself to read and to edit code by taking this approach to style.
https://github.com/csabau/BTracking/blob/fd3a19db2b35466ef02608cdaebd96ce9d592262/BodyTracking-Example/BodyTracking-Example/ARSUIView2D.swift#L1-L314
This is a mess.
I'd recommend going through and cleaning out what isn't necessary.
You shouldn't be leaving that much dead space about. It isn't an effective strategy. I fit was, I'd expect to see a lot more progress.
Tell me this looks worse