As a PhD dropout (computer science) who knew a lot of other PhD dropouts, my advice to anyone who thinks they want to do a PhD is to first have a very clear idea of why you want to do it. If you don't have that to motivate you, it's not likely that you'll make it through all those years of hard work, frustration, poverty and abuse.
Especially in computer science, there are lots of opportunities to work on cool stuff without spending several years of your life to get a PhD.