Skip to content →

Ivan Ferré's Blog Posts

Two Issues Installing Prettier

I have recently had some problems installing Prettier as an extension for VS Code. As a reminder, and maybe as a help to others, here come two pieces of advice.

A number of issues can happen. StackOverflow and Reddit have some interesting threads about them. So don’t panic: shit happens, and it’s not that terrible.

What I suffered was a combination of two different small issues. I don’t know how they happened, but with the assistance of online buddies, I could solve them. Communities are great. Internet fosters communities. Take the benefit.

First thing: somehow a starting blank was the first character into an option path. This makes the extension interpret that path as relative instead of absolute, and therefore it could not find the right .json file. To check and correct, you have two options:

  • Go over the settings in the Format and Prettier sections, and check all possible paths. There aren’t that many, if you haven’t tinkered a lot.
  • But if you’ve done, go to the settings.json file. You may use a regular expression to quickly spot the offender character.

This one was difficult to spot. Thanks to d47 on Reddit to make me think about it.

The second one is how to properly make a clean installation of Prettier when you’ve already been messing out with it a lot. And this is what happens when things don’t go perfect from the start. There is a crystal-clear explanation on how to do it in this StackOverflow question.

Interestingly, the cause and symptoms of the original poster’s question is different from mine, but the solution is common, which should make us think about how we search for answers to technical trouble.

Any story about bug-seeking you would like to share?

Thanks for reading,
Ivan.

Leave a Comment

CSS Default Values Reference

Next time you wonder why some HTML element doesn’t want to do what you tell him to do with your wonderful CSS code, remember to check the CSS Default Values Reference.

Of course, the default values should be the expected ones, but when you style the elements, it’s easy to forget about them, and think you do it from scratch.

Kudos to w3schools for their great resources.

Do you want to share any other cheat sheet or programming learning resource? Feel free to do it in the comments below.

Thanks for reading,
Ivan.

Leave a Comment

Learning Git

I first learnt about version control when I was a research assistant at the UPC long time ago. In those glory old days, it was either SCCS or RCS. Now it’s Git.

The importance of version control is huge. It doesn’t add any value to a software project, but it dramatically caps the number of silly mistakes and the time needed to solve them. A short but in-depth discussion may be found here.

The aforementioned GIT –everything-is-local website is the best source of information about Git. There you may find the entire Pro Git book, written by Scott Chacon and Ben Straub and published by Apress, is available at the GIT –everything-is-local site.

If you are new to Git, let me point you to a few useful resources:

Last, here you have a reminder of Git commands, grouped by function:

Configuration

git --version  
git config user.name  
git config user.email  
git config core.editor  

Getting Help

git <command> -help  
git help --all

Repository initialization

git status
git status --short

The short status flag values are:

?? - Untracked files
A - Files added to stage
M - Modified files
D - Deleted files

Recording Changes

git add filename  
git add --all	# git add -A
git diff
git commit -m "Message!"

Branching

git branch
git branch <new-branch-name>
git checkout <new-branch-name>
git branch -r
git branch -a

Pull from GitHub

git fetch
git merge
git pull

Push to GitHub

git commit -a -m "Message."
git status
git push origin
git push origin branch-name

Fork and clone

Fork is a GitHub feature, not part of Git.

According to Git naming conventions, it is recommended to name your own repository origin, and the one you forked for upstream

git clone https://github.com/w3schools-test/w3schools-test.github.io.git
git clone <url-repository> <new-folder>

git remote -v
git remote rename <original-name> <new-name>

Rollback

git log --oneline
git revert HEAD --no-edit
git revert HEAD~<n>	n = 1/2/... will go to the n+1 previous commit

git reset <hash-first-seven>

git commit --amend -m "Correct the previous commit"

Do you recommend any specific resources to master Git? Please, share them.

Thank you for reading.
Ivan Ferré.

Leave a Comment

Buy-in

I have recently read for the second time the excellent book buy-in, by John P. Kotter and Lorne A. Whitehead.

John P. Kotter & Lorne A. Whitehead: Buy-In

Buy-in is a short handbook addressed to all who want an idea to be approved by a group of people, in its wider sense. Clearly, all professionals who need to get through a board or committee to approve a project should be interested.

The title may be a little misleading, but the book cover is crystal clear: this book is about «saving your good idea from getting shot down». Not about being persuasive, but to stop common attacks aimed to abort your intentions. It offers a simple method to build strong support for your ideas.

This method is clearly exposed. Buy-in first presents an example scenario of project approval: an inexperienced manager who has made up a sound plan to overcome a real problem and must have it approved by a committee. Through fun and engaging narrative, Kotter and Whitehead display the different types of attacks any proposal may be faced to. Different specific examples, small and uncomplicated enough to focus the reader’s attention on how the attack is defeated, show the mechanics and effect of such attacks. The example is a clear parody of what may happen in any company, and readers will easily relate to their own environments and colleagues.

