What is JSX (Javascript XML)

JSX is the markup used when building React applications.

JSX is another way to write Javascript, even it looks like HTML. A transpile step was added to transform it in Javascript because browser don’t understand JSX natively. Ultimately, the Javascript code becomes HTML.

It can be mixed with Javascript. Code written within curly braces is interpreted as literal Javascript.

Web usability guidelines

The most important thing if you want to make sure that your application or your site is easy to use is « Don’t make me think« . A Web page should be self-evident, obvious and self-explanatory.

There is a big difference between how we think people use websites and how they actually use them – glancing each new page, scanning some of the text, click on the first link that catches their interest. So, three facts about real-world Web use:

  1. Users don’t read pages, they scan them. They are on a mission, they don’t have to read everything.
  2. They don’t make optimal choices. They choose the first reasonable option. They are usually in a hurry, there is not much of a penalty for guessing wrong and weighing options may not improve the changes.
  3. They don’t figure out how things work. Not for lack of intelligence but for lack of caring. They forge ahead and muddle through.

Basic concepts of React.js

React is a Javascript library for building user interfaces. It is considered the « V » from the MVC pattern.
React was created to solve one problem: building large applications with data that changes over time.
A React application is build in terms of components. Javascript classes are used when declaring React components.
A component must extend the React.Component class and it must have a render method.
The Virtual DOM is an in-memory representation of the real DOM. It is generated by the components before any changes are made to the page. It happens between the render function being called and displaying of elements. . So, there are two steps:

  1. The render method of the component returns some markup but it is not the final HTML yet. It is an in-memory representation.
  2. The HTML is displayed in the browser.

This makes react faster. It is called diffing and it allows React to minimize changes as a result of user actions.

ReactDOM.Render method is called to render components to a web page.

Risks when changing software

Some questions to answer to:

  1. What changes do i have to make?
  2. How will i know that i’ve done them correctly?
  3. How will i know that i haven’t broken anything?

You can’t minimize software problems by avoiding them. Avoiding changes will make people get rusty at it. Another consequence is fear.

The alternative of avoiding changes is to try harder.

Changing software

Requirements change. Designs that cannot tolerate changing requirements are bad designs.

There are four primary reasons to change software:

  • Adding a feature
  • Fixing a bug
  • Improving the design
  • Optimizing resource usage

There is a very big difference between adding a new feature and changing old behaviour. When adding behaviour we must NOT change or remove behaviour the users already depend on.

Improving the design without changing its behaviour is called refactoring.

Optimization is like refactoring but it has a different goal. Some resource used by the program, time or memory, is changed.

When working on a system we can change three different things:

  • structure
  • functionality
  • resource usage

The Legacy Code Change Algorithm

  1. Identify change points – the places where you need to make the changes
  2. Find test points
  3. Break dependencies – Depenencies are the bigges impediment to testing. Break them to get tests in place.
  4. Write tests
  5. Make changes and refactor

What is legacy code?

Legacy code can have multiple definitions:

  • code we have gotten from someone else
  • a slang-term for difficult-to-change code that we don’t understand
  • code without tests. Without tests we can’t be sure if our code base is getting worse or better. With tests we can change the behaviour of our code quickly and verifiably.

Working Effectively with Legacy Code (Robert C. Martin Series)

Managing oneself

Some questions to answer to:

Am I a reader or a listener? How do I learn? Do I work well with people , or am I a loner? If I work well with people, in what relationship?

Do I produce results as a decision maker or as an adviser?

Do I perform well under stress, or do I need a highly structured and predictable environment?

What are my values? What kind of person do I want to see in the mirror in the morning?

Where do I belong?

What should my contribution be?

The existence of trust between people does not necessarily mean that they like one another. It means that they understand one another. Taking responsibility for relationships is an absolute necessity.

How you perform is a matter of personality.

Do no try to change yourself. Work hard to improve the way you perform.

Managing oneself, Peter Drucker

 

Le nom de la rose #3

Après le souper Guillaume et Adso utilisent le passage secret pour entre dans l’Edifice. Ils découvrent qu’un livre qui était sur la table de Venantius a disparu. Pendant leur visite, une personne mystérieuse apparait et vole les précieuses lunettes de Guillaume. Ils découvrent aussi que Venantius voulait cacher un secret important et qu’il s’est servi d’un alphabet secret qui devra être déchiffré.

Ils arrivent dans la bibliothèque. Ils observent que tous les livres sont nettoyés avec une certaine presence et que par terre il ne traine aucune saleté. Ils commencent à explorer la bibliothèque qui était comme un labyrinthe. A un moment donné ils perdent mais inopinément ils retrouvent la salle d’ou ils étaient partis. Quand ils rentrent dans leur cellules ils apprennent que l’Abbé les a cherchés toutes la nuit. Il voulait leur annoncer que Bérenger n’était pas dans la choeur et qu’il n’avait pas regagné sa cellule après l’office. En fouillant sa cellule un moine trouve un linge souillé de sang. Guillaume pense que c’est mieux d’attendre les éveniments.

Pendant le repas matinal et tandis que Adso mangeait, Salvatore lui raconte comment il a été choisi comme aide par le cellérier. Il se trouvait ici depuis des années, peu intéressé par les fastes de l’ordre, avec l’image d’un homme à la vie aventureuse, capable meme de tuer son semblable sans se rendre compte de son crime. Ados n’est pas sur de ce que Salvatore a inventé et il se demande ce qu’il a passé sous silence.

Guillaume et le maitre verrier, père Nicolas, travaillent pour réaliser une nouvelle paire de lunettes qui va permettre à Guillaume d’étudier en details le message secret de Venantius.