2,515 karma · joined Mar 4, 2010 (16y ago) · 549 submissions
meet.hn/city/43.1009031,-75.2326641/City-of-Utica
---
comment 3y ago · link · parent
If back-end provides the entirety of data to build the page, then you limit front-end decisions to UX based on the specific data, and no longer allow them to pull in new functionality or foundational business logic over to their side.
comment 3y ago · link · parent
In practice, a complete redesign is an incredibly rare event, and a good problem to have. Usually design of individual pages and layouts undergoes gradual, incremental changes, driven by real needs.
A redesign that requires front-end restructuring to such an extent that the data supplied is no longer sufficient should probably involve backend collaboration. Otherwise, you're tasking your backend team with building a generic site builder, which is much harder than a specific backend for your frontend.
comment 3y ago · link · parent
comment 3y ago · link · parent
Primarily, this philosophy encourages you to maintain a strict connection between needed use cases, and the code that enables them. Once that connection is severed, your code expands beyond the required use cases, and you end having to maintain support for phantom/theoretical use cases.
comment 3y ago · link · parent
The way I've been describing this lately — the json structure should come from you squinting at the page and seeing approximately what needs to be on it, and creating as-flat-as-possible way of sending it over, that makes it clear enough what each field is for, but not so granular as to be automatable.
If you have a designer in your company, I've been increasingly preferring to use their terminology to name fields. If page has "cards", "navigations", "banners" whatever designer calls them, call them the same way in JSON. This is a good middle ground. It makes sure that back-end passes what front-end needs, while at the same time making sure that front-end doesn't get the wrong idea that their framework can dictate and accept this json structure directly.
So if a full JSON-based language would allow you to customize every page element in any way you like, this approach only lets you to send over decisions about this page, using a json payload specifically for this page and the ways it can change, no more no less. You cannot add an arbitrary box or an arbitrary section in json, and expect it to appear.
comment 3y ago · link · parent
This is called server-driven UI, and not what the article is advocating. I try to make that distinction by calling the whole practice server-informed UI, rather than server-driven UI. The article is meant to be advocating almost exactly what you wrote in the 3rd paragraph.
comment 3y ago · link · parent
If you think about functions or object constructors in general, it kind of makes sense. One of the most important architectural practices I've ever discovered is: don't pass in the parameters that you have, pass in the parameters that the function needs. So if you have companyName, and you are constructing a page that has a title, you shouldn't pass it companyName: companyName, you should pass it pageTitle: companyName (parameter name: parameter value). It's crucial that the parameter is named after what is needed, not what you have. This is kind of the essence of what the article is suggesting.
If your front-end is reusing a lot of fields from back-end, it's likely that you're passing it what you have in your database/resources, and not what it needs — fields for constructing the UI, configuring the views. Moreover, I rarely see front-end going through the exercise of defining exactly what they need. The article encourages more of that.
Once the front-end starts reusing the generic back-end fields everywhere, you lose track of your use-cases. Everything you ship from the back-end becomes potentially important for mysterious reasons that not even front-end can easily understand anymore. Front-end already built complex dependency trees based on these generic fields. If you actually untangle these trees, it might turn out that your front-end can only exist in 5 different "modes", but you can no longer see that in the tangled mess. You can no longer streamline and optimize these 5 configurations.
So to summarize: pass what is needed, not what you have is a good general architectural rule that's also applicable between back-end and front-end.
comment 3y ago · link · parent
We do this for SPA. The POST can be supported just like you explained. Then you can either reload the "page" to see that the checkbox is checked, because backend will include that as part of the page, or (as an optimization) reload just that checkbox if you created a specialized resource for it. The entire page is still there for you to fetch upon transitions.
Among pages, you will still need a few individualized resources sprinkled around for optimizations/reloads/fragment-paginations. The difference between that and a complete API is that they will be entirely design driven. If a table needs paginating, and is built with data from multiple resources, you will not provide 2 resources, and expect front-end to paginate and glue them together. Instead, you provide a complete paginated resource for this table, where data is ready to be displayed as-is.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
1. An odd business requirement (share the origin story)
2. It took research (summarize with links)
3. Multiple options were considered (justify decision)
4. Question in a code review (answer in a comment)
And the article on how/what/why in code: https://max.engineer/maintainable-code
comment 3y ago · link · parent
Hosted by amazingly convenient https://blot.im.
Articles on software architecture. I'm also looking to make new friends to discuss these topics. Working remotely in my 30s from a not-major-city makes this difficult. In my blog there's a place to leave your email if you'd be up for it.
409.
Adventures in Ruby-esque type enforcement(max.engineer ↗)
2 points · by hakunin · 3y ago · 2 comments
comment 3y ago · link · parent
This time I used VSCode for nearly 2 months. Thought it's the end of an era, I'm not coming back to Sublime Text. I decided to push through and customize the configs just right for me, it was really becoming comfortable. Main reason why I wanted to switch is more active dev, more active extension community, and well integrated modern (some ML-backed) code writing and navigation tools.
I was wrong. After all the painstaking customization to bring it close to my ideal experience, while also getting used to things I didn't want to fight, I still had a bad time.
For one, the tab/cursor focus keeps going into weird places. I press a button, like ESC to switch to normal vim mode, and instead it does nothing, or something different, because turns out I'm not in the editor anymore. Keeps happening, maybe my own fault. The nifty AI tools integration is more of a nuisance — they jump in at bad times (with a delay), and their tab/enter functionality is weird, can never get it right. Most of my autocompletes have been unintentional. Maybe my own fault again, but felt super awkward. There is still no good vertical align plugin, despite such an active community (Sublime doesn't have one either, although they have one that gets me a bit closer). The language server stuff that worked badly in Sublime for my language also works badly in VSCode. The extensions, while numerous, are of questionable quality. I tried to stick to just a few well known ones.
After all the effort, I slowly came to realization that I'm back to not really using anything unique to VSCode, sacrificing more than I gained, being surrounded by lots of small moving details everywhere in the UI that make my experience more awkward than helpful, and occasionally getting my cursor stuck in weird parts of UI. I went back to Sublime.
411.
Smart home company Eve bought by multibillion-dollar automation giant ABB(9to5mac.com ↗)
4 points · by hakunin · 3y ago · discuss
comment 3y ago · link · parent
comment 3y ago · link · parent
It's true, but I'm not sure that it's good. That's going back to salary being weird. They are making themselves deliberately inflexible, locking themselves out of potentially good agreements (probably in response to public pressure). Perhaps big names can get away with it. Worth noting that the same "bands" probably don't apply to hiring consulting businesses. Ask yourself why, and how's that different from striking a deal with an individual.
> Companies already know how much they want to pay you
That's not true. They don't know how much they want to pay _you_. They know how much they want to pay an average abstract employee doing the job they vaguely envision in a satisfactory manner. Then when the actual _you_ come in, that abstract employee becomes a concrete advocate for themselves. They'll have to think about you specifically now, and it changes the whole calculus.
comment 3y ago · link · parent
What does it mean to be negotiated “fairly”? If you don’t like the rate, you come with a counter proposal, for which ideally you have leverage. The leverage is another job offer you found. If you don’t have leverage, you could negotiate a few other ways but they’re less effective. In the end, if you feel you can’t get a competing offer and you can’t wait, essentially you have to accept the terms, but also you can continue the search, and quit when you find something better. This is why companies don’t like to lowball you - they don’t want you to come in with one foot out the door. So one of those “less effective” ways is to explain honestly how their offer might not be sufficient for you to be able to focus on your work without worrying about rent and food. It’s in the best interest of both of you for you to focus on work.
comment 3y ago · link · parent
To add: it's already difficult for a dealer to overcharge because even for complex/unique products we do have stats.
I just don't like the circular dependency of it. Companies follow an industry-wide stat to push all the people into preset salary tiers. The industry-wide stat is based on these same companies. The only way out is when some "rogue" companies allow some "rogue" employees to negotiate, and push the industry upwards.
comment 3y ago · link · parent
comment 3y ago · link · parent
I find salary to be really weird for many reasons. One of them is that I just can't imagine a sustainable world where salary is proactively offered, raised, etc. I think it necessarily must be negotiated. I say this as a person who spent most of my 20y career negotiating for my salary and hating the process.
It feels attractive on the surface to see a concrete number, kind of like coming to a car website and seeing cars sold at a fixed price, no bargaining. Or kind of like searching for loan refinancing and seeing a bank website show you the standard menu of rates they offer. You just pick from the menu.
However, the issue is that you're probably overpaying for the car, and getting a bad refinance rate every time. And your blanket "salary tier" is probably some safe hedge for the worth you may or may not be bringing. An estimation of vague plans they might have on where you may help.
Shouldn't this be reversed? Shouldn't it be you to tell them what you can do, the plans, explain how much you're worth? How can they know your salary if you haven't told them this stuff yet? Aren't you supposed to be an expert at something? That's just one of a few weirdnesses about salary.
Maybe it depends on a job, and some jobs are really _that_ predictable, but feels like in software dev industry it doesn't add up, except maybe for junior positions.
I used to be in the opposite camp, but nowadays every time I see a concrete salary range listed, it makes me feel silly. We all know that humans running the place can probably decide to pay whatever they want based on how they feel. I can't imagine a situation where they go "sorry, we really think we need you, but our job listing only goes up to this number, oops".
419.
Adventures in Ruby-esque type enforcement(max.engineer ↗)
2 points · by hakunin · 3y ago · discuss
420.
Adventures in Ruby-esque type enforcement(max.engineer ↗)
4 points · by hakunin · 3y ago · discuss