How often do you use livetemplates? I am a new android dev with ADHD and just discovered live templ...
e
How often do you use livetemplates? I am a new android dev with ADHD and just discovered live templates. They make my life much easier, for example I have shortcuts for generating recyclerview adapter/viewholder/implementation boilerplate code. In that way I am able to focus on implementation, and do my coding like building blocks, rather than memorizing every detail of implementation. Also I don't need to go to stackoverflow and copypaste basic things multiple times. Even for example during live coding interview having livetemplates seems awesome, copypasting from stackoverflow would be shameful (I think). Using my own custom shortcuts for livetemplates seems the best way for how my brain functions (I suck at memorizing tiny details, but I remember general idea/flow of a pattern and I would prefer memorizing what to use and when to use, instead of all small details of implementation). Is getting to dependent on livetemplates a good practice to get used to? Do other developers frown upon a dev who has dozens of livetemplates and relies on them instead of writing all code from memory by hand?
😶 2
a
From my experience, no one memorizes everything and using live templates is a great practice and the smart way. I love it and use it all the time. Also, You can go the extra mile and use generators to create files for example when creating a new Fragment along with its ViewModel and their boilerplate.
e
can you send me some example on how to use these generators in live action?
z
It’s great to hear that live templates are helping you out! I can’t see any reason why you shouldn’t use them, and I think any developer who sees you use them frequently to boost your productivity will be amazed rather than frown on it. If you want to generate even larger things, templating tools like Cookiecutter might be useful (note that this is just one specific example of such a tool that I’ve used in personal projects before). For example, here’s a repo that contains a Cookiecutter template that generates an Android project. Tools like this are usually not IDE and Android aware like live templates are, they just create new files and do simple text-substitution, but that can work for a lot of different things around an Android project.