Writing Testable JavaScript
We’ve all been there: that bit of JavaScript functionality that started out as just a handful of lines grows to a dozen, then two dozen, then more. Along the way, a function picks up a few more arguments; a conditional picks up a few more conditions. And then one day, the bug report comes in: something’s broken, and it’s up to us to untangle the mess. As we ask our client-side code to take on more and more responsibilities—indeed, whole applications are living largely in the browser these days—two things are becoming clear. One, we can’t just point and click our way through testing that things are working as we expect; automated tests are key to having confidence in our code. Two, we’re probably going to have to change how we write our code in order to make it possible to write tests. Really, we need to change how we code? Yes—because even if we know that automated tests are a good thing, most of us are probably only able to write integration tests right now. Integration ...
adam
appendto
applications
argument
assertion
brendan eich
brevity
brighton
capybara
chai
christian
complexity
conditions
conference
confidence
configurability
content-type
datatype
deepequal
development
difference
documents
dom
elements
environment
examination
function
functionality
handleclick
html
implementation
instance
integration
interaction
internet
introduction
isfunction
javascript
johansen
json
loadtemplate
management
mocha
oncreate
persistence
portion
practice
presentation
preventdefault
production
qunit
responsibility
resultslist
rsvp
ruby
sanity
searchdata
searchform
searchresults
selenium
setresults
solution
sontag
templaterequest
test-driven
tmplcache
url
usefakexmlhttprequest
version
xhr
yes
The Design of Code: Organizing JavaScript
Great design is a product of care and attention applied to areas that matter, resulting in a useful, understandable, and hopefully beautiful user interface. But don’t be fooled into thinking that design is left only for designers. There is a lot of design in code, and I don’t mean code that builds the user interface—I mean the design of code. Well-designed code is much easier to maintain, optimize, and extend, making for more efficient developers. That means more focus and energy can be spent on building great things, which makes everyone happy—users, developers, and stakeholders. There are three high-level, language-agnostic aspects to code design that are particularly important. System architecture—The basic layout of the codebase. Rules that govern how various components, such as models, views, and controllers, interact with each other. Maintainability—How well can the code be improved and extended? Reusability—How reusable are the application’s components? How easily ...
addition
addy
api
applications
argument
attention
closemenu
communications
consistency
consists
contributions
customization
direction
duration
elements
environment
experiment
extension
flexibility
foundation
function
functionality
github
implement
implementation
initialization
interaction
javascript
jpanelmenu
jquery
jquery-based
maintainability
notation
notice
openmenu
options
organization
osmani
practice
relationship
reusability
section
setmenustyle
simplicity
somecomplexmethod
togglemenu
NSA Data Center the Focus of Tax Controversy
Nerval's Lobster writes "Location is everything when choosing the site of a data center. Firms such as Microsoft and Google and Facebook spend a lot of time looking into the costs of land, power, regulation and taxes before placing their respective data centers in a particular place. Sometimes, that local tax bill comes into play in a big way. Just ask the National Security Agency which learned it faces a multimillion-dollar annual state tax on the power consumed by its new data center in Camp Williams, south of Salt Lake City. The Salt Lake Tribune obtained a series of email exchanges between the feds and the state, with the NSA protesting a $2.4 million tax on its annual power expenditure, pegged at about $40 million. Harvey Davis, director of installations and logistics for the NSA, sent a letter (subsequently quoted by the newspaper) to state officials that made the logistics argument: 'Long-term stability in the utility rates was a major factor in Utah being selected as our site for ...
argument
binney
center
communications
construction
davis
facebook
google
harvey
installation
lake
lobster
location
microsoft
million
national security agency
nerval
nsa
regulations
stability
tribune
utah
utility
william
williams
Man cuts off his penis during argument with girlfriend
Ouch! A drunk man went to extraordinary painful lengths to end an argument with his girlfriend by cutting off his penis and testicles with a pair of scissors, and flushing them down the toilet.
argument
ouch
Leaked Microsoft Video Parodies Chrome Ad
First time accepted submitter Stratus311 writes "An article from The Verge shows a video leaked from Microsoft that parodies Google's Chrome ad. From the article: 'Microsoft and Google have been locked in a war of words over a YouTube Windows Phone app, but in the midst of the arguments a new Scroogled ad has emerged. Designed to be an internal-only video, a copy has somehow managed to find its way onto the web right in the middle of Google's I/O developer conference.'" "Somehow" leaked.
argument
chrome
conference
google
microsoft
scroogled
stratus
windows
youtube