BACK ⟲
Scris de Marius Chiriac

Scrie cod curat

Scrierea de cod curat este una in cele mai valoroase atribute a oricarui programator. Este diferenta dintre un programator bun si unul excelent.

Codul curat este un cod usor de citit, usor de modificat, usor de explicat si usor de intretinut. Vrei sa scrii cat mai minimalistic si fara sa te repeti. Codul duplicat implica munca in plus si la scriere si la modificare.

Codul pe care il scrii nu este pentru ca un calculator sa il citeasca ci pentru a fi citit de oameni. Lizibilitatea codului tau trebuie sa fie o prioritate. Chiar daca trebuie sa scrii mai mult, nu ezita sa folosesti nume lungi descriptive pentru constante, variabile, clase sau orice alta parte a codului tau. O clasa de tipul “homeContactForm” pentru un formular pus pe homepage este mult mai usor de inteles decat daca doar scrii “hcf” sau “form”. Nu trebuie ca tu sa minifiezi manual codul, asta poate fi facut prin procese automatizate. Si nu ezita sa scrii comentarii cu ajutorul carora explici ce face o anumita portiune din cod.

In acelasi timp trebuie sa fii consistent. Daca ai inceput sa scrii ceva intr-un anumit mod atunci trebuie sa continui asa pana la finalul proiectului. Daca chiar este necesar atunci explica schimbarile prin comentarii. De exemplu, daca nu ai motive serioase atunci nu amesteca javascript ES5 cu ES6 sau javascript cu JQuery.

Martin Fowler, un membru al Aliantei Agile care a ajutat la crearea Manifestului pentru Dezvoltarea de Software Agile in 2001, a spus: “Orice prost poate scrie cod pe care un calculator il poate intelege. Programatorii buni scriu cod pe care oamenii il pot intelege”.

Daca tii cont de aceste principii de programare o sa observi ca vei scrie mai putin cod, vei gasi mai putine bug-uri si colegii tai iti vor multumi pentru ca nu le faci viata un calvar.

More posts

What large and small companies ask of branding

Small companies ask branding for a clear identity, while large companies ask for a system that keeps it the same in dozens of places. In the INOVEO archive, companies with revenue above 250 million lei [...]

Read More... from Scrie cod curat

Read the post

What each industry asks of its brand

Brand accounts for 32% of the purchase decision in technology and 67% in luxury, according to Interbrand. That is why each industry asks something different of its brand, depending on where and how fast its [...]

Read More... from Scrie cod curat

Read the post

Which branding work you do together, and in what order

Branding work delivers results when it is done as a system, in the order in which each piece supports the next: strategy first, then identity, then applications. The wrong order costs twice: an identity made [...]

Read More... from Scrie cod curat

Read the post

Branding for companies outside Bucharest

About 73% of Romania’s economy is produced outside the capital, and the companies there have a brand argument that is hard to copy: the place they come from. In the INOVEO archive, 45% of clients [...]

Read More... from Scrie cod curat

Read the post

INOVEO
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.