background preloader

Don't repeat yourself

Don't repeat yourself
Applying DRY[edit] DRY vs WET solutions[edit] Violations of DRY are typically referred to as WET solutions, which is commonly taken to stand for either "write everything twice" or "we enjoy typing".[2][3] See also[edit] References[edit] External links[edit]

http://en.wikipedia.org/wiki/Don%27t_repeat_yourself

Related:  Software & programmingAJAX

The Story of Mel A recent article devoted to the macho side of programming made the bald and unvarnished statement: Real Programmers write in FORTRAN. Maybe they do now, in this decadent era of Lite beer, hand calculators, and “user-friendly” software but back in the Good Old Days, when the term “software” sounded funny and Real Computers were made out of drums and vacuum tubes, Real Programmers wrote in machine code. Not FORTRAN. Not RATFOR. Cross-origin resource sharing Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.[1] A web page may freely embed images, stylesheets, scripts, iframes, videos and some plugin content (such as Adobe Flash) from any other domain. However embedded web fonts and AJAX (XMLHttpRequest) requests have traditionally been limited to accessing the same domain as the parent web page (as per the same-origin security policy).

You ain't gonna need it "You aren't gonna need it"[1][2] (acronym: YAGNI)[3] is a principle of extreme programming (XP) that states a programmer should not add functionality until deemed necessary.[4] Ron Jeffries writes, "Always implement things when you actually need them, never when you just foresee that you need them."[5] The phrase also appears altered as, "You aren't going to need it"[6][7] or sometimes phrased as, "You ain't gonna need it". YAGNI is a principle behind the XP practice of "do the simplest thing that could possibly work" (DTSTTCPW).[2][3] It is meant to be used in combination with several other practices, such as continuous refactoring, continuous automated unit testing and continuous integration.

A beginners guide to Dependency Injection Scope This article presents a high level overview of Dependency Injection (DI). It aims to present the overall concept of Dependency Injection to the junior developer within the context of how it could be used in a variety of DI containers. Dependency Injection (DI) or Inversion of Control (IOC) ? A lot of current literature often refers to the same design pattern as either Dependency Injection or Inversion of Control. 10 Technical Papers Every Programmer Should Read (At Least Twice) 10 Technical Papers Every Programmer Should Read (At Least Twice) this is the second entry in a series on programmer enrichment Inspired by a fabulous post by Michael Feathers along a similar vein, I’ve composed this post as a sequel to the original.

Favicon Wikipedia's favicon, shown in an older version of Firefox (from 2008) History[edit] In March 1999, Microsoft released Internet Explorer 5, which supported favicons for the first time.[4] Originally, the favicon was a file called favicon.ico placed in the root directory (e.g., of a web site. It was used in Internet Explorer's favorites (bookmarks) and next to the URL in the address bar if the page was bookmarked.[5][6][7][4] A side effect was that the number of visitors who have bookmarked the page could be estimated by the requests of the favicon. KISS principle Origin[edit] While popular usage has transcribed it for decades as "Keep it simple, stupid", Johnson transcribed it as "Keep it simple stupid" (no comma), and this reading is still used by many authors.[7] There was no implicit meaning that an engineer was stupid; just the opposite.[3] The principle is best exemplified by the story of Johnson handing a team of design engineers a handful of tools, with the challenge that the jet aircraft they were designing must be repairable by an average mechanic in the field under combat conditions with only these tools. Hence, the "stupid" refers to the relationship between the way things break and the sophistication available to repair them. The acronym has been used by many in the U.S. military, especially the U.S.

Prefix free: Break free from CSS vendor prefix hell! -prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. The target browser support is IE9+, Opera 10+, Firefox 3.5+, Safari 4+ and Chrome on desktop and Mobile Safari, Android browser, Chrome and Opera Mobile on mobile.

Factory method pattern Factories may be invoked in various ways, most often a method call (a factory method), sometimes by being called as a function if the factory is a function object (a factory function). In some languages factories are generalizations of constructors, meaning constructors are themselves factories and these are invoked in the same way. In other languages factories and constructors are invoked differently, for example using the keyword new to invoke constructors but an ordinary method call to invoke factories; in these languages factories are an abstraction of constructors but not strictly a generalization, as constructors are not themselves factories.

67 Open Source Replacements for Really Expensive Applications Why spend thousands or even hundreds or thousands of dollars on a closed source application when you can get a comparable open source app for free? Even if you need commercial support, many open source programs now offer paid support that costs much less than the alternatives. For this list, we looked for quality, open source alternatives to software that has a reputation for being expensive. Whenever possible, we included MSRPs for the expensive software, though in some cases, the pricing scheme is so complicated that it's nearly impossible to pin down. We published a similar list last year, and we've updated and expanded the list for 2011. If you have suggestions for next year's list, feel free to note them in the comments section below.

Asynchronous XMLHttpRequests with XhrIo - Closure Tools Overview JavaScript's XMLHttpRequest enables the responsive, persistent user interfaces that characterize AJAX applications. Web applications can use XMLHttpRequest to communicate with the server from JavaScript without reloading the page or blocking. But while most modern browsers support XMLHttpRequest, different browsers have different implementations. SOLID (object-oriented design) In computer programming, SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the "first five principles" named by Robert C. Martin[1][2] in the early 2000s[3] that stands for five basic principles of object-oriented programming and design. The principles when applied together intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.[3] The principles of SOLID are guidelines that can be applied while working on software to remove code smells by causing the programmer to refactor the software's source code until it is both legible and extensible. It is part of an overall strategy of agile and adaptive programming.[3]

The Road To Reusable HTML Components Advertisement A few weeks ago, I dug up an old article that I wrote for Smashing Magazine, “When One Word Is More Meaningful Than a Thousand1.” While I stand firmly behind all of the HTML development principles I listed back then, the article lacked one important thing: hands-on examples.

Related:  Ruby/ Ruby on RailsECM