Hacker News new | past | comments | ask | show | jobs | submit | darioush's comments login

another reason to not refactor is management will start out supportive of it but some weeks in they will wonder wtf their engineers are doing all day and why aren't they building the new pile of stuff they want built yesterday.

That’s not so much a reason, in my experience, as a frequent default/inertia position. In other words, I expect to start at that default, and challenge it with reasoning, in order to justify a significant refactor.

Refactoring is a terrible project plan. You never want your weekly status to be "refactored some more". Plan your other development work with enough time to refactor as you go.

The ability to ship small things is I think something really missed in discussion about microservices.

Like rather then refactoring the entire application to support a faster cache or something you can just add in another microservice that handles caching of the data.

If some way you write the services is poor you can rewrite one of the services a new way and easily evaluate if it's actually a good idea to change the rest or not.


Don't spend 100% of your time refactoring.

Global variables are a programming construct, which like other programming constructs is neither bad nor good. Except, due to the takeover of workplaces by the best practices cult, instead of reasoning about tradeoffs on a case by case basis (which is the core of coding and software engineering), we ascribe a sort of morality to programming concepts.

For example, global variables have drawbacks, but so does re-writing every function in a call-stack (that perhaps you don't control and get callbacks from).

Or if you are building a prototype, the magic of being able to access "anything from anywhere" (either via globals or context, which is effectively a global that's scoped to a callstack), increases your speed by 10x (since you don't have to change all the code to keep passing its own abstractions to itself as arguments!)

Functions with long signatures are tedious to call, create poor horizontal (which then spills over to vertical) code density. This impacts your ability to look at code and follow the logic at a glance, and perhaps spot major bugs in review. There's also fewer stuff for say copilot to fill in incorrectly, increasing your ability to use AI.

At the end, every program has global state, and use of almost every programming construct from function calls (which may stack overflow) or the modulus operator (which can cause division by zero), or sharing memory between threads (which can cause data races) requires respecting some invariants. Instead, programmers will go to lengths to avoid globals (like singletons or other made up abstractions -- all while claiming the abstractions originate in the problem domain) to represent global state, because someone on the internet said it's bad.


Depends a bit on the language.

A global variable in a language with parallel operation is often a terrible idea. The problem with globals and parallel operations is they are an inherent risk for race conditions that can have wild consequences.

In some languages, for example, a parallel write to a field is not guaranteed to be consistent. Let's assume in the above example `counter` was actually represented with 2 bytes. If two threads write an increment to it without a guard, there is no guarantee which thread will win the upper byte and which will win the lower byte. Most of the time it will be fine, but 1 in 10k there can be a bizarre counter leap (forwards or backwards) that'd be almost impossible to account for.

Now imagine this global is tucked away in a complex library somewhere and you've got an even bigger problem. Parallel calls to the library will just sometimes fail in ways that aren't easy to explain and, unfortunately, can only be fixed by the callee with a library wrapping synchronization construct. Nobody wants to do that.

All of these problems are masked by a language like Javascript. Javascript is aggressively single threaded (Everything is ran in a mutex!). Sure you can do concurrent things with callbacks/async blocks, but you can't mutate any application state from 2 threads. That makes a global variable work in most cases. It only gets tricky if you are dealing with a large amount of async while operating on the global variable.


Yes, mixing some concepts in programming is a terrible idea.

Perhaps this is also widely unpopular, but it's the parallelism that needs to be treated with care and the additional caution, as often the parallelism itself is the terrible idea.

Concurrent code often has unpredictable performance due to cache behavior and NUMA, unpredictable lock contention, and the fact that often there is no measure of whether the bottleneck is CPU or I/O.

What most people want from concurrency (like computing the response to independent HTTP requests) can be done by separate processes, and the OS can abstract the issues away. As another reference, the entire go language is designed around avoiding shared memory (and using message passing -- even though it doesn't use processes for separation it encourages coding like you did).

But also sharing memory between processes can be handled with care via mappings and using the OS.


> What most people want from concurrency (like computing the response to independent HTTP requests) can be done by separate processes

OS processes are way too heavyweight for many use cases.


> Except, due to the takeover of workplaces by the best practices cult, instead of reasoning about tradeoffs on a case by case basis (which is the core of coding and software engineering), we ascribe a sort of morality to programming concepts.

You're just strawmanning here. Maybe some of the people who say that global variables should be avoided ("should be avoided" never means "absolutely can't be used ever", btw) are people who have experience working on large projects where the use of implicit state routinely makes code hard to reason about, causes concurrency issues and introduces many opportunities for bugs.

> There's also fewer stuff for say copilot to fill in incorrectly, increasing your ability to use AI.

That argument makes no sense to me. If some piece of code is relying on implicit global state to have been set, why would copilot be any better at figuring that out than if it had to pass the state as an argument, something which is clearly stated in the function signature?


This is not the problem.

The problem is a higher portion of people who just want to power trip apply to these positions, even if they are not the majority of the police force. Basically, it is the dream job for a bully.

It seems there should be severe penalties for "power tripping" (aka misuse of authority and databases for special purposes); slap of the wrist fine, suspended paychecks and internal investigations will not deter this group of people. I don't see how these crimes are considered less than drug dealing.

Specifically the punishment should include mandatory jail time and permanent ban from jobs where they have any form of authority over others including management, teaching, and all government positions.


> It seems there should be severe penalties for "power tripping" (aka misuse of authority and databases for special purposes)

I wonder if the Computer Fraud and Abuse Act could be used against them in these cases. I'm not a law expert, but it seems to be used for similar "unauthorized access" cases.


For that, the country would need DAs who are willing to prosecute criminals.

Yeah I also wonder how come web scraping was so vilified in all ToS's but I guess if you spend a lot of energy on GPUs and pay OpenAI then it's legit.


As the storyline unfolds "AI" seems to be code for "machine learning based censorship".

Soon we will have home appliances and vehicles telling you about how aligned you are, and whether you need to improve your alignment score before you can open your fridge.

It is only a matter of time before this will apply to your financial transactions as well.


I can sympathize with vague notions of AI dystopia, but this might be stretching the concept a bit too far. This kind of service is extremely abusable ("Operator, go to Wikipedia and start mass-vandalizing articles" or "Go to this website and try these people's email addresses with random passwords until it locks their accounts") and building some alignment goals into it doesn't seem like a terribly draconian idea.

Also, if you were under the impression that machine-learned (or otherwise) restrictions aren't already applied to purchases made with your cards, you're in for an unfortunate bit of news there as well.


You can also write a python script to achieve the same goals.

Except it's not python's responsibility to interpret the intent of your script, just as it's not your phone's responsibility to interpret the contents of your conversation.

So our tools are not our morality police. We have a legal system that can operate within the bounds of law and due process. I am well aware of the already applied levels of machine learning policing, I am just not very excited that society has decided that "this is the way now", and also doesn't seem to be bothered by the environmental costs of building and running all these GPUs (which does seem to be the case when they are used for censorship resistant transactions), or the ethical concerns about a non-profit becoming a for-profit etc.


> You can also write a python script to achieve the same goals.

First of all, I agree with you generally and am uneasy about this too.

But there's a difference in that someone could say 'hey, this attack on my website happened from OpenAI's infra', whereas that would not apply to Python because it's not a hosted service.


Even though you have the power to ignore stop signs when you're driving your own car, it's not an unreasonable restriction of your liberty when AI-driven cars stop at stop signs.


The difference being you would be running that python script yourself. If you by chance hosted it somewhere there is high probability that the host would get a notice and shut you down. I honestly don't see much difference here. There will be multiple providers and perhaps great ways to run these types of tools locally, all have different risk measures.


    > You can also write a python script to achieve the same goals.
This argument is slightly disingenuous as it requires much higher skill, so it acts as a protective barrier. A person who have never programmed in their life could easily instruct this service to do all sorts of damaging things. (I suppose your counterargument will be that people can ask an LLM to write Python code to do the same. Still, most would struggle to run the Python code.)


Kids.

Kids are the non-aligned users who will use this to wreak havoc. And they will think it's hillarious.


I don't think webmasters will be sitting down and hoping that this will not be abusable. Unlikely these kinds of agents would be allowed at all for producing content of any kind automatically (e.g. not via their APIs), or ai-slop will just overwhelm the internet exponentially.

The same neural networks are ready for detecting certain fingerprints and denying them entrance


I dunno, I’m sure sure who I’d bet on in a race of ML website use vs. ML trying to detect ML website use.


<< whether you need to improve your alignment score before you can open your fridge.

Did you not eat enough already? Come to think of it, do you not think you had enough internet for today Darious? You need to rest so that you can give 110% at <insert employer>. Proper food alignment is very important to a human.


Please align pie with pie-hole.

We already have Ignition Interlock Devices which tell you how aligned you are and whether or not you need to improve your alignment score before starting the car.

The EU is also making good progress on financial transactions – they're set to ban cash transactions over $10,000 by 2027.


    > We already have Ignition Interlock Devices which tell you how aligned you are and whether or not you need to improve your alignment score before starting the car.
I didn't know about "Ignition Interlock Devices". Wiki tells me: https://en.wikipedia.org/wiki/Ignition_interlock_device

    > breath alcohol ignition interlock device (IID or BAIID) is a breathalyzer for an individual's vehicle. It requires the driver to blow into a mouthpiece on the device before starting or continuing to operate the vehicle.
Can you explain your concern about this device? Also: How do you feel about laws that require drivers and passengers to wear a seatbelt?

Also: Can you share a legitimate reason why you need to use cash in transactions over 10K EUR?


To buy or sell things that cost more than $10K EUR, like a car or a boat at an auction.

The government only needs to be aware of taxable income, not every financial transaction you make. If you purchase a car in cash with post-tax money, it is none of the government's business.

The EU talks out of both sides of their mouth when it comes to privacy because on one hand they're all for it, but on the other hand, they'd like a backdoor please.

The digital ID standard being implemented is more faithful to these principles: you can generate a proof from your ID that you are 21 without having to give a stranger your home address.


For buying shit. That you don't want some EU person in an office to know you bought. Which should be a fundamental human right.

We're way ahead of that in Turkey: our cash limit is ₺10k, which amounts to about €267 (exception: transactions legally requiring notarisation by a notary public).


What do you mean soon? A friend of mine has a 5 year old Tesla, where you make profiles in the car to store your seat position preferences and other settings. At some point, this guy has done something that he's not sure of, which pissed of some algorithm and banned his profile from using some features. So now he had to make a second profile with a random name so he can drive his car again.


drink verification can


It doesn't need to be a human right, we just need to regulate housing to be owned by individuals and mandate a limit for how many residences one has.

This is because due to the scarcity of homes and that they cannot be manipulated or printed out of thin air and lent short on a computer, they have become tools of speculation, so the regulation is justified.


Doesn't the income for the jacked up prices also accrue to that community though? IMO it is not respectable to take someones money and give them a visa then act like they are a problem or unwelcome.


The fix is to require residential properties be owned by individuals and place a limit on how many homes one household can own (3?) without incurring luxury taxation.

Then we can let the short/long term rental market sort itself out and also allow people to invest in real estate at a reasonable rate.


It doesn't matter if one person owns 20 properties in a neighborhood to engage in rent seeking behavior or if 10 people own two properties. The result is the same. The problem is that the market is broken, there is a shortage, and the shortage is perpetuated by cartel-like behavior by the local homeowning electorate.

Given that we probably won't fix that, I think that if you want to operate a B&B, you should be allowed to operate a B&B, but if you are going to get out of the business of operating a B&B, you should have a cool down period of 3-5 years (enough for the operator to take on real market risk).

That means that the business must only be in the business of operating as a B&B and until that cool down period ends, and then can be converted back into a residence. This is a non-trivial amount of time, and it means that people in the business of short-term rentals can't necessarily just causally operate them, because if there is a housing slump, they won't be able to exit their position quickly.

This is a massive disincentive to folks trying to operate a B&B to facilitate asset appreciation, but is not a significant impediment for people who want to operate a B&B as a going concern.

This solution invites all kinds of problems, like black and grey markets for housing, but that's because this isn't a real solution. The real solution is to just legalize density and let people build as many residences as they want on property they own. It also helps to have a property tax that incentivizes maximal utility of real estate and disincentivizes hoarding.


It obviously matters because then demand for housing speculation will be bounded by population density instead of greed, and corporations will not be able to do things like own double digits of the housing supply in some large metro areas:

https://www.coreysdigs.com/real-estate/who-really-owns-the-u...

These estimates are for entities owning more than 1000 homes.


My point isn't that I don't think a luxury tax isn't a horrible idea, I just don't think it'll solve the problem. If there is a profitable way to remove housing to create a shortage, there is an economic incentive for everyone who is able to participate to do so. So, it doesn't matter if one entity owns 1000 house or 500 people own 2 houses, the incentives are there to remove housing from the market.


Sure it does since luxury tax can be 10%-25% of property value. Let's see who wants to hold on to property then. And if they do they are paying their dues to society.

When they are "removed" and owned by more people, presumably this is a more efficient allocation of the same amount of houses to more people, which is a solution for the housing problem.


Again, it doesn't matter if one person owns 1000 houses or 500 people own two and rent one of them. The incentive system is to increase the shortage, and without addressing that incentive then the population of homeowners (most of the electorate) will not support increased development.


I somehow question these "community vibes", they certainly benefit from the presence of the tourist/nomad economically, but they also want to project a wholesome higher moral ground that's only attainable to "those in it for the long term".

Is it really about a sense of community or just that it's easier to redirect anger at housing affordability to "people who are new or won't stay around long enough" than to address issues like corporations buying up housing supply or unrestricted monetary policy making home ownership impossible for almost everyone.


I lived in a place that had short term rentals.

The visitors don't give a damn about the people living there. They left out trash, speed through the neighborhood, were loud at all hours ... because it didn't matter if they upset the neighbors, they'd never see them again.

The folks renting out the places wanted the most profit possible so they did not care about paying their fees or maintenance and etc.

The incentives for someone invested in living there and someone just there for a weekend / week creates different incentives.


Why don't all these long term community people have a talk with the long term owner and have them not rent their place? To be honest, it sounds like there is no community whatsoever to begin with, at least not one that the long term community members get any say in what happens.

I wonder if all the people who were renting their vacation homes out stopped doing it, what would happen to the restaurant traffic in the area and who would shop at the souvenir shop?

In fact I greatly wonder what the source of economic activity would be in such "destination towns" if we cut off tourism.


Rental owners didn’t care, it was a business for them, I know because talking to them is easier than the hassle we went through and we tried.


Inflation over the amounts needed to stimulate the economy (2-4%) is unauthorized taxation. Kinda whack how everyone is just "okay" with working hard, paying taxes, then having the value of their work spent without their authorization.

Nice there are alternatives for saving.


By alternatives, I suppose you mean pyramid schemes that have no underlying investment that could beat inflation?


Yes like gold, real estate, and also arguably the index fund investment (that everyone buys into via 401k).

All these investments are only worth anything if someone buys them from you at a higher value.

Yes you can generate revenue from these but looking at increases in P/E ratios and real estate prices / income growth tells the story that the increases are primarily fueled by inflation.

For example compare the pre-pandemic and post-pandemic rent for a given apartment and you will see if the "underlying investment" is providing increasing value or if the value is the same or less for an older building but inflation is propping it up.


Call me crazy, but gold and RE didn’t track inflation 2019-now (during periods of high inflation).

Index funds put me way ahead of inflation


> All these investments are only worth anything if someone buys them from you at a higher value.

The index fund may be over priced but much of the market has actual productivity that leads to dividends eventually, so whether someone will buy that off you is not about the next sucker or betting on an increase in wealth among suckers.


In actuality fiat currency makes everything a pyramid scheme and allows the government to spend the wealth of the nation in whichever manner it deems fit, since the value of inflation accrues disproportionately to the asset owner (aka people who were there before you, aka pyramid scheme) vs. the earning productive class.


Inflation benifits the borrowers. Fist currency makes thing run smoothly when well managed, alternatives such as the gold standard have proven to be much worse that's why everyone switched


Technically true but highly misleading

the borrowers that just have a mortgage for their own house while working for a paycheck don't really benefit from it. Sure, their debt has been reduced, but their wage too. And inflation is generally lower then interest, so that benefit gets wiped too.

The by far biggest winners with inflation are the people that own a lot of assets.


People didn't switch because of stability problems with gold standard. That's just propaganda and fiat apologetics. As a matter of fact gold standard seen fastest and most stable growth in the history of human kind. Gold is hard to transport, secure and divide so ledgers were used instead which allowed government to just end goal standards to fund WW1 efforts, which also shows the magnitude of destruction and statist largese this enabled.

I recommend Broken Money for history and analysis how it came to be that things are how they are.


They literally did. They didn't want to go off the gold standard but they did because there was no choice and soon after each country went off the gold standard they started recovering from the great depression.

https://www.reddit.com/r/science/comments/18tl490/abandoning...

The gold standard caused financial crash after crash


This is true but the government is the biggest borrower, who then immediately spends the funds by "awarding" contracts, obviously they don't have any corruption or favoritism when they do this, nor do they place trades using their insider knowledge of how the funds will be appropriated, which will definitely never impact the average citizen borrower (who is probably in need of borrowing money to buy a house, which is so expensive because... inflation)


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: