Skip to main content

AngularJS

Sain tehtäväksi tehdä käyttöliittymän tabletille. Valitsimme toteutukseksi AngularJS kirjaston. Se on saanut ristiriitaisen arvion, ainakin mikäli lukee keskustelupalstoja.[1] Tilastojen mukaan sen käyttö on kuitenkin lisääntynyt tasaisesti. [2]

Vaikka olin tehnyt pienempiä kokeiluja Angularilla jo ennenkin, ensimmäisenä lähdin etsimään hyvää guideline miten Angularilla tehdään hyvää koodia. Yksi suositumpia guidelineja on John Papan, josta löytyy jopa oma kurssi Pluralsightista. Päätin ottaa sen käyttöön. Huomioitavaa siinä on mm. controllerAs tyylin käyttäminen sekä kaiken ylimääräisen (mm. taustapalvelukutsujen) siirtäminen pois controllereista.

Käytin myös jonkin verran directivejä. Directiveillä voi tehdä DOM puusta helpommin luettavaa semanttisessa mielessä. Huomioita piti kiinnittää siihen, että nämä toimivat kontekstista riippumatta jos käyttää useita templateja.

AngularJS sanotaan myös verrattain hitaaksi johtuen clienttipuolen HTML templatejen parsimisesta ja digest syklistä. Se varmaan pitääkin paikkansa johonkin toiseen frameworkiin verrattuna (ReactJS?). Toisaalta se että siitä tulisi merkityksellistä vaatii melko suositun ja monipuolisen webbiapplikaation. Varmasti joillakin vanhemmilla puhelimilla tai tableteilla voi olla joitakin ongelmia mutta vaikeaa nähdä todellista ongelmaa itse frameworkissa. Itse en ainakaan muutaman vuoden vanhalla tabletilla havainnut mitään ongelmia tämän suhteen.

Keskusteluissa usein puhutaan uudesta 2.0 versiosta. Ihmetystä on joissakin herättänyt se miten suuria muutoksia frameworkiin on tulossa. Mielestäni major version ei pidäkään olla taaksepäin yhteensopiva. Otan vastaan mielenkiinnolla perustavaa laatua olevat muutokset kuten controllereiden poistaminen ja komponentit

Edit 23.9

Hyvä postaus AngularJS ongelmista http://www.leanpanda.com/blog/2015/09/20/our-criticisms-of-angularjs/

[1] https://www.reddit.com/r/webdev/comments/2qvi6a/eli5_what_is_the_controversy_around_angularjs_and/
[2] http://w3techs.com/technologies/details/js-angularjs/all/all

Comments

Popular posts from this blog

Bird is causing high CPU on my macOS

There is no lack of people complaining about MacOS Tahoe, mostly about rounded corners and inconsistent design decisions. I have not paid that much attentention to that, but there is one mac bug i have paid attention to. It hasn't been a visual or ux but rather few system processes pegging the CPU. trustd , alongside with ecosystemd and ecosystemanalyticsd all reported high CPU usage. I can't exactly recall when this started, it might have predated my Tahoe upgrade but anyway, the trio of processes all had high CPU usage. Sure, it may have been the virtual efficiency cores and whether it affeced battery life or slowed down other processes i don't know to be hon...

How my work has changed in the past few years

When I started at my current job 3ish years ago, we had nothing but a few PowerPoint slides and a Figma prototype. I recall talking with one of the founders, whom I had worked with some 10 years ago, and pointing out that the very next step after PowerPoint and Figma was still the same as it had always been: translating those slides and mockups into CRUDs, forms, and other basic building blocks. Sure, all the new fancy tools and frameworks (we had jQuery then) help, but I still had to tinker with very basic primitives like tables and forms. I could not just say, "here is a table, here is a form." Well, yes, technically I could, but I still needed to write a lot of code to make a working form or table. This was around the time of GPT-3, Copilot beta, and very early Cursor. I did attempt to use them, but they could only perform very basic tasks and were pretty much useless for frontend work. We, being one of the first-wave "ChatGPT wrapper" startups has naturally pus...

Building a OTel sink that follows GenAI semantic conventions

I've been working on an OTel sink recently. To be more specific, it concerns receiving telemetry data from LLM interactions. Fortunately, there is a spec for all of this called GenAI Semantic Conventions . That is what I based my work on, so I can make assumptions about key attributes to highlight in the sink's UI, which is actually a CLI in my case. I dogfooded my handrolled sink using Pydantic AI (my favorite LLM framework), and all good, it follows the spec well. Key attributes flow in as specified. Pydantic AI also includes some of its own attributes, but that is expected. However, pick something like Claude Code, (via anthropic agent sdk), the reality is a bit different. It does not follow the spec at all. It has its own custom attribute layout . Same direction, different flavor with LangChain. The Python source has zero opentelemetry imports anywhere. None. The ls_* namespace ( ls_provider , ls_model_name , ls_temperature ) is its own thing, with LangSmith as the on...