Monthly Archives: June 2016

Why don’t more programmers use regular expressions?


Why don't more programmers use regular expressions? by Jonathan Neve

Answer by Jonathan Neve:

I happen to enjoy regular expressions immensely. So immensely, that in my more rational moments, I feel the need to moderate my enthusiasm by warning people that they actually can't (or at least shouldn't) be used for everything.

The truth of the matter is anything that can be done without a regex probably should be. Of course, I don't mean that literally (since technically, there's nothing that can't be written without a regex), but some problems really lend themselves to regexes, whereas most don't.

In cases that can be solved simply without a regex, the plain solution will most of the time be:

  • Faster to write
  • Faster to debug
  • Faster to run

So again, much as I enjoy using regexes, and perhaps in fact because I enjoy using them so much, I need to hold myself back from using them everywhere. There are times when regexes absolutely shine, such as:

  • Scripts/throw-away/"write-only" code
    Write fast and don't worry about maintaining it
  • One-off search or search and replace
    If you need to grep the list of running processes to find and kill any process matching a certain pattern or started after a certain time, you can do it much faster and easier with a little one-liner involving a simple regex than you could any other way.
  • Very complex text manipulation
    Sometimes, runtime performance doesn't matter much, but using regexes can save a considerable amount of time by avoiding the need to write an all-out, full-blown parser.

    For example, I recently wrote a little Perl script to convert code written in Borland C++Builder to Delphi. This is made possible by the fact that both environments share the same standard libraries, so it's "just" a matter of converting the C++ to Object Pascal. In about 1000 lines of code, most of it regexes, I actually got it to work up to about 95% (100% would probably not be possible). It only took me a few months, no idea how I could have done that without regular expressions.

So in conclusion, I would say that regular expressions are a wonderful and highly addictive tool that should be added to the arsenal of every programmer, yet we must resist the urge to forget all the other unromantic, boring (and, sadly, often better) ways we have of doing simple things.

It should also be noted that the extended notation (/x, also known as the kill-joy option*) allows for turning cryptic regular expressions into readable chunks of code with whitespace and comments, and it might help break the elitism of the regex-writer-band if we were to use this option to make regexes that are intelligible to an actual human. Yeah, it spoils some of the fun, I know, but still… 🙂

In case you're thinking I'm exaggerating the quasi-cultishness/elitism of regex users, what do you think it shows that one of the most popular ressources online for help with regexes and Perl in general is called The Monastery Gates

*Not really, but that's how it can feel at times…

Why don't more programmers use regular expressions?



Everything I Never Told You


I am less than.
My insignificance a common thing.
I’m a particle of dust but even I
sparkle in certain light.
At night I float around pages
filled with words that
no one will remember.
I sing a melancholy tune.
Bare and ruined.
I pray to the God of dust bunnies,
who is adored or loathed by all
the other particles.

Everyday we lift up our dusty eyes
to the ceiling, hoping for a skylight
to reveal the heavens. All the while
awaiting our death sentence by rag.
Resigned to our fate we conversed
with the ashes and await our downfall.

-Tosha Michelle

View original post

La Top 10 del “gruppo mamme” della scuola elementare

La Top 10 del “gruppo mamme” della scuola elementare

Back to the Blog

Conclusi 5 anni di (folle ed immotivata) esperienza da unico genitore maschio privo di cariche istituzionali nel “gruppo mamme” su WhatsApp della scuola elementare di mia figlia, – benchè partecipante sostanzialmente passivo -, posso finalmente fare un bilancio di questa esperienza traumatica, ma a tratti divertente, ed estrarre una “top ten” degli episodi maggiormente significativi, nella quale credo che molti di voi si riconosceranno.

– 10 –
Buongiorno! Buon pranzo! Cosa state cucinando? Buonanotte!

Il gruppo mamme è prima di tutto un gruppo sociale, costituito da persone che utilizzano whatsapp felici come antilopi cresciute in cattività che improvvisamente si catapultano in una vita allo stato brado. Così, 20 e più mamme iniziano con entusiasmo al primo anno a darsi il buongiorno al risveglio e la buonanotte alla sera, coscienti che – se dovessero mai dimenticare il telefono da qualche parte per una buona mezza giornata -, troverebbero in ogni caso almeno 300 notifiche di messaggi. Molte delle…

View original post 2,305 more words

Why did Ahmed Aly leave Google and go to HackerRank?


Why did Ahmed Aly leave Google and go to HackerRank? by @ahmed_aly_tc

