Johnnyboy
Firstly, well done for handling an unusual event early in your flying days.
A "dodgy" alternator leading to electrical failure is possible on any light aircraft so equipped. An electrical component has a mean time between failure, in other words on average will fail after XXXX hours.
But there are early failures and late failures and so this can be encountered unexpectedly.
Maintenance standards also impact on the reliability of a fleet and the older an aircraft the more maintenance tends to be required.
On the advice of AOPA, I changed flying schools because I was unhapppy with the maintenance standards of a school (unsecured brake lines and fuel leaks amongst them), but I wouldn't regard Cessna's (the fleet in question) as being unreliable, it was the (poor) quality of the maintenance operation.
So rather than think about aircraft as cars (i.e. look at the J D Power survey for reliability), I suggest you may wish to consider taking a broader view.
You will probably come to the conclusion that you were the victim of a statistically improbable, but predictable event and take comfort in the training that prepared you to recognize and manage an electrical failure.
Good luck with the rest of your course.