The second half of the book is the proper handbook, where Kotter and Whitehead go over a categorization of twenty-four typical attacks, depicting for all of them a simple and effective response.

I insist on what is this book and what is not: buy-in is not on how to get the board or anyone else to buy your ideas, but to avoid the strategies that naysayers’ and nitpickers may use to prevent them to be implemented and deliver results. The method the authors present assume your proposal is solid enough to be approved by a sensible board, and you introduce it appropriately. This is not a book about developing either documents or conducting presentations, nor to create new ideas or achieve consensus.

The authors suggest an effective 4-step method to deal with unfair attacks:

  1. Treat everybody with respect.
  2. Capturing people’s attention.
  3. Winning over their minds.
  4. Winning over their hearts.

The method emphasizes on contributing short common sense pills and to avoid lengthy, deep, convoluted debates when seeking for approval. Twenty-four useful responses are proposed to deal with the most typical attacks.

Following these four guidelines and the answer examples, we should be able to avoid the four deadly strategies to attack any proposal:

  1. Death by delay.
  2. Confusion.
  3. Fearmongering.
  4. Character assassination.

Obviously, the contents of Buy-in relate to the much broader topic of transformational change. The book includes an appendix detailing the eight steps to undertake to achieve success in large corporate changes:

  1. Increase urgency and develop a gut-level drive to get up each and every day determined to do something.
  2. Build a guiding coalition of collaborators who volunteer to help and learn to work together as a team to lead the transformation process.
  3. Create a change vision that show how your team and your company will look like if they succeed. Which strategies will lead you there?
  4. Communicate the vision and strategies to all involved stakeholders to obtain broad buy-in. When enough people have truly bought in, both intellectually and emotionally, the process may continue.
  5. Empower the guiding coalition to eliminate obstacles and do what the change effort requires.
  6. Create short-term wins to gain momentum and turn skeptics into supporters.
  7. Make every effort to keep the urgency up and avoid complacency.
  8. Make the change stick: transformation only truly succeeds after the changes have been institutionalized.

Both times I’ve read buy-in I’ve enjoyed a lot. I appreciate Kotter‘s and Whitehead‘s straightforward approach and how they keep the explanation simple. They show empathy with all the book’s characters, emphasizing the open and respectful attitude they advocate in the book. The applicability of their advice is rapidly sensed and this boost the reader’s engage to their suggested process.

Definitively, Buy-in delivers. I find it enlightening, instructive, and entertaining. It is genuine and provides clear and simple advice that once read have the flavor of common sense. And it motivates the reader to perform the author’s approach and achieve his goals by focusing on a single question: don’t get derailed of what you were doing.

At the end, buy-in triggers the will to read on further and connected topics: how to be persuasive, how to read people and their agendas, keep calm and focused, creativity, …

Thanks for reading. Please leave your comments.

Ivan Ferré.

John P. Kotter, * Lorne A. Whitehead*: buy-in. Saving your good idea from being shot down. Published by Harvard Business Review Press (2010).

Leave a Comment

WordCamp Geneva 2016

WordCamp Switzerland 2016 has been a great event.

WordCamp Geneva 2016 logo

Many interesting topics arose during #wcgva. I pick the following points as the ones that made the most impact.

The most important thing was the forthcoming WordPress REST API, who will allow WordPress to support a vast range of requirements. From 2017 on WordPress will be capable of dealing with content that updates continuously in a proper way, and to do it without human intervention.

When you consider the envisage tide of IoT future applications, the prospect is most WordPress installations will manage their content through this interface in a few years.

I also think that it is very meaningful that a lot of discussions were focused on WordPress backend and the services it provides to its users. The panel What is missing in WordPress to be the perfect CMS devoted its attention entirely to backend features. In addition, Mark Howells-Mead discussed the WordPress possibilities as a headless CMS, taking advantage of legacy systems like Typo3 or expertise on front-end technologies like AngularJS.

Add this to what I’ve said in the previous point and we face a new scenario where WordPress acts mainly as a fully-fledged content management system and no longer as a PHP framework to easily develop websites. This is a huge change for the product.

Big news: WordPress core is advancing towards proper multi-language support. WordPress 4.7 will provide a host of new internationalization features that hopefully will pave the road for easier multilingual sites development.

I don’t expect WordPress to pull the rug out under their partners feet, so plugins like WPML, Bogo or MultilingualPress will most probably still be required to build proper multilingual sites, but developing content services for markets that span more than one language (welcome to globalization!) is a requirement that should be fulfilled easier with future WordPress releases.

Last, it was very interesting to hear Beatrice Otto‘s dissertation on the struggle of a non-computer-savvy professional when developing her first WordPress project.

A necessary call to user friendliness to developers, designers and technical writers who have devoted time and effort to master tools and jargon, and who are making products for people who do not have the time or money to acquire the same background. We must work better.

Any thoughts about these topics? What feature do you miss in WordPress?

I look forward to your comments… and to the next WordCamp.

