Appium coding guidelines/best practice

Friends,
I’m still learning Appium, so sorry if this is a trivial question. When i develop a test case for a hybrid app, do i need to code based on the rendered content or should i build it based on the original app technology (Ex: Sencha). What is the best industry practice? Few of the folks i consulted tell me not to go by the rendered content since the component’s id or class might change and i should code considering the original app code.

Please suggest