Originally posted by SpontaneousOrder
View Post
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Code reviews
Collapse
X
Collapse
-
-
Originally posted by minestrone View PostYou changed the classes, created new class signatures and therefore created a new internal API. If you cant see that is a redesign then no wonder the permies are despairing of you.Comment
-
Originally posted by minestrone View PostI very rarely ever write private methods and in fact I would have them banned, I cant see the point of splitting up a large public method into smaller private methods.
Originally posted by minestrone View PostIt does make the readability of the code much worse as you have to use the IDE then to follow the code looking for calls rather than moving down one large method.
I hope to god I never have to work on anything you've been near :PComment
-
Originally posted by SpontaneousOrder View PostThat's like an editor formatting a manuscript into appropriate paragraphs with proper grammar, and calling it a rewrite. It's not a redesign if no logic changes. It's just a tidy up.Comment
-
Originally posted by SpontaneousOrder View PostI hope to god I never have to work on anything you've been near :PComment
-
Originally posted by minestrone View PostMethods should be sized to do a specific task, dogmatically designing your code based on LOC is wrong, as is designing your class for ease of testing. The cleanest code comes from clarity of the interface and the worst thing you can do for that is create methods based on size and methods that make it easier to get your lines of code tested percentage up.Comment
-
Originally posted by minestrone View PostI very rarely ever write private methods and in fact I would have them banned, I cant see the point of splitting up a large public method into smaller private methods. It does make the readability of the code much worse as you have to use the IDE then to follow the code looking for calls rather than moving down one large method.
What about re-using code, perhaps in the same class. Would you have two public methods using the same private method or would you cut and paste and duplicate the code in both public methods?
I'm trying really hard to understand your perspective but this is basic stuff and you seem to have not grasped it at all.Comment
-
Originally posted by woohoo View PostErm not sure that's anything to do with my post. I never said a method had to be a specific size, nor to write code to fit testing. I gave a number of reasons why long methods can be problematic and why there are good reasons to address this.Comment
-
Originally posted by minestrone View PostI very rarely ever write private methods and in fact I would have them banned, I cant see the point of splitting up a large public method into smaller private methods. It does make the readability of the code much worse as you have to use the IDE then to follow the code looking for calls rather than moving down one large method.
tulip, that's even what we did in procedural programming, before OO was invented!Down with racism. Long live miscegenation!Comment
-
If you have one 100 line method any reusable elements should be placed into a reusable public method in an object itself, I rarely If ever have an object call methods on the same object, again I don't have methods call private methods.
If you can do that it is worse taking a 100 line method and splitting it into 10 10 line private methods gives you 110 lines of code and 11 methods, you have taken a clean interface with one method and turned it into a mess of 11 methods, to understand the code takes longer as code should be understood reading the interface not the code. You have leaked what was a less than ideal 100 line method but one that was encapsulated into poor API. Interface should always be king.
Clearly you client has seen what you have done and though the same, else you would not be on here pissing your knickers about getting slated at code review time and looking for some affirmation which you only seem to be getting from the assorted cretins clique of CUK.Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Is it legal to work remotely from Europe via a UK company? Yesterday 22:44
- Autumn Budget 2025 set for Nov 26, ‘putting contractors on watch’ Sep 4 15:13
- November 2025 Companies House ID rules contractors must follow Sep 3 19:12
- When agencies sink with your contractor invoice: a legal guide Sep 2 17:14
- Reeves ‘to raise VAT registration threshold to £100,000’ Sep 1 06:37
- When your agency shuts: a recruiter’s 5 tips if you’re unpaid Aug 29 06:57
- What the 2025 employment status review means for contractors Aug 28 06:39
- Contractors, Autumn Budget 2025 is set to extend the big income tax freeze Aug 27 07:15
- Labour to run employment status consultation ‘before 2026’ Aug 26 05:03
- Contractors, AI is making the CV’s death knell louder Aug 22 22:13
Comment