-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeed.xml
More file actions
576 lines (386 loc) · 44.1 KB
/
feed.xml
File metadata and controls
576 lines (386 loc) · 44.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>NoBlackMagic.com</title>
<description>Personal blog about my professional experience as web passionate guy.</description>
<link>http://NoBlackMagic.com/</link>
<atom:link href="http://NoBlackMagic.com/feed.xml" rel="self" type="application/rss+xml"/>
<pubDate>Sun, 14 Feb 2016 18:33:27 +0100</pubDate>
<lastBuildDate>Sun, 14 Feb 2016 18:33:27 +0100</lastBuildDate>
<generator>Jekyll v3.1.1</generator>
<item>
<title>Meet REAPP</title>
<description><p>I am dealing with <a href="https://facebook.github.io/react/" title="ReactJS">ReactJS</a> since one year. I have run through a great deal
of <em>WTFs</em> and teached a good deal of people how to avoid the worst ones.</p>
<blockquote>
<p><a href="https://github.com/marcopeg/generator-reapp" title="REAPP Source on GitHub">REAPP</a> is an opinionated setup served to you as a Yeoman generator;<br />
its goal is to have you working on a ReactJS App in 5 minutes from now.</p>
</blockquote>
<div class="embed-video">
<iframe width="480" height="360" src="https://www.youtube.com/embed/1cwB47-6OJc" frameborder="0" allowfullscreen=""></iframe>
</div>
<h2 id="whats-the-problem">What’s the problem?</h2>
<p>When it comes to <a href="https://facebook.github.io/react/" title="ReactJS">ReactJS</a> the most difficult thing to do is <strong>getting it
up and running with a simple and efficient setup</strong>. It’s tough as there is
so much to know and to learn around this argument:</p>
<ul>
<li><a href="https://facebook.github.io/react/" title="ReactJS">ReactJS</a></li>
<li>ES5 / JSX / JS6 / <a href="https://babeljs.io/" title="ES2015 Transpiler">Babel</a></li>
<li><a href="http://webpack.github.io/" title="Webpack Module Bundler">webpack</a> boundling service</li>
<li><a href="https://webpack.github.io/docs/webpack-dev-server.html" title="Webpack Dev Server">webpack dev server</a></li>
<li><a href="https://github.com/webpack/docs/wiki/hot-module-replacement-with-webpack" title="Webpack Hot Module Reload">hot module reload</a></li>
<li><a href="https://facebook.github.io/flux/" title="Flux">flux</a> / <a href="http://redux.js.org/" title="Redux">redux</a></li>
<li><a href="https://github.com/reactjs/react-router" title="React Router">router</a> / url state</li>
<li>testing: <a href="https://karma-runner.github.io" title="Karma Test Runner">karma</a> / <a href="https://mochajs.org/" title="MochaJS">mocha</a></li>
<li>folder structure</li>
</ul>
<p>Each of those thing is not a big deal, but when you try to put things together
you have to face poor documentation, incompatible beta versions and <em>NPM</em>.</p>
<h2 id="why-is-reapp-that-good">Why is REAPP that good?</h2>
<p>REAPP is an opinionated setup crafted for development speed.</p>
<p><strong>Do you like to write modern <em>ES6</em>?</strong><br />
REAPP ships with a complete <a href="https://babeljs.io/" title="ES2015 Transpiler">Babel</a> configuration for <em>ES6</em> and <em>ES7</em>.</p>
<p><strong>Do you like to write <em>SASS</em> or <em>LESS</em> when it comes to CSS?</strong><br />
REAPP let you write modern CSS right out of the box.<br />
You choose the language!</p>
<p><strong>Do you need a router?</strong><br />
REAPP ships with <a href="https://github.com/reactjs/react-router" title="React Router">React Router</a>.<br />
<small>(but you can also implement your own solution)</small></p>
<p><strong>Do you need to handle your app’s State?</strong><br />
REAPP ships with <a href="http://redux.js.org/" title="Redux">Redux</a>.<br />
<small>You can easily access <em>Redux Devtools</em> panel by <code class="highlighter-rouge">Cmd+space</code>.</small></p>
<p><strong>Do you need asynchronous actions?</strong><br />
REAPP provides you <a href="http://marcopeg.com/react/react-redux/services.html" title="Redux Services">services</a>.</p>
<p><strong>Do you need hot module reload?</strong><br />
REAPP provides hot module reload for both Javascript and CSS with no configuration overhead.</p>
<p><strong>Do you need a lightweight production minified bundle?</strong><br />
REAPP ships with develompent and production profiles.</p>
<p><strong>Do you need source maps for both Javascript and CSS?</strong><br />
REAPP provides source maps to facilitate debugging.</p>
<p><strong>Do you need to test your software?</strong><br />
REAPP provides you a <a href="https://karma-runner.github.io" title="Karma Test Runner">KarmaJS</a> environment which supports ES6 and <em>code coverage</em>.</p>
<p><strong>Do you need to proxy to your server side APIs?</strong><br />
REAPP let you configure your api end points in <a href="https://webpack.github.io/docs/webpack-dev-server.html" title="Webpack Dev Server">Webpack Dev Server</a>.</p>
<p><strong>Do you need to build your own fake APIs locally?</strong><br />
REAPP ships with a simple <a href="http://expressjs.com/" title="ExpressJS">ExpressJS</a> setup for this purpose.</p>
<h2 id="why-should-you-choose-reapp">Why should you choose REAPP?</h2>
<p>Because I did, and you should do the same ;-)</p>
<p>At the end of the story it just a pre-cooked setup of great open source projects.
Nothing more than that. <strong>You just shouldn’t waste time wiring up those
services</strong> when the job was already done.</p>
<blockquote>
<p>I didn’t reinvent the wheel:<br />
I based my work upon other people work!</p>
</blockquote>
<p>I have been collaborating with different teams in different companies, from
a small 2 devs startup to a big enterprise. I have faced different challenges
like the <em>“need for speed”</em> (in a startup) and long term maintainability.</p>
<blockquote>
<p>REAPP is the outcome of long hours spent doing meetings gathering a large
amount of different opinions about “how things should be done”.</p>
</blockquote>
<p>I think the way you work on a <em>Single Page App</em> in REAPP is simple and well
structured to the point to suit the most of your engineering needs.</p>
<p><strong>And you should use it as well</strong> :-)</p>
</description>
<pubDate>Sun, 14 Feb 2016 00:00:00 +0100</pubDate>
<link>http://NoBlackMagic.com/2016/02/14/meet-reapp.html</link>
<guid isPermaLink="true">http://NoBlackMagic.com/2016/02/14/meet-reapp.html</guid>
</item>
<item>
<title>The Holy Grail of Code Sharing</title>
<description><p>Code sharing is a concept which is whispered in low tone around the office, is being shouted loud by tools producers and is simply misunderstood by the great part of us, IT folks.</p>
<p>Management people wish every single line of code to be shared and 100% reusable, they see only one single fact: <em>less code means less costs</em>.</p>
<p>Product Owners and Scrum Masters have big troubles in understanding why to put time in code sharing practices, their way of thinking is: <em>better done than perfect</em>.</p>
<blockquote>
<p>Developers… where do I start?<br />
Oh yes, all we want is just to code and create amazing apps!</p>
</blockquote>
<p>This is the story about how <strong>my team faced the challenge to improve code sharing</strong> among the company with the great objective to improve code quality, reduce time to market and create happier developers.</p>
<h2 id="our-problem">Our Problem</h2>
<p>I work in a service company whose core business is mobile web applications development.</p>
<blockquote>
<p>We sell development time to customers who <strong>know what, but not how to</strong> do business with mobile devices.</p>
</blockquote>
<p>We are more than 100 programmers divided into teams of 6 to 10 guys. Each group is highly committed to it’s project and suffer under high time pressure to fulfill our different customers expectations.</p>
<p>The projects around the company are not that different, we do tailored based customisations of a shared service, much like a classic web agency producing custom websites.</p>
<blockquote>
<p>Today there is <strong>close to zero code sharing</strong> around our teams and this fact costs us
a lot of money.</p>
</blockquote>
<p><img src="/images/articles/old-clock.jpg" class="img-circle center-block post-img" /></p>
<p>We are a service company and <strong>our trading value is our delopers time</strong>.<br />
When two teams solve the same problem in two different ways, they spend the double of the time.</p>
<blockquote>
<p>And when you sell services, the rule of thumb is fairly easy:<br />
<strong>“the double the time the half the revenue”</strong></p>
</blockquote>
<p>To share code across teams appear to be the obvious and easy solution to our problem, but <strong>it turned out that its not easy</strong> to really implement this in a proper way.</p>
<h2 id="our-struggle">Our Struggle</h2>
<p>Our product is a quite complex mobile web application so we proposed <strong>to split the requirements into smaller chunks</strong> that could be reusable and customisable by many teams.</p>
<blockquote>
<p>We called those chunks <em>Features</em> and for the purpose of this article you can think to features as <em>Login</em>, <em>Payment</em>, <em>Articles</em>, …</p>
</blockquote>
<p>A <em>Feature</em> is a quite big part of the entire application that <strong>implements a single responsibility</strong> like loggin-in users or enabling payments, etc. It’s smaller compared to the whole application but still it is a unfairly large piece of cake.</p>
<p>After some hard thinking we came up with a good understanding of the <em>Features</em> that were involved in our apps and we were extremely happy and proud when <strong>we proposed the company to reorganize our developers into <em>Feature Teams</em></strong> whose task is to implement a specific <em>Feature</em> to be reausable by others.</p>
<p>This solution <strong>was hard to hear and accept by management</strong> because it involved dramatic changes to the company’s structure and business model.</p>
<blockquote>
<p><em>Feature Teams</em> was just a dead end.</p>
</blockquote>
<p>Our second approach was driven by the hard boundary to <strong>not change the company structure</strong>.<br />
<small>(We learned this lesson the hard way)</small></p>
<p><img src="/images/articles/struggle.jpg" class="img-circle center-block post-img" /></p>
<p>Long story short, we proposed to let our teams do their job and to create a side team of experts whose duty is to <strong>take existing custom code and <em>change it to make it reusable</em></strong>.</p>
<p>Also this time we became the target for jokes and laughter due to the concept of making things “<em>more reusable</em>”. What does it mean? I still don’t know.</p>
<blockquote>
<p>The third time you try, you are more likely to succeed.<br />
<small>If you are humble enough to learn from your mistakes.</small></p>
</blockquote>
<h2 id="our-solution">Our Solution</h2>
<p>Our final and most successful approach was to discard <em>high academic thinkings</em> and to go straight down to the core of our daily job.</p>
<blockquote>
<p>we do not just write code,<br />
<strong>we do solve problems with code!</strong></p>
</blockquote>
<p>So, instead of limit ourself to the struggle of code-sharing, we moved on and began to <strong>analyse where we were wasting time</strong> within the company.</p>
<blockquote>
<p>The most time expensive moment in every developer’s day is called <strong><em>WTF</em></strong>.<br />
<small><em>(What The Fuck)</em></small></p>
<p><small>This is not a bad or impolite expression. This is the technical name for the worst nightmare every man or woman, involved in the process of solving problems with code, has.</small></p>
</blockquote>
<p>Our <strong>first action point</strong> was to put small and cross-team groups of developers into a room on a weekly basis with the only objective <strong>to share <em>WTF</em> stories</strong>.</p>
<p>To tell to your mates <strong>were you had issues and how you solved those</strong> is not only about the code you wrote. It is all about the tools you used:</p>
<ul>
<li>search engines queries</li>
<li>articles, books, blogs &amp; forums</li>
<li>colleagues that knew that s***</li>
</ul>
<p>The second action point was to <strong>raise the culture of enterprise code writing</strong>.</p>
<p><em>Enterprise Code Writing</em> is nothing more than a small group of best practices that we can use when it comes to write code involving 130 people. Some of these are:</p>
<ul>
<li>single responsibility principle</li>
<li>open source first</li>
<li>readability first</li>
<li>why » how » code</li>
</ul>
<p>This bullet list might just sound like a bunch of cliché expressions, but I have to use them in this article and actually each of them is worth their own entire book.</p>
<blockquote>
<p>The general principle that should drive each of us is:<br />
<strong>Don’t do bullshit!</strong></p>
</blockquote>
<p><img src="/images/articles/no-bullshit.jpg" class="img-circle center-block post-img" /></p>
<ul>
<li>to build a big module is way more expensive than to build small ones that can work together</li>
<li>to write my own DOM library is way more time consuming compared to use a jQuery custom build</li>
<li>to write my own knowledge base about Javascript is just not the way, I can search, read and link valuable articles that are already available online</li>
</ul>
<p>All <strong>those examples are surprisingly difficult to achieve</strong> when it comes to developers,
the most proud and stubborn people of the planet!<br />
<small>(and as matter of fact I am proud to be one of them!)</small></p>
<h2 id="our-path">Our Path</h2>
<p>When it comes to practical coding we have a simple action point which is <strong>micro coding</strong>.</p>
<p>We left the idea of coding complete and reusable <em>Features</em> way behind us. Today we focus in <strong>writing the least amount of code possible</strong> for the smallest possible of the responsibilities. And we share that.</p>
<blockquote>
<p>Each function, source file or module must solve one single problem, no more than one.</p>
</blockquote>
<p>By just doing that our developers have began to <strong>produce reusable code from the very first day of the change</strong>, without introducing any new tool in their chain.</p>
<p>At the beginning we used a simple <a href="https://www.dropbox.com">DropBox shared folder</a> to share our micro libraries,
today we have evolved a bit by introduceing our second action point.</p>
<p>Our second practical action point is <strong>Open Source First</strong>.</p>
<blockquote>
<p>If the solutions exists among the Open Source community we use it,<br />
if we create our own solution, we publish it back for others to use.</p>
</blockquote>
<p>Today we use <a href="http://wiki.commonjs.org/wiki/CommonJS">CommonJS</a> and <a href="http://npmjs.org/">NPM</a> to write our Javascript, if we need a
library we search <em>NPM</em> or <em>GitHub</em>, if it exists we use it, if it exists on <em>GitHub</em> but it is not available through <em>NPM</em> we contribute to the project to fix it, then we use it through <em>NPM</em>.</p>
<p>This behaviour is much more than to merely <em>give back to the community</em>.</p>
<blockquote>
<p>By actively publish open source code <strong>we get free help from the community</strong> that
contributes to our repositories by doing bug-traking, bug-fixing and code enhancement.</p>
</blockquote>
<p>For writing CSS we embrace the <a href="http://www.smashingmagazine.com/2011/12/12/an-introduction-to-object-oriented-css-oocss/">Object Oriented CSS</a>
and we use <a href="http://lesscss.org/">LessCss</a> to build them, to easily do cross-browser compatibility we have chosen
<a href="http://lesshat.madebysource.com/">LessHat</a> which is quite simple
and complete.</p>
<p>The third and most important action point was to <strong>challenge our developers</strong>.</p>
<blockquote>
<p>There is nothing better than prizes to <strong>light up your willing of doing</strong>!</p>
</blockquote>
<p>So we introduced <strong>cross team challenges</strong>: groups of 3-4 people from different teams who were competing to produce some fun apps or little games.</p>
<p>The prize was always quite impressive and at the very beginning some managers had an heart attack about that.</p>
<blockquote>
<p>We have a play-room so we created a <em>ChallengeME</em> app to invite a colleague to the
table tennis, we do afterwork so we suggested a <em>PubRating</em> app internal
to the company… and much more!</p>
</blockquote>
<p>Eventually the learning effort that every developer put into <strong>the challenge was affecting the quality of his daily job</strong> so much that no money could have ever bought this accomplishment!</p>
<p>The best of it is that <strong>we exploited the proudness and stubbornness</strong> which is natural in each developer to play a fundamental and positive role within the company:</p>
<blockquote>
<p>When a developer learn a better implementation he can not accept to see legacy code
anymore so <strong>he/she coach other colleagues to improve</strong>. For free!</p>
</blockquote>
<h2 id="dont-forget-your-take-away">Don’t forget your Take Away!</h2>
<p>Today my company is a better place to work and the quality of what we produce has increased greatly. We have really made some great accomplishments regarding code sharing and reusability.</p>
<p>We’re also planning to move more into a product business model, something we can do today because we now have the culture of enterprise coding and reusability built into every single one of our developers.</p>
<p>During the last year a great guy left the company because his <strong>improvements were public on <em>GitHub</em></strong> and he was head hunted by one of our direct competitors.</p>
<p>This is good, he will learn even more from them but he can not stop to hang out with us, his old mates, we have become real friends through this experience, so <strong>all of the knowledge is coming back to us</strong>!</p>
<blockquote>
<p>We started this experience more than one year ago, we faced a problem,
we spiked some dead ends but eventually we made it. It took some time but it was worth it.</p>
</blockquote>
<p>What we have learned is that <strong>code sharing is not about tools, but about culture</strong>, is about people and knowledge, is about sharing the objective to spare some time from our daily struggles and to use it in a more fun and proficient manor.</p>
</description>
<pubDate>Tue, 10 Feb 2015 10:16:56 +0100</pubDate>
<link>http://NoBlackMagic.com/2015/02/10/holy-grail-of-code-sharing.html</link>
<guid isPermaLink="true">http://NoBlackMagic.com/2015/02/10/holy-grail-of-code-sharing.html</guid>
</item>
<item>
<title>Sleep tight and have an happy Life!</title>
<description><p>Backups are strange animals. In a perfect world you don’t need backups. You put efforts in building a solid backup strategy, you buy external drives, cloud storage and amazing software which you wish you never have to use in life.</p>
<p>So what? Why am I wasting all those efforts? Why do I live with a tera drive always plugged in my computer? Will a terabyte be enough by the way?</p>
<p>And when something really bad happens, when you see the bloody blue screen on a Windows machine, when your kids feed your powerless Mac with hot milk, what do you do? <strong>Do you remember how the restore procedure works?</strong> It never works, not for me at least.</p>
<p>But today is your lucky day because I am going to tell you that useful and dead simple backup strategies exist. And they are just few clicks away.</p>
<blockquote>
<p>The quick takeaway is to <strong>isolate the problem which shows up more often and solve it</strong> in
the simplest and most efficient way.</p>
</blockquote>
<p>Now try to be honest when you answer the following questions: How many times has a villain stolen your computer? How many times have you gotten destructive viruses? How many times have you screwed your code base because you have kept coding through out the night when you should have gotten some well deserved sleep?</p>
<p><img src="/images/articles/steal-computer.jpg" alt="steal-computer" class="img-circle center-block post-img" /></p>
<p><strong>For me is the “screwed code” scenario that is responsible for my worse headaches</strong>. It happens to me as I enter this mystical mental space in which “I see the light”. I feel the urge to give life to my bright ideas so I start scrambling the existing code base here and there. Oh some times I get things done but it is a matter of luck. 8 times out of 10 it doesn’t work at all, and often I can’t go back to where I’ve started!</p>
<p>The (urgent) <strong>need to get back to a stable code base</strong> is a daily scenario in the life of a developer. Indeed, it could happen more than once a day, if it was “one of those days”.</p>
<p>So there is Git. Well, yes but no. Of course Git is one of the most powerful tools at your disposal but it is not the easiest one. You should invest the time of learning Git as version control and collaboration tool, but for now let’s keep things simple. Dead simple.</p>
<p>The most efficient way to enable a <em>restore-ability</em> for your code base is to <strong>create a copy of the project before you start</strong> a development session. On a Mac is just a matter of right clicking the project’s folder and choose “duplicate”. Dead simple.</p>
<p>What is simple often works well, so let’s analyze what you do to revert your code. You trash the current project’s folder and rename the copy to match the original one. Dead simple and impressively quick.</p>
<p>Now you can improve your backup strategy by <strong>adding versioning support</strong>. You are going to keep a copy for each stable version of your code base. Right-click on your project’s folder and choose “compress archive”. This option is available with a slightly different name on different platforms but you have it for sure.</p>
<p>Every time you create a new archive the OS will <strong>automatically append a version number</strong> to it. You don’t have to bother and you can access your backup’s date &amp; time informations on the archive’s details panel. If you want to go even further my suggestion for you is to rename the archive, prefixing it with the current time in a “YYMMDDHHMM” format. Now the version number contains the time of the backups and <strong>all your archives are alphabetically sorted</strong> on your file manager view.</p>
<p><img src="/images/articles/schedule-backups.jpg" class="img-circle center-block post-img" /></p>
<p>Of course there is a price to pay for this simplicity. It’s space. You are going to need a lot of space if you version your project often. Luckily external drives are cheap nowadays and even cloud storage is not that expensive.</p>
<p>You can create your versions into your Dropbox folder so they are cloud stored right away and when you reach home at the end of the day you move the old ones to your gigantic external drive for a permanent storage.</p>
<p>So what about automation? Well so far we considered only manual backup and versioning strategies that you can trigger very quickly, but of course <strong>you want to schedule your backups</strong> to run under the hood.</p>
<p>The easiest possible solution is Mac’s <em>Time Machine</em> which will backup all your computer every hour by default. You can trigger a manual backup by choosing “backup now” on the incon tray’s menu. Some advantages are: a computer wide backup, the restore helper UI and the native support which is shipped within every Mac. The main drawback is that you need to live with your gigantic external drive always plugged in. And if you are not a Mac user then there is no drawback, there is a problem. TimeMachine is available only for Mac, but I am sure there are likewise solutions for both Windows and Linux. (If you know one please post it as a comment and I will integrate it.)</p>
<p>Another great backup tool is <a href="https://bombich.com/"><em>Carbon Copy Cloner</em></a>, another Mac tool. <strong><em>CCC</em> creates a bootable clone of your machine</strong> and you can schedule this backup the way you like it. I use <em>CCC</em> as disaster recovery strategy. I clone my Mac at least once a week so if I loose it, someone steal it or my dog plays with it, I can buy a new one and clone it back. <strong>In few hours I can be back on track even in a disastrous scenario</strong>. This is also a good strategy when I simply upgrade my computer to a new one. It’s almost 8 years I’ve been doing this and I never have a problem with it.</p>
<p><img src="/images/articles/external-drive.jpg" class="img-circle center-block post-img" /></p>
<blockquote>
<p>For you that want to play a little bit with some scripting my suggestion is
to buy a cheap hosting service which provides an FTP access. With this tool and
some bash code you may be able to automate the archive &amp; versioning of your projects
adding also a remote upload feature.</p>
</blockquote>
<p>In fact <strong>to backup on an external drive is far from enough to secure your data</strong>. External drives are getting cheaper and cheaper and that means that they are also more prone to failure. Will you be happy to pay hundreds of dollars to extract your photo archive from a ruined disk? I bet you won’t!</p>
<p>The trick, again, is as easy as redounding your backups on more than one drive.</p>
<p>I keep my <em>Carbon Copy Cloner</em> disk at home and the <em>TimeMachine</em> one at the office. <strong>I backup my important files in two drives that are geographically as far away from each other</strong>. My data will survive me coding drunk, a robbery, a fire and even an heartquake! With this strategy in place I do sleep tight.</p>
<h3 id="remember-the-takeaway">Remember the Takeaway:</h3>
<ol>
<li>think simple</li>
<li>make a copy of your project before you start coding</li>
<li>use cloud tools like <a href="https://www.dropbox.com/">Dropbox</a> or <a href="https://www.google.com/drive/">Google Drive</a></li>
<li>spread your backups to more disks, give one disk to your mom</li>
</ol>
<p>Sleep tight and live a happy Life!</p>
</description>
<pubDate>Fri, 16 Jan 2015 10:16:56 +0100</pubDate>
<link>http://NoBlackMagic.com/2015/01/16/free-backup-strategies-to-sleep-better.html</link>
<guid isPermaLink="true">http://NoBlackMagic.com/2015/01/16/free-backup-strategies-to-sleep-better.html</guid>
</item>
<item>
<title>You'd better Test to save some Rest</title>
<description><p>Since the day I became a developer, I’ve always feared the <em>Big What The Fuck</em>.</p>
<p>The <em>BWTF</em> is not only related to the code you write, it is the lack of knowledge that threatens to crush your entire project. It can be as simple as a server misconfiguration that causes a gaping security flaw.</p>
<p><img src="/images/articles/dude-wtf.jpg" alt="dude wtf?" class="img-circle center-block post-img" /></p>
<p>When the <em>BWTF</em> strike, there is nowhere to go; there is no place to hide. The <em>BWTF</em> is like the worst earthquake in the world: no building endures. A big part of your application, job and/or reputation goes to waste. And nobody wants this to happen.</p>
<blockquote>
<p>How can you protect yourself from the <em>Big What The Fuck</em>?</p>
</blockquote>
<p>Well, the first step is to accept that this risk exists. The next step is to conceive a strategy to mitigate that risk. After more than 10 years striving to avoid the <em>BWTF</em> I am now quite sure there is no way to remove that risk from your life. It is part of your life.</p>
<blockquote>
<p>The best strategy to mitigate the risk of a <em>Big What The Fuck</em> is <strong>Testing</strong>.</p>
</blockquote>
<p>I am not constraining the discussion to the source code. You should consider testing to be a strategy for a better life, with or without code. A strategy that you can use to fight the <em>BWTF</em>. Which is always lurking behind every corner, always present.</p>
<p>Say you plan to go holiday to the Red Sea, let’s try to work out a test to stress that decision:</p>
<ul>
<li>will I relax enough?</li>
<li>will I cope with 6 days without my Mac?</li>
<li>will it be safe?</li>
<li>will I gain 4 pounds by eating all the time?</li>
</ul>
<p>You do the same activity when coding a procedure that takes 2 integers and return the sum:</p>
<ul>
<li>is <code class="highlighter-rouge">sum(1, 1)</code> equal to <code class="highlighter-rouge">2</code>?</li>
<li>does <code class="highlighter-rouge">sum('a', 2)</code> throw an exception?</li>
<li>is <code class="highlighter-rouge">sum('a', 2)</code> exception a <code class="highlighter-rouge">wrongInputType</code> exception?</li>
</ul>
<blockquote>
<p>The more tests that you are able to produce against a decision / procedure, the bigger
chance you have to find early issues, with less of a risk of a <em>Big What The Fuck</em>
in the future.</p>
</blockquote>
<p>When it comes to a code scenario the most likely <em>BWTF</em> is to forget to consider a minor requirement from the customer. Then you deliver a product that will fail in the future when that minor requirement will manifest. Your phone will ring like crazy, your inbox will choke and you’ll move abroad to escape your shame.</p>
<blockquote>
<p>The <em>BWTF</em> is due to the unpredictability of when the problem will arise.</p>
</blockquote>
<p><img src="/images/articles/unpredictability.jpg" alt="life is unpredictable" class="img-circle center-block post-img" /></p>
<p>The later it shows up, the less you’ll recall what the minor requirement was and where the problem lies within the code base. And how the hell it works! By the time an issue like that manifests itself, you may have moved to another technology.</p>
<p>In real life a <em>Big What The Fuck</em> can be even worse. Almost four years ago I bought a brand new house and I took a loan for it. Less than two years later I moved to Sweden to join a challenging job opportunity. To this date I still haven’t sold that house, but I’m still paying the mortgage. Of course this is not a life threatening issue, but I can assure you it is annoying to throw away money like that. What if I had prepared myself with a more accurate test when I decided to buy the house?</p>
<ul>
<li>are my career opportunities well developed close to the house?</li>
<li>does my career ask me to be flexible about my location?</li>
<li>will it be possible to sell the house without losing big money on it?</li>
</ul>
<p>Well, I must confess that I didn’t create any of those tests at the time of the buying.</p>
<p>As you can see by yourself there is no known ways to completely remove the risk of a <em>Big What The Fuck</em>. The right way to behave is to mitigate that risk by running every decision / procedure against a <em>good amount of tests</em>. What the word <em>good</em> means in this context is up to you, but in general the more the tests the less the risk.</p>
<p>Another important point is that you can build you tests through time; it is always the right moment to add a new test. This is easier within a coding scenario. You may have missed a minor requirement but as soon you recognise it you can add a specific test to secure that requirement.</p>
<p>My test suite for real life scenarios is <em>practical common sense</em> but when it comes to a code scenario I can give some more specific pieces of advice which are specific to <em>Javascript</em>.</p>
<p><img src="/images/articles/common-sense.jpg" alt="common sense" class="img-circle center-block post-img" style="border: 1px solid #aaa" /></p>
<p><a href="http://karma-runner.github.io/0.12/index.html">KarmaJS</a> is a <a href="nodejs.org">NodeJS</a> command line tool which runs your unit tests. Among its features I should mention that you can run tests on multiple target browsers. You can test mobile devices connected to the same network. I use KarmaJS in combination with <a href="http://gruntjs.com/">GruntJS</a> or <a href="http://gulpjs.com/">GulpJS</a> to integrate tests into my building processes.</p>
<p><a href="http://mochajs.org/">MochaJS</a> is a Javascript test framework which helps in creating your specs files. It provides utility methods for a nice code organization of your unit tests.</p>
<p><a href="http://chaijs.com/">ChaiJS</a> is an <em>assertion library</em> that works great with Mocha. It allows you to write <code class="highlighter-rouge">expect(foo).to.be.a.string</code> so your assertions comes close to a natural language.</p>
<p><a href="http://sinonjs.org/">SinonJS</a> is a <em>mocking library</em> which provides a set of tools to investigate your code. Does this method fire twice? Did it receive a string argument? You can go further and completely mimic an <em>XHR request</em>.</p>
<blockquote>
<p>I maintain a simple <em><a href="npmjs.org">NPM module</a></em> which combines the above tools to provide
you with a ready to use test suite for Javascript:
<a href="https://www.npmjs.com/package/grunt-mocha-chai-sinon">grunt-mocha-chai-sinon</a>.</p>
<p>For a more sophisticated tool that brings a building process for <em>single page applications</em>
give a try to <a href="https://github.com/PoliteJS/workspace">PoliteJS/Workspace</a>.</p>
</blockquote>
<p><a href="http://www.webdriver.io/">WebDriver</a> is a NodeJS bridge to <a href="http://www.seleniumhq.org/">Selenium</a> functional testing suite. You can build your <em>FAT</em> in Javascript driving a browsing session with full access to Selenium’s API.</p>
<p><a href="http://dalekjs.com/">DalekJS</a> is a standalone alternative to <em>WebDriver</em>. Even if it is on an early stage it looks very promising.</p>
<h3 id="so-remember-your-takeaway">So remember your Takeaway:</h3>
<ol>
<li>the <em>Big What The Fuck</em> is always lurking and there is no way to avoid it</li>
<li><strong>testing is the best strategy</strong> you have to mitigate the risk of a <em>BWTF</em></li>
<li>you can apply testing to your professional and private life
<!-- /Markdown --></li>
</ol>
<p><img src="/images/articles/succeed.jpg" alt="success" class="img-circle center-block post-img" /></p>
</description>
<pubDate>Thu, 15 Jan 2015 10:16:56 +0100</pubDate>
<link>http://NoBlackMagic.com/2015/01/15/you-better-test-to-save-some-rest.html</link>
<guid isPermaLink="true">http://NoBlackMagic.com/2015/01/15/you-better-test-to-save-some-rest.html</guid>
</item>
<item>
<title>The Curse of the Proud Developer</title>
<description><p>The sky was turning dark when I saw the first <em>Internal Server Error</em> (code 500). It was 5PM in the winter’s afternoon and we were close to the release deadline. My heart missed at least two beats while my mouse ran to the reload button: “It may be just a network error, I thought”. But it wasn’t.</p>
<p>That day I was working on an important server side piece of code but now nothing was working anymore. No error messages, no logs. Nothing but a <em>code 505</em>. I went into panic.</p>
<p>Around me everyone was packing up to go home and I thought I could not bother them with an error I made on my own code. I was ashamed: “What they’ll think of me? I will loose my credibility as good developer for sure”. That was my fear and the room seemed to close down all around me. I was choking!</p>
<p>It was the <em>Curse of the Proud Developer</em> kicking in after a long day of coding.</p>
<p>So I started to debug my code from scratch. After going through generic checkpoints, I changed my strategy. I moved to a simple but effective line by line comment and test mode. A damn long and frustrating process. The code went blurry before my eyes.</p>
<p><img src="/images/articles/panic.jpg" class="img-circle center-block post-img" /></p>
<p>I remember I was almost sweating under the office lights, my sight narrowed down on my keyboard. I was trying to ignore all the happy people around me, hoping for a miracle to happen. And then the miracle did happen.</p>
<p>“We are going to Paddy’s, will you join us?” It was Johan asking me out to the local pub where we hang out with the team every Friday night. “Ehm, I’m kinda stuck with a damn bug, can’t join right now”, my voice was trembling so much I felt ashamed.</p>
<p>Johan came to my desk and we got into in a pair programming session to fix the bug. In a few minutes Vladimir and Maximilian also joined us as well. It was the whole team working together to solve a late <em>WTF</em> before going to the pub to celebrate the past week!</p>
<p>In the end we found the problem and today nobody recall who was to thank for the bug fix, it was a real team work, and it was successful. We really deserved that beer!</p>
<p>Since that <em>Black Friday</em> I faced many other <em>WTF</em> moments but I’ve never wasted another minute trying to get out of it on my own. What a relief, I neither panic, nor choke anymore.</p>
<p>My team is here to help me as I’m here to help them and this is how we overcame the <em>Curse of the Proud Developer</em>!</p>
<h2 id="remember-your-takeaway">Remember your Takeaway:</h2>
<ol>
<li>seek for help among your mates</li>
<li>a team play wins over the lonely wolf</li>
</ol>
<p><img src="/images/articles/teamwork.jpg" class="img-circle center-block post-img" /></p>
</description>
<pubDate>Tue, 13 Jan 2015 10:16:56 +0100</pubDate>
<link>http://NoBlackMagic.com/2015/01/13/the-course-of-the-proud-developer.html</link>
<guid isPermaLink="true">http://NoBlackMagic.com/2015/01/13/the-course-of-the-proud-developer.html</guid>
</item>
</channel>
</rss>