document.querySelectorAll( "li" );
The same selection using jQuery is like this:
At this stage of my learning, I can’t say I see the above as a major advantage. Yes, it’s shorter but you could argue it’s also less descriptive for the reader. Brevity isn’t always a net win in code. This is especially true when tools like Emmet and other text editor tricks auto-complete a lot of code. So it’s not 100% clear to me what the advantage is.
It will be interesting as my jQuery knowledge grows if my feelings toward it change. At this early stage, I can’t help feeling sceptical. Especially when I keep hearing about frameworks like Angular and React. I guess we will see.
Another surprise to me is the popularity of various text editors. VS Code has really risen to the top in a short space of time. To my horror Notepad++ (of all things) is the 3rd most popular app. Sublime text somehow trails behind it in 4th place and my beloved Atom is 8th!
With over 100,000 developers participating in the survey, it really is quite a rich resource. Did anything surprise you in the results?
Just a quick post to say I’ve updated the colour game with a new mode, Hex colours. To enable different modes I’ve changed a little bit of the UI. So the difficulty is now a dropdown making room for a matching mode dropdown. The beauty of this is I can add other modes (CMYK for example) without to much UI fuss.
To give this new model a try, just select Hex from that dropdown and the board will refresh. As always you can play the game and/or check out the code, which evertickels your fancy.
The great thing about it, is it’s one language that can do basically everything from the front end, to the server side, to the database. It means any investment in learning it gives incredible flexibility to the developer.
Tonight I got a bit of time to work on a new version of RGB colour game. This time I focused mostly on UI improvements so the game looks a little nicer than the first release. I’m particularly fond of the subtle CSS transition when you click on an incorrect colour. Little touches like this are what make a UI a bit loveable.
This morning I read a short article on the maintainer of GitHub desktop, William Shepherd. For some reason, I kept seeing the article everywhere so eventually I surrendered to it. The post had a number of good points but the highlight for me was the advice to anyone maintaining an open-source project:
Have a clear vision of what you’d like your project to accomplish and be open to refining it when it makes sense
Have a detailed README that includes information on how to contribute to the project, submit bug reports, and a code of conduct
Work hard to make your project inclusive of all people from the start
Make your project easy to implement by eliminating the amount of work potential contributors have to do to build and run your project
Don’t put the needs of your project ahead of your own
The idea of the game is the player is presented with up to six coloured squares and an RGB value. They player then has to pick the square that matches the RGB value. There’s an easy (3 colours) and hard (6 colours) mode too, so you can vary the challenge of the game.
You’ve been spending plenty of time together. You’ve had your ups and downs. As time’s gone on you’ve realised you like the way things are going and it’s time to commit.
Writing effective, communicative commit messages can make the world of difference to other members of your team. Just as with code comments or clear variable and function naming, good commit messages are worth putting some thought into.
First and foremost focus on communicating why the changes are being made. It’s easy to think commit messages are actually about what has changed, but reviewing the code will show you that. Why the code has change lets people know the intent of the change rather than the details of it. Good examples of commit titles are:
Update interface to the new branding
Add Dutch translation
Remove reference to Batmans true identity
Add GDPR compliance message
Once you’ve nailed your title follow up with a good description. For example:
Remove reference to Batmans true identity
The copyright text on Batmans website specifiys the copyright holder as “Wayne Enterprises”. This suggests that Batman has some association with the organisation. This update removes all connection between the two entities, protecting all parties. This fix addresses issue #391.
As you can see this message doesn’t contain any details about the code. It clearly highlights why the commit is being made and also connects the commit to a reported issue if one exists.