Are you over 18 and want to see adult content?
More Annotations

Théâtre du Capitole de Toulouse - le site officiel - Théâtre du Capitole
Are you over 18 and want to see adult content?

La cour des petits - Idées d'activités pour les enfants de 0 à 10 ans
Are you over 18 and want to see adult content?

World Leading Industrial LED Lighting Solutions - Dialight
Are you over 18 and want to see adult content?

Marco Casanova - Best Selling Author of Branding and Marketing Books
Are you over 18 and want to see adult content?

CNC Cutting Machines for Your Application & Budget - MultiCam
Are you over 18 and want to see adult content?

AG客户端下载-ag手机客户端官网
Are you over 18 and want to see adult content?

Mochimochi Land – Let's make happy
Are you over 18 and want to see adult content?

The easiest way to buy & sell furniture - AptDeco
Are you over 18 and want to see adult content?
Favourite Annotations

Dynasty Fantasy Football - Dynasty League Football
Are you over 18 and want to see adult content?

Karatay 21 Nolu İşgalaman Aile Sağlığı Merkezi - KARATAY - KONYA
Are you over 18 and want to see adult content?

Rantt Media – News, Analysis, and Politics 101
Are you over 18 and want to see adult content?

Casino-Games-Slots-Poker-Blackjack-Craps-Roulette - Casino Games Market Place
Are you over 18 and want to see adult content?

Norway in a nutshell® tours - official site - Fjord Tours
Are you over 18 and want to see adult content?

Vancouver Island University - Canada – Master & Bachelor
Are you over 18 and want to see adult content?

