Originally posted by suityou01
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 review - hilarious code snippets
Collapse
X
Collapse
-
-
Originally posted by doodab View PostRight. Try reading the whole thread. I started by complaining about people who return null instead of throwing exceptions.
So, i'm comparing two methods of notifying a caller that a problem was encountered.
A) returning null from a method to indicate an error and requiring the caller to check the result of every invocation
B) throwing an exception when the method cannot complete normally, and having caller use a try catch block
And i'm saying that try catch is more efficient in the situation that the code completes normally and no exception is raised.
There is only no exception in the case that nothing goes wrong when the method is called. Is that clear?
One has to dish it back out once in a while.
Last edited by suityou01; 13 February 2012, 15:44.Knock first as I might be balancing my chakras.Comment
-
Originally posted by doodab View PostAnother common cause of such wibbliness is race conditions in multithreaded code. The overhead of logging, or synchronisation in the logging code, often makes the race condition disappear.
That optimising FORTRAN compiler was fun in its .0 version too. Its saving grace was its ability to generate assembly listings of the code it was churning out so you could see where it was barfing.Behold the warranty -- the bold print giveth and the fine print taketh away.Comment
-
Originally posted by suityou01 View PostTotally and has been for a while, I was desperately hoping that my incompetence would go ignored if I kept banging on about it enough - hey, I've turned it into a career, so why shouldn't it work here!!Comment
-
Originally posted by doodab View PostRight. Try reading the whole thread. I started by complaining about people who return null instead of throwing exceptions.
So, i'm comparing two methods of notifying a caller that a problem was encountered.
A) returning null from a method to indicate an error and requiring the caller to check the result of every invocation
B) throwing an exception when the method cannot complete normally, and having caller use a try catch block
And i'm saying that try catch is more efficient in the situation that the code completes normally and no exception is raised.
There is only no exception in the case that nothing goes wrong when the method is called. Is that clear?Comment
-
Originally posted by suityou01 View PostOdious hypocritical little turd.
HTH
Originally posted by suityou01 View PostTotally and has been for a while, I was just having too much fun trolling.
One has to dish it back out once in a while.merely at clientco for the entertainmentComment
-
Originally posted by TheFaQQer View PostIf you're using Oracle, you can still get an exception thrown even when nothing has gone wrong. Maybe that's the point SY was trying to make?merely at clientco for the entertainmentComment
-
Originally posted by TheFaQQer View PostIf you're using Oracle, you can still get an exception thrown even when nothing has gone wrong. Maybe that's the point SY was trying to make?
As you say, Oracle makes the whole debate moot with it's no_data_found exception anyways...While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'Comment
-
Signal On Syntax
Signal On Novalue
Signal On Halt
Signal On Error
Signal On Failure“Brexit is having a wee in the middle of the room at a house party because nobody is talking to you, and then complaining about the smell.”Comment
-
Originally posted by Sysman View PostNot so sure about that. In an early attempt to do something with Objective-C strings I created a memory leak in a tight processig loop. That brought the machine to its knees - the swapfile hit 3GB on a 640 MB system, and was growing
A reboot was the only way out.Originally posted by MaryPoppinsI'd still not breastfeed a naziOriginally posted by vetranUrine is quite nourishingComment
- 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
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Comment