banner
loongphy

loongphy

所有苦难皆成过往,我们甘福将至
twitter

Weekly Report #7: Ear Injury and Torment by uni-app

Summer breeze is back again.

It's been a month and a half since I last wrote the weekly report. Life has finally returned to normal, and the desire to share has returned. As for the reason, it may appear in the first monthly report.

This week has been quite difficult. I've been feeling unwell, and I've been battling with uni-app at work.

Life#

On Tuesday, I woke up with my left ear feeling blocked, and there was a buzzing sound, not as sharp as tinnitus, and there was no improvement even after trying to clean my ears.

Since I went to the hospital frequently last month, I was too lazy to go this week, so I postponed it until the weekend. I originally made an appointment for Sunday, but on Saturday, I couldn't bear the stuffiness and continuous buzzing in my ear, so I went to the hospital. However, the registration was full, so I had to go back home. Unexpectedly, I eventually recovered.

On Sunday, when I woke up, I suddenly realized that my ear was fine! Just to be safe, I still went to the hospital, and after a simple consultation, there was no problem. The doctor said it might have healed on its own and suggested getting a hearing test on a weekday.

Maybe I'm getting older, it seems like I've had more illnesses this year. However, it could also be due to lack of sleep in the past two years.

Speaking of sleep, after a month of adjustment, my sleep this week has been good, averaging more than 8 hours a night. It feels like I'm 18 again 😭

After a long wait (being lazy), summer has finally arrived. The weather has gotten hot, and I finally mustered up the courage to start running. I've been maintaining a daily distance of 5KM recently. Thanks to the health issue with my ear this week, I gave up the habit of running with earphones. RIP LinkBuds 🥹

Running with earphones is not really suitable because there is a lot of noise when exercising, and you have to turn up the volume to hear clearly. As for noise-canceling earphones and bone conduction, the former's invasive design is not suitable for my oily ears, and wearing them for a long time may cause ear canal infections or inflammation. The latter has serious sound leakage, not to mention the sound quality, it feels like a joke.

Work#

Ah ah ah ah ah ah ah ah ah, uni-app, I could kill you a thousand times and it still wouldn't be enough!

uni-app is a framework for developing all front-end applications using Vue.js. Developers can write a set of code that can be published to iOS, Android, Web (responsive), various mini-programs (WeChat/Alipay/Baidu/Toutiao/Feishu/QQ/Kuaishou/DingTalk/Taobao), quick apps, and other platforms.

The advantage of uni-app is that you can write native apps with just front-end knowledge (I'm kidding 🤡), but the disadvantage is that you need to adapt to various systems. From my personal experience, it works fine on Android, and there are usually no major issues on iOS, but there are many problems with mini-programs.

Another big problem is that the documentation is too scattered. You have to "dig" slowly 🤡 and make good use of the built-in search system to look for answers from other developers.

This week, I'm developing a native Android plugin for an existing app. I want to give a special thanks to ChatGPT! My knowledge of Android is limited to university coursework, and during development, I could only ask ChatGPT for help with the problems I encountered. Without it, I wouldn't have been able to complete the development task.

The most annoying thing during this period was that the uni-app documentation was not clear enough. Many important points were not mentioned in the documentation, and I had to rely on blog posts online to complete the plugin development steps. This is also the biggest criticism of uni-app development. I used to browse V2EX and saw people complaining about the many bugs in uni-app, but I think it's normal. As long as you don't chase after the latest versions of Vue ecosystem and uni-app, you won't encounter many bugs. After all, I upgraded the app from Vue2 to Vue3 (hands on hips 😎).

ChatGPT#

After the hype, not many people are as enthusiastic about AI as before. I think this is a good thing. Currently, AI plays the role of a work assistant, and its strength depends entirely on the abilities of its owner: Prompt + Thinking + Iteration.

Take the development of this plugin as an example. I encountered a tricky bug where the native demo worked fine, but it didn't work on uni-app. I abstracted the key API, described the problem, and let ChatGPT help me generate black-box code based on random thoughts. Through thinking based on the code, I finally solved the problem.

Do you know about the "Rubber Duck Debugging" method?

This story describes how a programmer explains their code line by line to a rubber duck when encountering an error.

When you explain everything about the code to the rubber duck, you are more likely to discover the hidden errors.

The current ChatGPT is like a "rubber duck", but more powerful, as it can answer your questions. When faced with unfamiliar domains, it is like a teacher, although this teacher talks nonsense most of the time, it can still inspire you and help you find solutions.

One More Thing#

I can now tie my hair into a small braid 🎉

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.