Tips på artiklar om programmering

Riktigt bra artiklar som jag har lärt mig mycket från:

  1. The M in MVC: Why Models are Misunderstood and Unappreciated. ”Controllers must define application behaviour only in the sense that they map user input onto calls in Models, but beyond that role it should be clear all other application logic is contained within the Model.”
  2. ORM is an anti-pattern. ”OO design cannot represent relational data in an efficient way; this is a fundamental limitation of OO design that ORM cannot fix.”
  3. Understanding typeof, instanceof and constructor in JavaScript. ”They say in JavaScript “everything is an object”. They’re wrong. Some types in JavaScript are so-called “primitive types”, and they don’t act like objects.”
  4. One of the Best Bits of Programming Advice I ever Got. ”… And that giving it a better name would tend to make the design more encapsulated, less spaghetti code, in short more object oriented.”
  5. Nobody Understands REST or HTTP. ”Let’s talk about a few cases where either REST or HTTP (which is clearly RESTful in its design) solves a common web development problem.”

jQuery-events och ”return false”

Douglas Neiner på Fuel Your Coding skriver en bra artikel om varför du kanske inte borde avsluta alla jQuery-event-callbacks med ”return false” (för att undvika standardbeteendet). Rekommenderas om du vill lära dig mer om hur events propagerar.

In most situations where you would use return false what you really want is e.preventDefault(). … This does everything we want without prohibiting parent elements from receiving these events as well. The fewer restrictions you place on your code the more flexible it will be to maintain.