1

Sometimes I notice answers that would put heavy load on a server or are not at all best practise.

For example:

Object saves / loads in for loops.

Loading JQuery in Magento because it is "easier".

Nested ifs and loops.

Using rewrites when an observer is easily useable.

Because i do not know how to respond to it I have left a comment last time. My question is should we flag stuff like this to watch over the quality of the answers?

3
  • I didn't get the memo that using jQuery was bad practice.
    – pspahn
    Commented Aug 8, 2014 at 11:46
  • @psphan using jquery is not bad practice but implementing it for 1 or 2 features that prototype can handle is. Why would you add a library to an environment when the build in library can do the same in basicly the same way? + You could have compatibility issues when there are several extensions using a different jQuery version, this is why I usually advice people to avoid the use of it in Magento. Commented Aug 8, 2014 at 14:40
  • I guess that makes sense from some certain points of view, though not in any case I have experienced. The benefits greatly outweigh these drawbacks. I would rather add a library and use existing tools than rewrite those tools for a different library and have to maintain two codebases. I get what you mean, though.
    – pspahn
    Commented Aug 10, 2014 at 9:11

2 Answers 2

3

Not flag. Downvote and explain the problem in comment.

2
  • Thing is, these answers are also accepted from time to time and get a few upvotes from less knowledgeable ppl. Even if i downvote and comment, its still in the spotlight and might still mislead people. Commented Aug 5, 2014 at 11:39
  • It doesn't matter. Downvote and warn people is the best you can do Commented Aug 27, 2014 at 14:29
0

If something is going to get under your skin as not being a "best practice", I think the best way to handle it is to let someone know (not that they will understand) why it's a problem and try and provide a better solution.

I don't think a question or answer necessarily deserves a downvote (though it might). There are some perfectly valid reasons to do things that aren't best practice. I will load models/collections and iterate over them inside of a .phtml file and have no hesitation that what I'm doing is wrong. Of course, I won't leave that code permanent, but there are times when doing something the "wrong" way is the best way to handle something that is only temporary.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .