We have been taught a lot of uses of よう pattern like ように, Vます ように, sentence ending with ように, ようだ for comparison, etc. But everywhere in textbooks, the よう is written in hiragana. I recently found out that よう actually has a kanji 様. On checking jisho.org, I found that
1: (Usually written using kana alone) (usu. after the -masu stem of a verb) appearing ...; looking ...;
2: (usu. after the -masu stem of a verb) way to ...; method of ...ing;
3: (usu. after a noun) form; style; design;
4: (usu. after a noun) like; similar to; (Noun) thing (thought or spoken)
So according to them, the only time it is written in hiragana is when よう follows the ます形. However my (non-native) teacher says it is always written in hiragana when it is used as a grammar pattern. As a result, I am pretty much confused how it is written.
I have read istrasci's answer to the question When should I replace kanji with hiragana, where he mentions that when writing elementary books, kanjis are often intentionally written in hiragana, since children can't recognize them that easily. Is this a possible reason why よう is written in hiragana or is よう really written always in hiragana when using as grammar pattern? If it is at all written in kanji, how to distinguish those cases?
On a side note, many words are written specifically in hiragana when used for grammatical purposes. In such cases, what impression do I give to the reader if I write those words (unknowingly) in kanji?