Hacker News new | ask | show | jobs
by jsonscripter 6149 days ago
If you need to type the same thing over and over, something's usually wrong with what you're doing...
2 comments

Yeah, you're not using a framework.
When defining a class you need to: - Create a new file for the class. - Type the class keyword - Type the class name. - Type the parent class name. - Type the constructor definition. - Type a call to the parent class's constructor.

This is all boilerplate and can easily take half a minute. How am I doing things wrong? Are you saying there's an easier way?

Or I can just type something like "./script/generate class Foo Bar" and be done with it and save like 15 seconds.

Yeah, that's actually a pretty odd way of doing things. In perl with moose (or just perl6) you just type 'class Foo Bar' in your file and you're good to go.