555 karma · joined February 25, 2018
If you're in the tech startup bubble it's easy to come to the conclusion that Python, Ruby and an assortment of minority interest languages with rabidly toxic fanbases rule the roost, but outside of that bubble PHP, C# and Java are quietly running the world.
Yet the namespace becomes more polluted and the interconnections between the functions becomes more complicated, particularly during debugging.
It's important to remember that "break big things into smaller things" only pushes complexity someone else rather than eliminating it altogether, while simultaneously increasing the overall complexity of the system by increasing the number of interconnections between the parts. That doesn't mean you shouldn't do it but you should be honest about the consequences.
Libraries are infinitely preferable to frameworks if you want your application's life cycle to be independent of $POPULAR_FRAMEWORK's.
Even with Laravel, which is the current thing in the PHP world, I've worked in multiple teams where their application is written in a very old version of Laravel and there's no desire to attempt an upgrade to the most recent version.
Since then, she's been a dead woman walking.
Your premise is slightly flawed in that your second example isn't actually difficult to write or understand as you claim. However, it could be argued that if the logic for selecting "loading" rows is repeated in multiple places then a layer of abstraction over it would be useful. This could be achieved in SQL by e.g.
CREATE VIEW loading_entries AS
SELECT * FROM data_journal
WHERE started_loading_at IS NOT NULL AND finished_loading_at IS NULL
or, if you have several such statuses you need to define, CREATE VIEW data_journal_view AS
SELECT
data_journal.*,
CASE
WHEN started_loading_at IS NOT NULL AND
finished_loading_at IS NULL THEN 'Loading'
WHEN ... THEN ...
ELSE 'Some other status'
END AS status
FROM data_journalI used to work at an brokerage that worked with a panel of around 12 providers, all of whom offered 5+ products that were updated multiple times per year to meet changing regulatory requirements. When a sales adviser recommended product X from provider Y to a customer, the adviser would then need to fill in an application form that was precisely tailored to that particular revision of that particular product. Bear in mind that these were complex, multi-sectioned forms. Needless to say, this created a huge workload for the devteam to keep track of all the product changes and update the UI accordingly each time.
At some point, someone on the devteam had the genius idea to simply take the PDF application forms from the provider, extract the individual pages as PNGs and overlay HTML form elements on top of them. The provider would essentially be doing our UI design for us. Add in an editor tool so the sales managers could set up the forms themselves and a tagging system so specific fields could be pre-filled from customer data we already had stored in the DB and the devteam's workload dropped by maybe 90%. Simple, stupid perhaps, but effective.
Take Squid Game for example. I don't speak Korean and know next to nothing about Korean society, yet its core story about a group of people in desperate circumstances being forced to constantly reevaluate what they're willing to do to survive resonates with me just as well as if the show had been set in any other country.
Compare that with The Rings of Power, where Galadriel is portrayed as a perfect warrior woman whose biggest source of antagonism is the weak and unprincipled men around her. Or She-Hulk, who has to explain to Bruce Banner that men telling her how to do her job makes her a better Hulk than him.
Young progressives lap this stuff up but it leaves everyone else cold, including many women. In years to come, these stories are not going to be loved. These films and TV shows are not going to top any polls. The characters are rotten, unlikable and will not live on in anyone's hearts.
At my current job, the "admin UI" is rolled into the same CRM we present to our customers, and often takes the form of e.g. additional panels on customer-facing pages that are only visible to admin users. In my opinion, this design was a mistake because it means we have to go to considerable lengths to make internal tools visually polished, despite them often being used by just one or two users who (a) work for us and therefore don't need any polish and (b) we can directly brief on how to perform a particular task.
At a previous job, the customer-facing CRM was as polished as you'd like but the admin tools were kept separate and, as a kind of informal company policy, were often deliberately designed to be _brutally_ simple. Black text on white background, no CSS, no Javascript except maybe for a JQuery plugin thrown onto a table to make it sortable. In some cases where we felt it was justified, we'd even just dump JSON onto a page and train the operator to CTRL+F to find the field they were interested in. Admin tools that were used by more users would receive slightly more effort, but the whole point was to keep these tools as simple and unpolished as they could possibly be while still being functional so the bulk of the devteam's time could be spent on customer-facing code. While this was an extreme contrast to my current job, I nevertheless find this approach a better use of the devteam's time. And as a bonus, it meant the friction to putting together a new admin app was much lower. If one or two of the admin users felt that they were being slowed down by an awkward workflow, it was entirely uncontroversial for the devs to throw together a quick microapp just for those users. If we'd had to do it by putting together an API with a React frontend and everything that goes along with that, we probably would have rejected most of those requests.
One approach would be to have a billing_period (account_id, billing_rate_id, start_date, end_date) table. Another would be to store the billing_rate_id in your account_credit table so each usage can be tied to the billing rate the customer should be charged for it.
I also wouldn't keep a running_balance column. I forget which rule of normalisation it is because it's been so long, but you shouldn't normally store a value that you can compute from other data.
Over the past nearly three decades I've learned and used many programming languages, frameworks, tools and development methodologies, most of which have turned out to be here-today, gone-tomorrow. But the 6 month SQL course I took when I was 18 is still paying my bills to this day, and probably will continue to do so until I retire.
While you technically can write a Python program in Microsoft's terrible terminal window, such a program is a very distant second class citizen in the Windows ecosystem. This adds to the friction the poster above is referring to.
In future, remember that you're on Hacker News, not Reddit. If you can't be civil to people who ask you to clarify your points then perhaps this isn't the site for you.