Leave a Comment

WordPress Performance meeting in Bern

Yesterday I attended the WordPress Bern Group session on Performance Optimization.

WordPress Bern Group

It was a pleasant and interesting meeting (though my poor Swiss German skills) where Nico Martin from vir2al websolutions discussed the most obvious topics to look after when optimizing a WordPress (actually, any) site:

The image load hugely depends on the image size, which in turn depends on the image dimensions and resolution. You must balance the required quality and dimensions for the actual display device to use in your pages.

If you think this is not such an issue, multiply all your site’s images for the number of different size versions when developing a responsive design. I assume you want your site to run fast and be handsome on every possible screen, do you?

Herr Martin discussed the benefits of using progressive jpeg, a question that has supporters and antagonists. He also demonstrated the EWWW Image Optimizer WordPress plugin, which streamlines image optimization.

As for the code minification, he demonstrated how to do it easily by using the Sublime Text editor and Autoptimize WordPress plugin.

Of course this only addresses the removal of spurious characters and not proper code optimization, but the latter is a much larger issue that deals with the quality of your developers’ work.

He also recalled the usual tactics of moving scripts to the footer of the page in order to improve the perceived performance. Not something that is always feasible, but certainly worth to consider.

Finally Nico Martin demonstrated Google’s PageSpeed Insights to test the load time of different webpages, both their desktop and mobile renderings.

WP Bern is a group that’s well worth to check out if you have any interest in web development. I also attended the session on [WordPress Backup & Restore] which was really interesting, too.

You may read about their activities in the WP Bern homesite and join their meetings by using their Meetup group

Leave a Comment

Microsoft buys LinkedIn

A few days ago Microsoft bought LinkedIn for $26.2 Billion.



26,000 million dollars is certainly pricey for just a huge contacts database. And Microsoft executives aren’t going to flood all those contacts with spam. Not only because they are not so silly, but mainly because most of those profiles are not on IT-decision making grounds. So we should look somewhere else looking for suitable explanations for this deal.

And I think it’s quite easy to figure out that this acquisition paves an improved way to make business to both companies.

Microsoft may supply LinkedIn’s users with tools to work and cooperate with, from the almost ubiquitous Office to the cloud services to streamline B2B processes.

LinkedIn is the company that bought Slideshare, Pulse, and Lynda.com, to support its users in their search for greener pastures, either finding new jobs, networking with other pros, promoting their profiles, or just having a wider look to their professional arena. So it’s not only aimed to be the contact list on the cloud but the channel to everybody’s next professional deal.

LinkedIn provides a channel to sell, cooperate and meet with other professionals and companies. And that is something Microsoft may use to enlarge the scope of its tools. Outlook has been widely realized by most analysts, but I guess that Skype and the CRM system embedded in Dynamics offer the best chances to transform networking processes.

Last but not least, LinkedIn finds funding for the investments she needs to make.

It’s not so easy to find a deal with benefits for both sides.

Any thoughts about it?

Leave a Comment

Let the User in Command

What are computer programs for?

Computer programs are to help humans to perform different tasks. This works for every type of programs including websites or apps on mobile phones. It’s the user who’s doing something; software only helps.

Using the app is only one step in his way. For instance, she may read a website when she’s looking for some information; or she may use a routing app to figure out how to reach a destination. But she may also be talking with someone else, or even be in a hurry. Therefore, the user is not interested in the app by itself. He only wants to get some output from it, to achieve the actual larger goal he’s pursuing. Nobody is interested in using apps. People use apps to get something. Even with games: people play to have fun, and to fill a form to register is seldom fun even if this is the price to play a game. Using an app makes only sense in the context of the user’s flow of action.

The user is doing something **beyond** using the app. So the user has a plan. He intends to do something and he wants to do it right now. He may even be in a hurry! So it’s a bad idea to force him or her to do something else. Actually, it’s a pretty terrible one. Let’s think about some cases.

If the user wants to quickly note some information on the go, a suggestion to update the app may be seen as an obstacle. And a delay caused by some unrequested data format update may be seen as a huge obstacle. The user may be writing something important just while some identification dialog pops up and then not only he cannot jot down what he wants, but he accidentally would have removed that password he wrote months ago and cannot remember.

In scenarios like these, the app may ruin the user experience. Programmers cannot fully figure out the user context, so **deciding when it’s a suitable time to take command of the application is highly risky**.

The usual annoyances include:
– To require to enter an id and even a password.
– To pop up suggestions for social sharing.
– to lead to a form to enter some information.
– To promote other products or services.

All things the user **may** be interested **after** the program has delivered the output he’s supposed to do.

Thus, all these goals should be achieved by displaying notices _the user may choose to accept_.

Removing command from the user will lead him to experience frustration. He may even not understand how to _properly_ use the program. And will unlikely push him to rate high the app in the market. Quite the opposite of the developers’ goals.

These are my thoughts. I invite you to comment on them if you wish.

Leave a Comment