Skip to main content

Timeline for Status display module

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
May 1, 2016 at 5:57 history edited Joshua Dawson CC BY-SA 3.0
clarified the statement about eliminating call and replacing it with this. Added an update
May 1, 2016 at 5:55 comment added Joshua Dawson @jdog You're right, 'this' is the object that is returned when a function is called with the new operator. Sorry to be unclear! By using 'this' instead of 'call', I meant to entirely get rid of the testing private function capability. The idea was that wherever you needed to call functions from the object to use 'this' instead, for example: instead of using "call.init()" to use "this.init()". Probably what would be even better than all that is to just call the function directly: "init()"
May 1, 2016 at 5:42 history edited Joshua Dawson CC BY-SA 3.0
added 1361 characters in body
Apr 26, 2016 at 3:16 comment added jdog One more question: Using this instead of call: Isn't this already defined? What information would I lose if I used this instead?
Apr 25, 2016 at 18:13 vote accept jdog
Apr 25, 2016 at 18:13 history bounty ended jdog
Apr 24, 2016 at 2:01 comment added Joshua Dawson @jdog Yeah, particulars of which styling convention is not as important, but it's best to write a project using the same style. Surprisingly, I've found JavaScript libraries to be pretty consistent with style at least with variable naming and bracket placement. If you're looking for js style guides, I'd recommend looking into w3schools.com/js/js_conventions.asp or javascript.crockford.com/code.html. There's also a pretty nifty online js interpreter at jsfiddle.net that has a 'tidy' feature that will standardize code you've written.
Apr 23, 2016 at 8:00 comment added jdog @John Dawson regarding returning a separate object, in my opinion unit testing should not be black box based, but also test private methods. I prefer more test coverage of under-engineered classes than less test cases for well engineered classes. But it may just be because I'm not as experienced with JS as with backend work.
Apr 23, 2016 at 7:59 comment added jdog Thanks for pointing out the style. I'm mainly writing PHP, so there I have PSR-2 to stick to - I find it great to eliminate discussions about which exact style is best. I try to apply it to JavaScript as well, because I know no style guide for it. Any pointers welcome
Apr 22, 2016 at 19:42 comment added Joshua Dawson True, it does not matter to the interpreter. But while it may be an opinion that inconsistently styled code is harder to read, it's a fact that some developers will complain about it.
Apr 22, 2016 at 17:20 comment added THE AMAZING The styling is all opinion based. His style will not affect how ECMAScript is interpreted; However, you make a very strong point about using this instead of call.
Apr 21, 2016 at 8:16 history edited Joshua Dawson CC BY-SA 3.0
added 171 characters in body
Apr 21, 2016 at 8:05 history answered Joshua Dawson CC BY-SA 3.0