HN user

izackp

21 karma
Posts1
Comments23
View on HN

Hi, I've been making iOS apps for over 10 years now. I've experimented with many different styles, and even started doing android and web development. One thing I learned is that every abstraction or indirection makes things slightly harder to read and debug. Observers seem to have been a solution to 'callback hell' before async was a thing. However, it's rife with pitfalls.

With Observers:

We have hidden control-flow and lost intent. They subvert the readability of the developer's intention, in some cases they make you lose the callstack, and it has you searching the project on what code modifies a variable which is a lot harder than searching for a function call. Don't get me started on dealing with handling errors and out of order events. And oh man, is it easy to just avoid using encapsulation and creating a good interface/api for your piece of code.

Most of your code isn't re-usuable as you think:

A lot of things are naturally and forever tied together. Your UI is a reflection of _some_ model, The actions it can perform is based on it's current context, and if your UI changes then your business logic and model probably changes as well. This die hard need of separation and modularity only increases the complexity of the code with the majority of times the code not even being reused.

The only case that I've found somewhat reasonable to use observers is the database. What caused the database to change and effect it has is already pretty far removed from each other when a piece of UI needs to reflect the database.

Granted, It's possible to work around some of these issues, but please please I'm tired of debugging why a menu only opens 50% of the time because there is a piece of code several classes away from the context that doesn't fire correctly and looks like if (child.preferred.child.model.somethingElse.isFinished) { child.menu.child.openMenu = true }

That's a bad illustration. The letters are there.. they're just slightly lower rez. Like going from a 256x256 space per letter to 128x128. Is there a difference? sure. Can you read it perfectly fine.. of course.

You could probably argue that these are handwritten letters but the argument still stands.

Svelte 5 Released 2 years ago

My first web project was with svelte.

Lack of a debugger for the server sided JavaScript seems just as silly to me as server sided JavaScript. I would consider that alone a non-starter.

I’d recommend another solution for experienced devs.

Games are designed to be addictive, so once you stop its like quitting soda.. eventually you lose the taste for it.

Though, I noticed a lot of satisfaction from my life comes from interactions with others. Games no longer encourage quality interaction like they used to. Your friends get older then get married and get busy, so theres less of that. I usually analyze a game and decide if its wasting my time or improving my time on this earth.

Then there are the single player games. I feel like these had more meaning when the market wasn't as saturated. A lot of times you're just chasing nostalgia from that one really good game you've played. Hoping to recapture the same feeling. Not only that, most aaa games now days are now products of money instead of passion.

So if I had to guess why anyone stopped it's probably one of the reasons above.

Swift has some of the simplest code for what it’s trying to accomplish. Any complexity is opt-in.

Error handling is great and works well with async. Protocols and enums are amazing. It’s keeping up with new patterns and techniques such as implementing move semantics and actors. As well as c and c++ interop, and so on.

Support is coming for other OSs.

Kotlin constantly clashes with java. It almost feels like typescript + JavaScript.

Rust doesn’t allow for shared mutability making common/simple patterns for making apps much more difficult. I like rust but it has its own place.

I too have the same sentiment.

I realize though there are not many frameworks for cross platform development. If you do want a native language you'll probably have to use QT. There are more out there, but most are based on native widgets which have their own unique behavior which makes them difficult to abstract.

It seems to me that these electron web apps provide this 'leak free' abstraction.

NYC Slice 4 years ago

They raised the price and added more pepperoni (less cheese). :(

It doesn't have to be a mental burden.. Just write all your variables as mutable then let the ide automatically correct them to immutable. Ex: "Warning: This variable is never mutated. Would like to make it a const? <Fix>"

Let's say it is a mental burden. I'd rather have the burden when writing the code over when reading the code. (https://news.ycombinator.com/item?id=31823991)

I would definitely prefer swift's 'var' or JavaScript's 'const' here.

The solution in the link adds to cognitive complexity. Imagine you had bad code (Worst case scenario; which always happens). A function with 400+ lines of code. You would have to scan the entire function just to figure out if a variable is mutable then you would have to force yourself to remember _all_ the variables that are mutable when evaluating behavior.

* Cleaning

* Exercise (Mountain Climbing; Basketball; Kayaking)

* Learn things

- - to dance (Bachata/Salsa)

- - a new language

- - an instrument

* Hobby groups on Facebook

- - Meet randos to play boardgames

* Make things

* Help people

The biggest problem with me is being social. That's what people want to do around the weekends. The dance classes allow me to interact with people in a less awkward way, but it hasn't exactly provided me with as much opportunities as drinking at a brewery to meet people..