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
-
Correct (although I did once implement a pre-emptive task switcher on it, just for fun). The crash disappeared purely because the addition of the logging code moved stuff up in memory to where it was no longer on a page boundary. -
Totally and has been for a while, I was just having too much fun trolling.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
-
Yep. BTDT, though not on a BBC micro.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
-
FTFYOriginally 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
-
If 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?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
As I said above I see you know what you are. And you wonder why we take the mickey out of your problems!!!!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
-
oracle doesn't throw errors for the sake of it. If its throwing an error something will have gone wrong (although it probably has sod all to do with what you are trying to get it to do).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
-
Yes but i'm talking java.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
-
Works for me...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
-
Interesting. However couldn't you get the same problem running Java if you set the memory limit much higher than the physical RAM on the system?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


Comment