abne Abscheider Besteckverleih Naturschutz Eventverleih Spülmobil Verleih Geschirrmobil Mieten
Are you over 18 and want to see adult content?
Text
BLOG | CODEUTOPIA
The most annoying piece of code to fix or work with is the code you can’t make any sense out of. Tests are code. As such, it’s important to treat your test code just like any other code, and make sure it’s easy to understand! Let’s take a look at how we can structure our test code to make sure our tests are easy to understandand follow.
REACT APPLICATION DATA-FLOW: WHERE AND HOW TO STORE YOUR The basic idea with React is whenever we have nested components – for example, Chat, which has a list of ChatMessage s – the parent component updates each child. This is what we’re doing in our code now. The Chat component has a list of messages. Each message is given to a ChatMessage, in other words, the data flows from parent ( Chat)to
BEST PRACTICES FOR BUILDING EMBEDDABLE WIDGETS WHAT ARE UNIT TESTING, INTEGRATION TESTING AND FUNCTIONALSEE MORE ONCODEUTOPIA.NET
5 STEP METHOD TO MAKE TEST-DRIVEN DEVELOPMENT AND UNITSEE MORE ONCODEUTOPIA.NET
MONGOOSE MODELS AND UNIT TESTS: THE DEFINITIVE GUIDESEE MORE ONCODEUTOPIA.NET
UNIT TESTING 4: MOCK OBJECTS AND TESTING CODE WHICH USES After learning to write tests and some good testing practices, it’s now time to look at mock objects.. When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in – a mock object is a “clone” of an object, which we can use to simplify our tests, by having the mock object perform CAN YOU MAKE JAVASCRIPT’S STRING MUTABLE? TRACKING THE USER’S BROWSING HISTORY WITH PHP HOW TO EASILY REDIRECT PHP OUTPUT TO A FILEBLOG | CODEUTOPIA
The most annoying piece of code to fix or work with is the code you can’t make any sense out of. Tests are code. As such, it’s important to treat your test code just like any other code, and make sure it’s easy to understand! Let’s take a look at how we can structure our test code to make sure our tests are easy to understandand follow.
REACT APPLICATION DATA-FLOW: WHERE AND HOW TO STORE YOUR The basic idea with React is whenever we have nested components – for example, Chat, which has a list of ChatMessage s – the parent component updates each child. This is what we’re doing in our code now. The Chat component has a list of messages. Each message is given to a ChatMessage, in other words, the data flows from parent ( Chat)to
BEST PRACTICES FOR BUILDING EMBEDDABLE WIDGETS WHAT ARE UNIT TESTING, INTEGRATION TESTING AND FUNCTIONALSEE MORE ONCODEUTOPIA.NET
5 STEP METHOD TO MAKE TEST-DRIVEN DEVELOPMENT AND UNITSEE MORE ONCODEUTOPIA.NET
MONGOOSE MODELS AND UNIT TESTS: THE DEFINITIVE GUIDESEE MORE ONCODEUTOPIA.NET
UNIT TESTING 4: MOCK OBJECTS AND TESTING CODE WHICH USES After learning to write tests and some good testing practices, it’s now time to look at mock objects.. When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in – a mock object is a “clone” of an object, which we can use to simplify our tests, by having the mock object perform CAN YOU MAKE JAVASCRIPT’S STRING MUTABLE? TRACKING THE USER’S BROWSING HISTORY WITH PHP HOW TO EASILY REDIRECT PHP OUTPUT TO A FILE 5 STEP METHOD TO MAKE TEST-DRIVEN DEVELOPMENT AND UNIT We’ll go back to step 3, and choose the next tiny step to take. Step 4, add test. Step 5, implement. Repeat. If you keep advancing in small steps like this, TDD suddenly becomes a lot easier. Yes – you might end up with several tests for a fairly small amount of code, but that’s not a bad thing. UNIT TESTING 4: MOCK OBJECTS AND TESTING CODE WHICH USES After learning to write tests and some good testing practices, it’s now time to look at mock objects.. When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in – a mock object is a “clone” of an object, which we can use to simplify our tests, by having the mock object perform HOW TO UNIT TEST NODEJS HTTP REQUESTS? We will use the builtin assert module as a validator for our tests.sinon is our mocking library.PassThrough is a simple stream, which we can use as a test double for other streams. We will look at the use of http next.. The key things here are beforeEach and afterEach.beforeEach creates a stub to replace http.request, and afterEach restores the original functionality. HOW TO FIX JAVASCRIPT ERRORS MORE EASILY WITH CHROME’S The Call Stack shows us the “parents” of this function call. Our current function is highlighted, Loader.loadImages.All the items below it are functions which were executed before entering this function – in this case, we can see the function where the code came from is an (anonymous function).. We can access all the previous functions by clicking them in the call stack list. BEST PRACTICES FOR JAVASCRIPT FUNCTION PARAMETERS Best practice: Provide defaults for optional parameters. We can also use destructuring in the parameter list with objects, together with a default: This gives you the best of both worlds. You can pass in parameters easily as an object, but the properties for the object can be easily seen from the function’s signature. COMMON WIDGET DESIGN PATTERNS The common parameter is that all widgets would benefit from a common storage interface, which could be easily swapped. In its simplest form: var Storage = { get: function( name) { }, set: function( name, value) { } }; var Storage = { get: function (name) { }, set: function (name, value) { } }; The above is a very simple storage abstraction.You
SHOULD A FAILED FUNCTION RETURN A VALUE OR THROW AN An uncaught exception can bring down a whole application. An unhandled return code might not really cause anything at all. Sometimes it’s important to consider this factor too. One interesting alternative is using a type to indicate the result. For example, in Haskell, you can have a value of type Maybe. This indicates that it can have a HOW TO PASS VARIABLE VALUES TO JAVASCRIPT 1. Embedding scripts into templates. This is the most straightforward way of passing values: Embed your JavaScript code into the template/view or whatever you call the thing you’re outputting from your server-side script. The example shows a very simple function which just alerts a message with a variable’s value. ES6: WHAT ARE THE BENEFITS OF THE NEW FEATURES IN PRACTICE This is a big topic on its own, and outside the scope of this article. Overall the new features in ES6 provide a number of benefits especially for larger applications. If you don’t need to support older browsers, then you’ll have a fairly easy time since ES6features
FIND AN APPLICATION’S ICON WITH WINAPI Sure, there’s a lot of documentation available about the Windows API, but how do I know where to look? I did eventually figure out how to do this, so here’s the solution for anyone else who might be struggling with the same. public Icon GetAppIcon ( IntPtr hwnd) { IntPtr iconHandle = SendMessage ( hwnd,WM_GETICON,ICON_SMALL2, 0); ifBLOG | CODEUTOPIA
The most annoying piece of code to fix or work with is the code you can’t make any sense out of. Tests are code. As such, it’s important to treat your test code just like any other code, and make sure it’s easy to understand! Let’s take a look at how we can structure our test code to make sure our tests are easy to understandand follow.
BEST PRACTICES FOR BUILDING EMBEDDABLE WIDGETS WHAT ARE UNIT TESTING, INTEGRATION TESTING AND FUNCTIONALSEE MORE ONCODEUTOPIA.NET
REACT APPLICATION DATA-FLOW: WHERE AND HOW TO STORE YOUR The basic idea with React is whenever we have nested components – for example, Chat, which has a list of ChatMessage s – the parent component updates each child. This is what we’re doing in our code now. The Chat component has a list of messages. Each message is given to a ChatMessage, in other words, the data flows from parent ( Chat)to
SINON.JS QUICK TIP: HOW TO STUB/MOCK COMPLEX OBJECTS, SUCHSEE MORE ONCODEUTOPIA.NET
USING SPATIAL DATA IN DOCTRINE 2 SHOULD A FAILED FUNCTION RETURN A VALUE OR THROW ANSEE MORE ONCODEUTOPIA.NET
TRACKING THE USER’S BROWSING HISTORY WITH PHP FIND AN APPLICATION’S ICON WITH WINAPI Sure, there’s a lot of documentation available about the Windows API, but how do I know where to look? I did eventually figure out how to do this, so here’s the solution for anyone else who might be struggling with the same. public Icon GetAppIcon ( IntPtr hwnd) { IntPtr iconHandle = SendMessage ( hwnd,WM_GETICON,ICON_SMALL2, 0); if WHAT’S THE DIFFERENCE BETWEEN UNIT TESTING, TDD AND BDDSEE MORE ONCODEUTOPIA.NET
BLOG | CODEUTOPIA
The most annoying piece of code to fix or work with is the code you can’t make any sense out of. Tests are code. As such, it’s important to treat your test code just like any other code, and make sure it’s easy to understand! Let’s take a look at how we can structure our test code to make sure our tests are easy to understandand follow.
BEST PRACTICES FOR BUILDING EMBEDDABLE WIDGETS WHAT ARE UNIT TESTING, INTEGRATION TESTING AND FUNCTIONALSEE MORE ONCODEUTOPIA.NET
REACT APPLICATION DATA-FLOW: WHERE AND HOW TO STORE YOUR The basic idea with React is whenever we have nested components – for example, Chat, which has a list of ChatMessage s – the parent component updates each child. This is what we’re doing in our code now. The Chat component has a list of messages. Each message is given to a ChatMessage, in other words, the data flows from parent ( Chat)to
SINON.JS QUICK TIP: HOW TO STUB/MOCK COMPLEX OBJECTS, SUCHSEE MORE ONCODEUTOPIA.NET
USING SPATIAL DATA IN DOCTRINE 2 SHOULD A FAILED FUNCTION RETURN A VALUE OR THROW ANSEE MORE ONCODEUTOPIA.NET
TRACKING THE USER’S BROWSING HISTORY WITH PHP FIND AN APPLICATION’S ICON WITH WINAPI Sure, there’s a lot of documentation available about the Windows API, but how do I know where to look? I did eventually figure out how to do this, so here’s the solution for anyone else who might be struggling with the same. public Icon GetAppIcon ( IntPtr hwnd) { IntPtr iconHandle = SendMessage ( hwnd,WM_GETICON,ICON_SMALL2, 0); if WHAT’S THE DIFFERENCE BETWEEN UNIT TESTING, TDD AND BDDSEE MORE ONCODEUTOPIA.NET
HOW TO START USING ES6 (AND BEYOND) TODAY We also need to install the preset to our project: npm install --save babel-preset-es2015. Without the use of the preset, we would have to define a lot of plugins, as we need a plugin for every ES6 feature. There are a number of other presets available as well.. Using Babel with Node.js for development 5 STEP METHOD TO MAKE TEST-DRIVEN DEVELOPMENT AND UNIT We’ll go back to step 3, and choose the next tiny step to take. Step 4, add test. Step 5, implement. Repeat. If you keep advancing in small steps like this, TDD suddenly becomes a lot easier. Yes – you might end up with several tests for a fairly small amount of code, but that’s not a bad thing. USING SPATIAL DATA IN DOCTRINE 2 Using spatial data in Doctrine 2. In this post I’ll introduce you to extending Doctrine 2 to provide ways to use custom data types and DQL functions. We needed a simple way to store locations and calculate distances between points on maps and some other stuff for Wantlet. Since we are using MySQL, we decided to use MySQL’s Spatial MONGOOSE MODELS AND UNIT TESTS: THE DEFINITIVE GUIDE Mongoose models and unit tests: The definitive guide. Mongoose is a great tool, as it helps you build Node apps which use MongoDB more easily. Instead of having to sprinkle the model-related logic all over the place, it’s easy to define the functionality as Mongoose models. Querying MongoDB for data also becomes quick and easy – and if you HOW TO FIX JAVASCRIPT ERRORS MORE EASILY WITH CHROME’S The Call Stack shows us the “parents” of this function call. Our current function is highlighted, Loader.loadImages.All the items below it are functions which were executed before entering this function – in this case, we can see the function where the code came from is an (anonymous function).. We can access all the previous functions by clicking them in the call stack list. UNIT TESTING 4: MOCK OBJECTS AND TESTING CODE WHICH USES After learning to write tests and some good testing practices, it’s now time to look at mock objects.. When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in – a mock object is a “clone” of an object, which we can use to simplify our tests, by having the mock object perform BEST PRACTICES FOR JAVASCRIPT FUNCTION PARAMETERS Best practice: Provide defaults for optional parameters. We can also use destructuring in the parameter list with objects, together with a default: This gives you the best of both worlds. You can pass in parameters easily as an object, but the properties for the object can be easily seen from the function’s signature. DO YOU NEED TO GO TO SCHOOL TO LEARN PROGRAMMING? Learning it in school. If you learn programming in school, assuming it’s not just some really basic course, you will often get knowledge heavily on the theoretic and design side of things. You may learn an “academic” language like Scheme, and things like how programming languages and compilers work, language architechture and so on. HOW TO PASS VARIABLE VALUES TO JAVASCRIPT 1. Embedding scripts into templates. This is the most straightforward way of passing values: Embed your JavaScript code into the template/view or whatever you call the thing you’re outputting from your server-side script. The example shows a very simple function which just alerts a message with a variable’s value. FIND AN APPLICATION’S ICON WITH WINAPI Sure, there’s a lot of documentation available about the Windows API, but how do I know where to look? I did eventually figure out how to do this, so here’s the solution for anyone else who might be struggling with the same. public Icon GetAppIcon ( IntPtr hwnd) { IntPtr iconHandle = SendMessage ( hwnd,WM_GETICON,ICON_SMALL2, 0); ifBLOG | CODEUTOPIA
Ok – that isn’t the most amazing thing in the world. In a simple example like this, it isn’t too bad. But we all know real code is never easy to understand, especially after tenABOUT | CODEUTOPIA
I used to have many of the same problems: For some years, I felt I was stuck. I was a reasonably good developer, but I had no idea what I should do to make my code better, but I REACT APPLICATION DATA-FLOW: WHERE AND HOW TO STORE YOURREACT DATA GRID EXAMPLESREACT AJAXREACT EXAMPLESREACT GET JSONREACT GET JSON First, we load the list component as it’s required for rendering. Then, we updated the submit function so it doesn’t create a ChatMessage anymore – this is now handled within the MessageList.. Finally, in the render function, we pass the list of messages as an attribute to the MessageList.Remember that passing attributes to components like this makes them available within the this.props USING SPATIAL DATA IN DOCTRINE 2 WHAT ARE UNIT TESTING, INTEGRATION TESTING AND FUNCTIONALSEE MORE ONCODEUTOPIA.NET
HOW TO FIX JAVASCRIPT ERRORS MORE EASILY WITH CHROME’SSEE MORE ONCODEUTOPIA.NET
SINON.JS QUICK TIP: HOW TO STUB/MOCK COMPLEX OBJECTS, SUCHSEE MORE ON CODEUTOPIA.NETSINON JS FOR TYPESCRIPTSINON JSSINON STUB PROPERTYSINON STUB EXPORTED FUNCTIONSINON STUB RETURNSSINON STUB MULTIPLE CALLS SHOULD A FAILED FUNCTION RETURN A VALUE OR THROW ANSEE MORE ON CODEUTOPIA.NETC# THROW AN EXCEPTIONC# THROW AN EXCEPTIONPYTHON THROWAN EXCEPTION
TRACKING THE USER’S BROWSING HISTORY WITH PHP FIND AN APPLICATION’S ICON WITH WINAPI I was working on some C# code today, and had to figure out how to find a specific application’s icon. There’s a lot of basic information on this, including messages like WM_GETICON in MSDN, but it justwouldn’t work.
BLOG | CODEUTOPIA
Ok – that isn’t the most amazing thing in the world. In a simple example like this, it isn’t too bad. But we all know real code is never easy to understand, especially after tenABOUT | CODEUTOPIA
I used to have many of the same problems: For some years, I felt I was stuck. I was a reasonably good developer, but I had no idea what I should do to make my code better, but I REACT APPLICATION DATA-FLOW: WHERE AND HOW TO STORE YOURREACT DATA GRID EXAMPLESREACT AJAXREACT EXAMPLESREACT GET JSONREACT GET JSON First, we load the list component as it’s required for rendering. Then, we updated the submit function so it doesn’t create a ChatMessage anymore – this is now handled within the MessageList.. Finally, in the render function, we pass the list of messages as an attribute to the MessageList.Remember that passing attributes to components like this makes them available within the this.props USING SPATIAL DATA IN DOCTRINE 2 WHAT ARE UNIT TESTING, INTEGRATION TESTING AND FUNCTIONALSEE MORE ONCODEUTOPIA.NET
HOW TO FIX JAVASCRIPT ERRORS MORE EASILY WITH CHROME’SSEE MORE ONCODEUTOPIA.NET
SINON.JS QUICK TIP: HOW TO STUB/MOCK COMPLEX OBJECTS, SUCHSEE MORE ON CODEUTOPIA.NETSINON JS FOR TYPESCRIPTSINON JSSINON STUB PROPERTYSINON STUB EXPORTED FUNCTIONSINON STUB RETURNSSINON STUB MULTIPLE CALLS SHOULD A FAILED FUNCTION RETURN A VALUE OR THROW ANSEE MORE ON CODEUTOPIA.NETC# THROW AN EXCEPTIONC# THROW AN EXCEPTIONPYTHON THROWAN EXCEPTION
TRACKING THE USER’S BROWSING HISTORY WITH PHP FIND AN APPLICATION’S ICON WITH WINAPI I was working on some C# code today, and had to figure out how to find a specific application’s icon. There’s a lot of basic information on this, including messages like WM_GETICON in MSDN, but it justwouldn’t work.
ABOUT | CODEUTOPIA
I used to have many of the same problems: For some years, I felt I was stuck. I was a reasonably good developer, but I had no idea what I should do to make my code better, but I CONTACT | CODEUTOPIA Questions? Comments? I like to hear from my readers, so drop me a line. Want me to write for you? I do guest posts, ask me and let’s see if we can work something out. 5 STEP METHOD TO MAKE TEST-DRIVEN DEVELOPMENT AND UNIT Step 3: Decide on one tiny aspect of the functionality. We now know the goal, the data involved and the function signature. In a non-TDDworkflow, you’d
HOW TO UNIT TEST NODEJS HTTP REQUESTS? We will use the builtin assert module as a validator for our tests.sinon is our mocking library.PassThrough is a simple stream, which we can use as a test double for other streams. We will look at the use of http next.. The key things here are beforeEach and afterEach.beforeEach creates a stub to replace http.request, and afterEach restores the original functionality. HOW TO FIX JAVASCRIPT ERRORS MORE EASILY WITH CHROME’S The Call Stack shows us the “parents” of this function call. Our current function is highlighted, Loader.loadImages.All the items below it are functions which were executed before entering this function – in this case, we can see the function where the code came from is an (anonymous function).. We can access all the previous functions by clicking them in the call stack list. HOW TO AUTOMATICALLY RUN UNIT TESTS FROM A GIT PUSH This should hopefully be quite self-explanatory with the comments. Basically git sends the old revision, new revision and the ref’s name in standard input to CAN YOU MAKE JAVASCRIPT’S STRING MUTABLE? Turns out toString isn’t used when it comes to strings. However, when casting the variable to string with the String constructor, it outputs the value from toString. HOW TO PASS VARIABLE VALUES TO JAVASCRIPT The main idea of this approach is that you can put your actual JS code into a separate file, and then in your page where you need the code, you include the file with a script tag and add another script tag, which sets up the object with the configuration you need. This way the code is easy to reuse and maintain, as you can use the code anywhere at all because it doesn’t depend on parameters WHAT’S THE DIFFERENCE BETWEEN UNIT TESTING, TDD AND BDD When you’re just getting started with automating your JavaScript testing, there’s a lot of questions. You’ll probably see people talk about unit testing, TDD or Test-Driven Development, and BDD or Behavior-Driven Development. HOW TO EASILY REDIRECT PHP OUTPUT TO A FILE Ever wanted to change where your PHP sends the output to a file instead of the browser? I have, and it involved changing every echo and other printing statemenet to fwrite.CodeUtopia
__ __
__
__
__ Navigation
* Home
* Blog
* About
* Contact
* __ Search
* Home
* Blog
* About
* Contact
* __ Search
I SPENT MY VACATION PROGRAMMINGTags:
I was just on vacation for four weeks and I spent the entire timewriting code.
Read More
QUICK JAVASCRIPT TESTING TIP: HOW TO STRUCTURE YOUR TESTS? Tags: JavaScript TestingUnit Testing
Something that’s not talked very often when it comes to writing unit tests is how should you structure your test code? I’m not talking about “well, just put your code into a file in test/SomeTest.js”, but rather, how should the test code itself within your test case be structured? While it may feel inconsequential – afterall, it’s just a test, and it’s probably just a few lines of code – it’s actually very important to take care when writing your tests. The most annoying piece of code to fix or work with is the code you can’t make any sense out of. Tests are code. As such, it’s important to treat your test code just like any other code, and make sure it’s easy tounderstand!
Let’s take a look at how we can structure our test code to make sure our tests are easy to understand and follow.Read More
JAVASCRIPT TESTING TOOL SHOWDOWN: SINON.JS VS TESTDOUBLE.JS Tags: JavaScript Sinontestdouble
Unit Testing
When unit testing real-world code, there are many situations that make tests hard to write. How do you check if a function was called? How do you test an Ajax call? Or code using setTimeout? That’s when you use test doubles — replacement code that makes hard to test things easyto test.
For many years, Sinon.js has been the de-facto standard in JavaScript tests for creating test doubles. It’s a must-have tool for any JavaScript developer writing tests, as without it, writing tests for real applications would be nigh impossible. Recently, a new library, aptly named testdouble.js, has been making waves. It boasts a similar feature set as Sinon.js, with a few differences here and there. In this article, we’ll look into what both Sinon.js and testdouble.js offer, and compare their respective pros and cons. Will Sinon.js remain the superior choice, or will the challenger take theprize?
Note: If you’re unfamiliar with test doubles, I recommend reading mySinon.js tutorial
first. It will help you better understand the concepts we’ll betalking about here.
Read the rest of this entry here 230 CURATED RESOURCES AND TOOLS FOR BUILDING APPS WITH REACT.JS Tags: JavaScript React This post will curate the best resources, tools, libraries, and articles that will help you learn to build production applications with React.js. This 6000 word post will take you from getting started with React, through UI design, routing, testing, deployment, and continuous integration. There are many sections and you should feel free to jump to the resources you need.Read More
SIMPLIFY YOUR JAVASCRIPT CODE WITH NORMALIZER FUNCTIONSTags: JavaScript
Everyone loves a good if-else tower! What could be simpler than nesting a few conditionals?if(stuff) {
if(more stuff) {
haha();
}
else {
cool();
}
}
if(stuff) { if(more stuff) { haha(); } else { cool(); } } Ok – that isn’t the most amazing thing in the world. In a simple example like this, it isn’t too bad. But we all know real code is never easy to understand, especially after ten different people have changed it over the course of years! But what can you do? Sometimes you have complicated logic, and implementing it without a leaning tower of if-elses can be nighimpossible.
Let me show you something called _normalizer functions_, and how they can help you get rid of some of that complexity.Read More
4 NON-JAVASCRIPT LIBRARY TOPICS TO LEARN TO TAKE YOUR SKILLS TO THENEXT LEVEL
Tags:
Every new year there’s always a bunch of articles about “Learn this in year 200X!” But the problem is.. they’re always about libraries. Learn PrototypeJS. Learn jQuery. Learn Backbone. Learn AngularJS. Now it’s Learn React (or some React-derivative) This stuff comes and goes! Chances are, your job mostly dictates the libraries you’d use. Even if you do get to pick one, you’ll figure it out with your coworkers based on factors other than “some guy on the internet said we shoulduse this”.
I’m not saying those articles are necessarily _bad_. They can be a useful look at what’s popular and what are some new interesting upand comers.
What I am saying is THERE ARE MORE USEFUL THINGS TO LEARN BEYOND THE COOL LIBRARY OF THE YEAR.Read More
BEST PRACTICES FOR JAVASCRIPT FUNCTION PARAMETERS Tags: Best PracticesJavaScript
From time to time, people ask things like “should I use objects to pass function arguments”. I’m sure you recognize the pattern, as it’s common with many libraries: $.post({ a: 'lot', of: 'properties', live: 'in', here: 'yep' }) $.post({ a: 'lot', of: 'properties', live: 'in', here: 'yep' }) But I would say this is not actually such a good idea. Let’s take a look at the best practices for defining function parameter lists in JavaScript.Read More
5 STEP METHOD TO MAKE TEST-DRIVEN DEVELOPMENT AND UNIT TESTING EASY Tags: JavaScript Sinon Test-Driven DevelopmentUnit Testing
What’s the hardest thing in test-driven development or unit testingin general?
Writing tests!
The syntax or the tools aren’t the problem – you can learn those enough to get started in 15 minutes. The problem is how to take some vague idea in your head about what you want to do, and turn it into something that verifies some function works… _before you even wrote the damn thing!_ People tell you to use TDD. But how can you possibly write a test for something that doesn’t exist? I don’t even know what the function is going to do yet – or if I actually want two functions instead of one – and instead you want me to think of a test for it? Are youcrazy?
How do all those people who tell you to use TDD do it? That’s the thing – test-driven development requires thinking of your code in a different way. And nobody ever tells you how to dothat.
Until now.
Read More
WHAT IS PROPERTY BASED TESTING (AND HOW TO DO IT IN JAVASCRIPT)?Tags: JavaScript
QuickCheck
Unit Testing
Ever wonder… what if you didn’t have to write specific tests with hardcoded test data? Or have you ever written a function which can take many different values as input? How can you test something like that easily withdifferent values?
These are the kinds of important questions in life that keep me up at night! (ok maybe not) But did you know both of these questions can be solved with something that’s called “property based testing”? That’s right – PROPERTY BASED TESTING CAN HELP YOU TEST THE UNTESTABLE. And while at it, you can even use them to test your other functions with automatically generated data. All of this means property based tests are great for finding those pesky corner cases that are easy to forget. This means less debugging weird bugs that you find in production – you know, the really hard to reproduce ones, which occur for only one user in some weirdly specific combination of settings. Sounds pretty cool huh? Let’s find out some more!Read More
STAIRCASE CODE – HOW SHORT FUNCTIONS ARE NOT ALWAYS THE BESTSOLUTION
Tags: JavaScript
Have you ever seen code which at first look seems good.. but then as you try to figure it out (maybe to fix a bug), it just feels… wrong? For some reason the code just feels really difficult to follow – forno obvious reason!
In this post, I’m going to explain one such occurrence that I ran into in a production codebase. The code looked ok, yet it was hard tounderstand. Why?
Let’s find out. We’ll also look at some examples of how you can avoid and discover problems like this more easily.Read More
* Page 1 of 37
*
* 1
* 2
* 3
* ...
* 37
* →
RECENT POSTS
* I spent my vacation programming * Quick JavaScript testing tip: How to structure your tests? * JavaScript Testing Tool Showdown: Sinon.js vs testdouble.js * 230 Curated Resources and Tools for Building Apps with React.js * Simplify your JavaScript code with normalizer functionsARCHIVES
Archives Select Month July 2017 May 2017 April 2017 February 2017 January 2017 November 2016 October 2016 September 2016 June 2016 May 2016 April 2016 March 2016 February 2016 January 2016 December 2015 November 2015 September 2015 April 2015 March 2015 February 2015 January 2015 December 2014 November 2014 October 2014 September 2014 August 2014 June 2014 February 2014 December 2013 November 2013 August 2013 July 2013 May 2013 April 2013 March 2013 February 2013 January 2013 November 2012 September 2012 July 2012 May 2012 April 2012 March 2012 February 2012 January 2012 December 2011 October 2011 August 2011 July 2011 June 2011 May 2011 April 2011 March 2011 February 2011 January 2011 December 2010 November 2010 October 2010 September 2010 August 2010 July 2010 June 2010 May 2010 April 2010 March 2010 February 2010 January 2010 December 2009 November 2009 October 2009 September 2009 August 2009 July 2009 June 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 October 2008 September 2008 August 2008 July 2008 June 2008 May 2008 April 2008 March 2008 February 2008 January 2008 December 2007 November 2007 October 2007 September 2007__ __
__
__
Copyright © 2006 - 2016 Jani Hartikainen Type and Press “enter” to SearchDetails
Copyright © 2023 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0