Click here to Skip to main content
15,904,926 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Count in Datagridview C# Pin
Duncan Edwards Jones13-Dec-15 9:22
professionalDuncan Edwards Jones13-Dec-15 9:22 
JokeA Story of Our Time PinPopular
Kornfeld Eliyahu Peter12-Dec-15 20:00
professionalKornfeld Eliyahu Peter12-Dec-15 20:00 
GeneralRe: A Story of Our Time Pin
Jim Meadors12-Dec-15 20:07
Jim Meadors12-Dec-15 20:07 
GeneralRe: A Story of Our Time Pin
CPallini13-Dec-15 1:19
mveCPallini13-Dec-15 1:19 
GeneralRe: A Story of Our Time Pin
Amarnath S13-Dec-15 4:31
professionalAmarnath S13-Dec-15 4:31 
GeneralRe: A Story of Our Time Pin
dandy7213-Dec-15 6:23
dandy7213-Dec-15 6:23 
GeneralRe: A Story of Our Time Pin
PIEBALDconsult13-Dec-15 14:22
mvePIEBALDconsult13-Dec-15 14:22 
GeneralOh JavaScript, you silly goose. PinPopular
Jeremy Falcon12-Dec-15 9:56
professionalJeremy Falcon12-Dec-15 9:56 
After years and years of using JavaScript, only now do I find that checking for zero on the denominator when dividing is a complete waste of time since JavaScript handles it gracefully without crashing.
JavaScript
console.log(0 / 0); // returns NaN
console.log(1 / 0); // returns Infinity

// let's get fancy
var divide = (...args) => args.reduce((a, b) => a / b);

console.log(divide(0, 0)); // still returns NaN
console.log(divide(1, 0)); // still returns Infinity

// if I want to save the sucker in a database
var result = divide(42, 0);
saveMeSomehow.result = isNaN(result) || !isFinite(result) ? 0 : result;
These young kids these days just don't know how spoiled they are.

Note: I don't think the syntax highlighting supports ES6 yet, so yay I broke the Internet.
Jeremy Falcon


modified 13-Dec-15 1:20am.

GeneralRe: Oh JavaScript, you silly goose. Pin
CDP180212-Dec-15 10:03
CDP180212-Dec-15 10:03 
GeneralRe: Oh JavaScript, you silly goose. Pin
Jeremy Falcon12-Dec-15 10:05
professionalJeremy Falcon12-Dec-15 10:05 
GeneralRe: Oh JavaScript, you silly goose. Pin
CDP180212-Dec-15 10:23
CDP180212-Dec-15 10:23 
GeneralRe: Oh JavaScript, you silly goose. Pin
Jeremy Falcon12-Dec-15 11:13
professionalJeremy Falcon12-Dec-15 11:13 
GeneralRe: Oh JavaScript, you silly goose. Pin
Mycroft Holmes12-Dec-15 14:35
professionalMycroft Holmes12-Dec-15 14:35 
GeneralRe: Oh JavaScript, you silly goose. Pin
Michael Martin12-Dec-15 15:21
professionalMichael Martin12-Dec-15 15:21 
GeneralRe: Oh JavaScript, you silly goose. Pin
Mycroft Holmes12-Dec-15 15:26
professionalMycroft Holmes12-Dec-15 15:26 
GeneralRe: Oh JavaScript, you silly goose. Pin
Jeremy Falcon12-Dec-15 19:19
professionalJeremy Falcon12-Dec-15 19:19 
GeneralRe: Oh JavaScript, you silly goose. Pin
Jeremy Falcon12-Dec-15 11:19
professionalJeremy Falcon12-Dec-15 11:19 
GeneralRe: Oh JavaScript, you silly goose. Pin
Benito Aramando14-Dec-15 0:35
Benito Aramando14-Dec-15 0:35 
GeneralRe: Oh JavaScript, you silly goose. Pin
CDP180214-Dec-15 1:17
CDP180214-Dec-15 1:17 
GeneralRe: Oh JavaScript, you silly goose. Pin
Benito Aramando14-Dec-15 1:49
Benito Aramando14-Dec-15 1:49 
GeneralRe: Oh JavaScript, you silly goose. Pin
CDP180214-Dec-15 2:10
CDP180214-Dec-15 2:10 
GeneralRe: Oh JavaScript, you silly goose. Pin
Jeremy Falcon14-Dec-15 4:30
professionalJeremy Falcon14-Dec-15 4:30 
GeneralRe: Oh JavaScript, you silly goose. Pin
Benito Aramando14-Dec-15 4:56
Benito Aramando14-Dec-15 4:56 
GeneralRe: Oh JavaScript, you silly goose. Pin
PIEBALDconsult12-Dec-15 13:25
mvePIEBALDconsult12-Dec-15 13:25 
GeneralRe: Oh JavaScript, you silly goose. Pin
Jeremy Falcon12-Dec-15 19:18
professionalJeremy Falcon12-Dec-15 19:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.