Live data from Hacker News

Ember.js is driving me crazy

softwaresimply.blogspot.com

21–30 of 113 posts

Re: Ember.js is driving me crazy

#21
post #9

> The root of the problem is the system we were operating in: an impure programming language with weak dynamic typing. Is it really fair to blame this on dynamic typing? Having setters with side effects seems like a design decision to me, and not one that is easily supported. I would be interested in hearing an explanation of why this behavior is javascript's fault.

I'm not blaming it definitively on dynamic typing. I'm blaming it on the overall system of incentives that I have observed seem to come up a lot more frequently with impurity and dynamic and/or weak typing.

Re: Ember.js is driving me crazy

#22

Scala dev here who sometimes needs to do some JS (though haven't worked with ember). I feel your pain! Static typing and functional programming certainly make ones life easier once a project becomes bigger. Anyway, for future reference, you may want to learn how to use the JS debugger (both Chrome and Firefox are quite good). You could have set a break/watchpoint on the variable 'foo'. Once it has changed, you can in…

I use the debugger all the time. One problem is that when you're using Ember a lot of the call stack is cluttered with Ember internal calls, which obscures things. But even after I isolated the problem down to that line, the debugger still didn't help me fix the problem.

I seem to remember reading that chrome added the ability to "black box" libraries to remove them from the debugging call stack to help with situations just like this.

Re: Ember.js is driving me crazy

#23
post #7

" but at some point I decided that the widget was no longer needed, so I commented out the widget's markup" SOURCE CONTROL, DO YOU SPEAK IT? In all seriousness, this is a major peeve of mine - the time that you're most confident that code can be deleted is when you're removing the pieces that depend on it. If the deletion really turns out to be wrong, you should be able to restore the code from source control. If you…

The mental effort required to find and pull the old code is far greater than that required to toggle a code comment, or just the line using that code. The author rightly points out bad behavior by Ember: Unused code should not affect program behavior.

True, but I find commented out code really distracting while I read a file. It's really easy to use the comment method to excess and end up with a file full of old trash code.

As far as Ember's issue, we didn't see the actual code. There's almost certainly a misplaced pointer somewhere. The author made of not being a JS regular, my guess: missing `var` somewhere.

Re: Ember.js is driving me crazy

#24
post #2

Convention over configuration achieved with opaque magic can actually harm the dev process more than it helps.

Yeah, it kicks your ass when you're just getting started and helps you move somewhat quicker once you have experience. But I have observed what you point out many times. I'm not sure it's worth it, in the end. You learn how to Google error messages, that's for sure.

Re: Ember.js is driving me crazy

#25
post #7

" but at some point I decided that the widget was no longer needed, so I commented out the widget's markup" SOURCE CONTROL, DO YOU SPEAK IT? In all seriousness, this is a major peeve of mine - the time that you're most confident that code can be deleted is when you're removing the pieces that depend on it. If the deletion really turns out to be wrong, you should be able to restore the code from source control. If you…

I can't even fathom this mindset. Deleting the code and relying on source control removes the issue from top of mind. Also, it will require more work to bring back later. Both of these are very good reasons to temporarily keep commented code around.

> Deleting the code and relying on source control removes the issue from top of mind.

That's the goal. Your top of mind is very limited; use tools like version control to help you conserve it.

> Also, it will require more work to bring back later.

Then you need better version control. You can either grab the reverse diff from the commit removing it and apply that (possibly with conflict resolution against more recent changes), or just grab the original file and copy the block of code out of it.

Re: Ember.js is driving me crazy

#26
post #7

" but at some point I decided that the widget was no longer needed, so I commented out the widget's markup" SOURCE CONTROL, DO YOU SPEAK IT? In all seriousness, this is a major peeve of mine - the time that you're most confident that code can be deleted is when you're removing the pieces that depend on it. If the deletion really turns out to be wrong, you should be able to restore the code from source control. If you…

I agree that keeping commented-out source around is bad, but commented-out source should really not affect program behavior. The typical way of testing the removal of something is to comment it out, see the results, and if you like them you delete it and then commit.

Re: Ember.js is driving me crazy

#27
post #7

" but at some point I decided that the widget was no longer needed, so I commented out the widget's markup" SOURCE CONTROL, DO YOU SPEAK IT? In all seriousness, this is a major peeve of mine - the time that you're most confident that code can be deleted is when you're removing the pieces that depend on it. If the deletion really turns out to be wrong, you should be able to restore the code from source control. If you…

I was expecting an ember vs angular holy war in the comments, not a when-to-comment-out-vs-delete holy war.

Re: Ember.js is driving me crazy

#30
post #7

" but at some point I decided that the widget was no longer needed, so I commented out the widget's markup" SOURCE CONTROL, DO YOU SPEAK IT? In all seriousness, this is a major peeve of mine - the time that you're most confident that code can be deleted is when you're removing the pieces that depend on it. If the deletion really turns out to be wrong, you should be able to restore the code from source control. If you…

While you're not wrong, this doesn't speak at all to the issue that the OP is expressing. While you might think his/her style is messy, it should still be valid. Commented-out code should behave the same way as deleted code.
Post reply on HN