Answer by Ahmed Aly:

When I decided to leave Google, it wasn't because I'm not happy at Google or because Google isn't a good place for work. I was very happy at Google, and I do recommend it to anyone. I did that because I really wanted to join HackerRank, I'm very passionate about the programming competitions field, I've been doing it for years. Few years ago, I started my own website for programming competitions, it's called A2 Online Judge ( So being part of HackerRank which is doing exactly what I love, is the best place for me.

More details here: Google lost one of its top employees to a startup that's like Fight Club for programmers

Why did Ahmed Aly leave Google and go to HackerRank?

What can I learn right now in just 10 minutes that could be useful for the rest of my programming career?


What can I learn right now in just 10 minutes that could be useful for the rest of my programming ca… by Ken Mazaika

Answer by Ken Mazaika:

Learn to open 10 tabs.

Seriously. Tabs have a bad reputation, but once I started opening 10 of them, I began to take off as a programmer. There’s a reason why this one small trick is so significant to the growth of your career.

And it takes less than 10 minutes to learn.

In programming, you’re going to run into problems, error messages, and situations in which your program isn’t doing what you think it should be doing. How you react to these scenarios is the difference between being a beginner programmer and an experienced one. How so?

  • Experienced programmers immediately acknowledge what they don’t know and set out to find the answers.
  • Beginner programmers don’t understand that they have to begin looking for answers in the first place.

The biggest hurdle that beginner programmers need to clear is the mentality that they should know everything. They tend to think like this:

“I don’t know, and I feel stupid because of it.”

You’re not supposed to know the answer to every problem. Over time, you realize that everything is figure-outable. You learn that you need to be able to self-correct and teach yourself new concepts on the fly. It’s just really tough to start making this transition.

The easiest way to begin leveling up as a programmer is to start opening 10 tabs.

I call this the 10-Tab Rule. It’s a simple 3-step process that teaches you how to think like an experienced programmer.

Step 1: When problems arise, articulate the problem in a well thought-out search query.

Step 2: Search it using Google and open each of the top 10 results in new tabs.

Step 3: Read or skim each of the tabs, then return to your code.

This simple routine, which takes less than 10 minutes to learn, pushes you to solve problems in a new way. It changes the negative mentality that you’re used to having as a beginner into something more positive:

“I don’t know, let’s figure this out as quickly as possible.”

This is a subtle switch, but it’s important. And as it turns out, with Google, the answers to nearly all of your questions are at the touch of your fingertips.

That’s not to say that Google’s homepage will answer your question. Instead, a huge part of becoming a better developer is figuring out how to write an effective 20-50 character description of your problem. That’s not a lot of room to communicate what’s wrong. But doing so repeatedly helps you make a gigantic leap as a programmer.

Using search to find the answers to your problems forces you to fully understand your problems.

This is precisely why opening 10 tabs is so important to your growth as a programmer. It’s not the simple act of opening the tabs. Instead, it’s what that routine makes you do. It forces you to get into the habit of:

  • Identifying your problems
  • Expressing them clearly
  • Figuring them out using the resources at your disposal.

So start opening 10 tabs. It’s something that you can start doing right now (in about 10 minutes) that will help you for the rest of your career.

If you liked this post, I’d really appreciate it if you upvoted it clicking the light blue button below.

What can I learn right now in just 10 minutes that could be useful for the rest of my programming career?

Chi è un responsabile ufficio stampa? Intervista a Lorenzo Foti


Social media blonde

All’interno del mio percorso universitario, ho avuto la possibilità di accedere a un laboratorio di giornalismo e ufficio stampa tenuto da un docente del mio corso. E’ stato interessante ritrovare nella teoria molte delle pratiche che ho svolto quotidianamente per lavoro. E’ proprio vero che non si finisce mai di imparare e questo vale soprattutto per il  mondo della comunicazione, delle agenzie stampa, degli uffici stampa e delle PR. Un mondo che è in continua e inarrestabile espansione, capace di generare notizie, di osservare il loro evolvere, di farle arrivare a tutti. L’ufficio stampa ha questo potere: creare, convogliare, veicolare, pubblicare e veder pubblicare dei contenuti che siano parte coerente di un insieme, di un ente, di un’azienda, di una linea politica o strategica. E’ una struttura che corre veloce tanto quanto l’attualità e la cronaca, la politica e l’economia, il business e il marketing e – soprattutto – è…

View original post 814 more words