Articles in category: OOP

Alessandro Lai Alessandro Lai avatar

11 minute read

A few days ago I stumbled on a strange tweet that was highlighting a controversy about scalar type hints. Scalar type hints & return types vs no scalar type hints & return types is #PHP's new spaces vs tabs — Cees-Jan ūüĒä Kiewiet (@WyriHaximus) 19 maggio 2017 After asking references about this, someone alluded to this very short video: “PHP Bits: Visual Debt” (it’s only 3 minutes, please watch it before continue reading).

Elviro Rocca Elviro Rocca avatar

10 minute read

Maintaining state is the main cause of complexity and headaches in software development: without a careful consideration of state, our projects will inevitably become impossible to understand. In fact, various development techniques and programming styles are mainly there to handle state in a responsible way: for example, monads, as used in functional programming, are often employed for this very task. A good general way of managing state is trying to make it immutable, either through the use value types, that is, types which instances are passed around with deep copy semantics, or simple immutable objects, which have reference semantics but because they’re immutable their state is fixed.

No Country For If Else

Questo articolo è disponibile anche in italiano

Elviro Rocca Elviro Rocca avatar

21 minute read

There is an unwanted guest with us as we write code and build software projects: it’s the code that’s already written, and we must take into account its complexity as the code base increases in size. High complexity of the existing code can make the following activities particularly difficult: understanding the meaning of old code, written by others or ourselves; tracing the causes of bugs, i.e. errors, in code; making changes to a certain procedure; adding features to existing structures; Even if we approach the development of new software with agile methodologies, we always have to deal with the existing code, and to do that we must at least be able to understand it without overexertion.

No Country For If Else

This article is also available in english

Elviro Rocca Elviro Rocca avatar

21 minute read

C’√® un ospite indesiderato che ci accompagna sempre mentre scriviamo codice e realizziamo progetti software: si tratta del codice gi√† esistente, e dobbiamo tener conto della sua complessit√† man mano che la code base aumenta di dimensioni. Un’elevata complessit√† del codice pu√≤ rendere le seguenti attivit√† particolarmente difficili: comprendere il significato di codice vecchio, scritto da altri o da se stessi; tracciare le cause di bug, cio√® errori, nel codice; eseguire modifiche a una certa procedura; aggiungere funzionalit√† a strutture gi√† esistenti; Anche approcciando lo sviluppo di nuovo software con metodologie agili, dobbiamo comunque fare i conti con il codice esistente, e per farlo dobbiamo almeno essere in grado di comprenderlo senza sforzi eccessivi.