formulathree
The majority of the population is not rich and the answer to this question/quotation is self mostly self evident to the same majority of the population.
The problem the GP is talking about here is a modularity problem right? He designs (aka guesses) the interface and finds out later that his guess was wrong. Mathematical interfaces deal with this problem better.
However mathematical interfaces are less user friendly and less intuitive, especially for someone not familiar with mathematical interfaces.
The reconciling solution is that the public interface can be very domain specific and made narrow in usage. The logic underneath this public interface can remain mathematical and therefore more amenable to future changes.
Interfaces that mutate internal values do not exist in mathematics. So, in essence, yes. Mathematical interfaces only support functional operations.
Haskell would be the language.
It's mathematical interfaces.
Commutativity, Identity, Associativity, Ordinality and more. For these interfaces, it becomes less about "designing" interfaces with gut intuition, guessing and checking... but more about finding the final design via calculation.
Math is known to be universal so it makes sense why mathematical interfaces have such wide application. When you use mathematical interfaces and compose everything along those parameters... it's no longer about "you never come up with the right interface at first"... That concept becomes less relevant.
It's hard to agree with me when I'm just saying it here. It has to "click" after you tried it with a language that supports this type of programming first class.
The reasoning is because ternary operations eliminate programming singularities.
Example:
var x;
if (someExpression) {
x = True;
}
//var x is undefined
Example 2: var x;
x = someExpression ? true : false;
// use of ternary expression prevents var x from ever being undefined.
The ternary expression forces you to handle the alternative case while the if expression can leave a singularity. A hole where x remains undefined.Some people say ternary expressions are less readable. But Readability depends on your "opinion." There are no hard logical facts about this. So it's a weak-ish argument.
It is actual fact (ie not an opinion) that ternary expressions are categorically more Safe then if-statements. Therefore, they are factually better in terms of hard logical metrics.
This is the reasoning behind nested ternary statements. It's also one of the strange cases in programming where superficial qualitative attributes of "readability" trumps hard and logical benefits. The overwhelming majority of the population will in fact find many nested ternary operations highly unreadable and this "opinion" overrides the logical benefit.
Usually though, to maintain safety and readability I just alias boolean statements with variable names. The complexity of a conditional expression can be reduced by modularizing parts of it under a symbolic name, you don't necessarily have to reduce complexity by forcing the conditional into the more readable bracketed spatial structures favored by if-statements.
Example:
isXgreaterThanY = x > y;
isWlessThan2 = w < 2;
isSubExpressionTrueAndIsWLessThanTwo = isXgreaterThanY & isWlessThan2 ? False : True;
isFactTrue = isSubExpressionTrue ? True : False;
Yes technically the ternary expressions are still nested in a way here, but when reading this code you don't have to dive in deep past the symbolic name.Imagine if you have a boolean condition that relies on multitudes of these sub expressions. By defining the final statement as a composition of Named ternary expressions you eliminate the possibility of a hole;... a singularity where one alternative wasn't considered. In my opinion this is the best way to define your logic.
If-statements, imo, should be reserved for functions that are impure (void return type).. code that mutates things and touches IO which is something you as a programmer should keep as minimal and segregated away from the rest of your pure logic as possible.
Example:
if true:
sendDataToIO(data)
//the alternative of not sending data to IO is not a singularity. It is also required... a ternary expression makes less sense here.
Last but not least: The ternary expression is also a bit weak because it only deals with two possible branches: True/False. The safest and most readable primitive to deal with multiple branches of logic is exhaustive pattern matching. Both Rust and Haskell have a form of this. In rust, it is the match keyword.This is because the behavior is ingrained in biology. But make no mistake behavior ingrained in biology is from selection pressure and that selection pressure is sexual selection. Men select the women who are more interested in making themselves look pretty.
>There is communication too between girls via appearance. boys don’t enter the picture until much later.
The communication is this: If a girl looks prettier she is saying, "I'm better at attracting and manipulating men than you." That's the only thing communicated.
>They communicate with looks.
You're thinking too much. Do men communicate by getting rough and rowdy? Do men communicate by playing sports? Maybe? But the extent of the communication is minimal and it's the same thing with women and looks. There's hidden communication network that men don't know about, that's much to imaginative. Additionally, if such a network existed, some woman would eventually spill the beans.
Do we speak the truth? Or do we speak in terms of empathy so as to not diminish constructive conversation?
It hurts my feelings when someone says 99% of all rape cases are from men. I may get angry when someone says that and that is, like you said, not leading to "constructive conversation."
But the issue here is that the 99% statistic is also the truth. So that's the big question with social justice and liberal politics today. How much do we bend reality for the sake of feelings or "constructive" discussion? When does reality get so bent that "constructive discussion" is no longer "constructive"? Let's not talk about rape and let's not talk about how males are the majority instigators because it hurts my feelings and is not constructive.
Additionally there's very selective application of "constructive discussion". For example you see a lot of rightly placed discussion about the male/female pay gap but no discussion on the fact that males make up 70% of homeless people. The 20% pay gap is by far the bigger issue here. Why?
I wrote a lot here because I care about the subject. For my money, I would argue that your one liner comment against the massive content I'm putting up here is the one that is "dismissive".
Get paid for capturing carbon from burned oil.
It's not exactly in conflict with their current business model.
Men are judged more harshly overall but this is mostly focused on status and success.
Women while they are judged less harshly overall the judgement around them is indeed very centralized around physical attraction and there's no way around it.
I think this masks a bit what's really going on. Yes this is true but realize that it's not strictly "beauty" that's being competed on here. The essential object of competition is "ability to attract and influence men". Beauty is just a component of that.
The ones that truly understand usually are the ones that have kids (boys), or like you was present in an unusual circumstance where they could witness first hand the pressure men have to face.
>Most people are not the high performing ruthless psychopathic type A personality common in Silicon Valley, New York, Miami, etc.
This is the ladder men face and have to fight on. While women compete on physical beauty men have to fight on climbing that ladder of success where the very top spots are occupied by these ruthless psychopathic people. It's these apex predators that are the epitome of masculinity that get the most access to the most beautiful women.
What women don't realize is how selective they are. A big part of what drives men to fight like this is female selection preferences. Access to super model pussy. It's these hypermasculine, high status males that are the most attractive to women. Even women who "get it," cannot turn away from their instincts.
Either way the feminist narrative is so popular that is basically completely eclipses the male side of the story so much so that most men don't even get how much harder they have it.
One thing you need to know is that judgement on men is MUCH harsher than it is on woman. Much harsher. You can call an unsuccessful man a deadbeat loser but you can't call a fat woman a fatty. There is high value in our society to protect a woman's feelings but not a mans. A man is expected to feel nothing and to be a rock in the face hardship. Men can't even ask a woman how much she weighs, that's how much cultural protection a woman has.
What ends up occurring is that a man essentially hides his true nature from a woman. Men actually understand women far better than women understand men. This partly stems from the fact that woman are so vocal (like you are here) about their problems. You will rarely find a man revealing all his fears and insecurities here on HN like you are. That kind of thing is found extremely unattractive and disgusting to women so men have evolved instincts to hide it.
It's true that mens' selection preferences have influenced female behavior including the pressure to look beautiful. This influence spans all of human history and is embedded deeply and genetically into female behavior. But make no mistake the reverse has happened for men as well. In fact the selection pressure for men is higher and more intense. Sexual selection from females has in essence basically selected most men out of the gene pool. There's science behind this: https://psmag.com/environment/17-to-1-reproductive-success
So the world for men is much harsher. You want to switch roles and be a man? I think you're the one in for a wake up call for how much harder it is for men. It's a dog eat dog vicious fight to the apex.
I would say your quest for beauty mostly ends when you have a kid, you'll largely feel the pressure lift because biology has programmed you to switch priorities to care for the child. But a mans responsibility largely never ends.
One thing that you're wrong about is that it's a choice or a truth. A human cannot reinterpret or redefine what he or she thinks to be beautiful. Much of this definition is created by genetics and cultural imprinting.
Doesn't even matter, that's not the point. There are cultures in Africa that value obesity as beauty and those definitions are valid. https://nutritionj.biomedcentral.com/articles/10.1186/s12937... You think I'm fixated on a western style definition of beauty. I am not fixated on it. I am simply saying that the western definition of beauty is a VALID definition. It is not a "misunderstanding", your initial post claimed it is a "misunderstanding."
You're emphasizing too much on specific examples with your preconceived notions.
>You don't actually grapple with divergent local evolutionary pressures creating different, competing and often conflicting ideals of feminine beauty each of which make sense for a given evolutionary context, because it's easier to be intellectually lazy than to actually build a model that accounts for that evidence.
Except I never said anything on the contrary. When did I say that there aren't competing ideals of beauty? I'm glad there's a word for intellectual laziness because I clearly don't fit it.
Is there a word for making stuff up? Imagining that someone meant something when that person never said anything to that effect? What's the word for that? Delusional? No you are not delusional, but you need to understand that I never said anything to contradict your statement here.
>Who's the ignorant one? The one who continues to ignore full evolutionary context, so still you.
Except you haven't given any arguments to contradict my stance. Your arguments here are in full agreement with my point. I really don't understand what you're getting at here.
Socioeconomic class is basically another culture in terms of influence. These two terms can be used interchangeably as they both have the same effect on the perception of beauty. Your question is something I can answer. It differs across cultures because the minds interpretation of beauty involves external experiences. That is why.
As for your comment about universal rules. Well that's also easy. Universal rules involve symmetry and youth. Possibly more, but those are some of the biggest rules of beauty extend past "culture" so we know it's part of biology.
>Could you create such a rule which is consistent over time?
The answer is no. None of these rules are created by anyone or anything.
>Do you think those rules would have been consistent by era, or would they have varied in times of famine versus times of surplus, and could you create anything consistent across civilization? How about by geographic areas which shaped the city states which served as centers of power in those civilizations, IE how feminine beauty may exist on the steppe vs on the coast, or in the mountains?
These rules vary by culture, culture varies by environmental circumstance and genetics. You're getting into a redundancy here. I think you misinterpreted my post. I DID not say that culture does not influence beauty. Quite the opposite. I said Culture DOES influence someones perception of beauty. Read my post, it is there. However and this is a big "However" you do not have a choice in the matter. You do not choose your culture and you do not choose the ideals that are imprinted onto your brain by that culture. Once imprinted on your brain you cannot change it. If the culture values skinny bombshell models then that ideal will be seared into your brain. There are variations and anomalies but overall it is generally consistent.
It's the same way that a baby bird imprints on the first thing it sees as it's mother. It does not have a choice. Your brain is evolved to assimilate itself into it's environment and culture without conscious choice from you.
That being said outside of this as I previously mentioned there are beauty standards that are universal that are not created by culture, two examples already mentioned are symmetry and youth (for women). We know this because surveys show that these ideals do not shift when observing different cultures. Additionally, quite obviously: men are generally attracted to women and women are generally attracted to men, there is some genetic influence making this opposite sex attraction preference generally consistent across all cultures.
Do not discount these universal rules. They are powerful biological instincts and overall... When in conflict they usually override cultural imprints of beauty.
>Speaking about cold hard truth is challenging when working from a basis of archaeogenetic ignorance. You risk overestimating how universal your priors are.
Except this statement doesn't make sense. If everything I say is logically correct and everything you say has issues with correctness, then who's the ignorant one?
I think the opposite. I think the higher level ideal is the illusion. What our base instincts tell us is beauty is the actuality and it's embedded in our biology.
For much of humanity woman have always been valued for their youthful beauty. Pregnancy is costly health-wise and men value youth and beauty because natural beauty conveys better physical genes and youthfulness conveys higher success to conceive a child.
Women are objectified for their beauty by men beauty for real biological reasons. And as a result women who obsess over their own physical beauty also end up being more successful in the mating game. Most of this behavior is the result of evolutionary psychology. This definition of beauty is cold, but it is reality and it is delusional to call it a "misunderstanding" of beauty.
The author writes this article and is drawing upon millions of years of evolutionary instinct and behavior.
>I wish society would accept and circulate this truth rather than the other simpler, convenient, and yet so very wrong lie reflected by this article.
Society doesn't need to circulate anything. Any person with a brain recognizes physical beauty and they know the meaning of the quote "Don't judge a book by it's cover". What's going on is just people are continuously lying to themselves when convenient.
You're saying it here as if someone let's me know of the "truth" and suddenly my instinctual definition of beauty will completely do a 180 and change? No. Unfortunately the cold hard truth is this: You have minimal choice in what you find beautiful. Culture and biological instincts shape your preferences far more than individual choice and you have little control over it.
It's like choosing to find the female form beautiful or the male form beautiful. If I had that choice I can be gay at will. It's convenient to define beauty on your terms when you encounter a woman lamenting the fact she's not beautiful, but your definition of beauty completely flips when talking about sending homosexual people to training camps to train them to be straight... yeah as if they or anyone has a choice. Like I said, your definition is a lie we tell ourselves unconsciously when the situation is convenient.
Sorry to be a downer. But hacker news is a level up above other sites. I think we can handle the truth. In fact I think we prefer it. I prefer to talk about the actual science behind why she feels the way she does and how evolution and biology has shaped this behavior.
Keep in mind it's not one sided. Women objectify men as objects of success and this no doubt shapes mens behavior as much as mens preferences shape women. I have more interest in the interplay of behaviors between men and women then I do idealistic re-definitions of beauty.
Beauty IS in the eye of the beholder, but that eye is built by DNA by which ALL humans share 99.9%.
For these huge environmental problems humanity is facing, I'm sorry to say the only way it to do huge drastic unrealistic changes that will never occur because humanity doesn't have the will power to pull it off.
The real honest answer is that there no "solutioning" the worst case scenario will likely play out.
"Is what we see the result of a form of invisible matter?"
Invisible matter aka dark matter is the "theory" he is referring to.
So? python generates that but the point was demonstrating type checking. The output you see is not generated by python. It's generated by an external type checker. The type checker caught the python exception without running any code.
>> The contents of a string can't be type checked […] Nonsense. This may be true for Python's type checking tools, but that's not a general limitation of type checking.
The context is python. We're talking about python. I'm making a statement about python. Nobody is talking about scala. I don't know why you're getting into scala stuff.
There is literally nothing in my statement to indicate I'm making a general statement about type checking. But I will say checking for the contents of a string is rare for a type checker to do. That is a general statement that is generally true.
>Some people have indeed infinite egos. If there would be just anything else besides that… >I wonder every time why the most clueless are the loudest. That's so embarrassing.
Hey can you please stop being rude? The guy made factually incorrect statements and so did you. That's not an ego thing. It's just true that he's wrong. Everybody makes mistakes... people shouldn't get worked up about someone else identifying a mistake.
I too made a mistake. And I admitted my mistake. See my first couple of posts. I admitted I was wrong: the python interpreter doesn't do type checks. It was an error on my part for not clarifying I meant python development in general with external tools.
I obviously mean static type checks. Not runtime type checks. Please stop being pedantic.
I clarified my meaning in another comment. You're right, I meant to SAY modern development involves type checking with python. But not with the interpreter. My mistake for not being clear.
>All Turing-complete languages match each other in power…
I obviously mean type checking. Additionally what you're saying isn't even true. Not all turing complete languages match in power or capability.
>Python doesn't have a static type system in the first place, so it can't compete with Rust in this regard. That's not even the same game.
Modern python development is done in conjunction with a type checker. Sort of like how modern javascript development is done with typescript. That levels up the game to where python is roughly in the same class as rust when it comes to type correctness.
Depending on the type checker python matches the power of rust, roughly. There are differences, but for ADTs they are pretty similar in capability.
Yes I know. but the you will see the code addresses this. Mypy caught the monkey patching. Look at it. I added a property to an instance dynamically and mypy caught it.
>You may say “oh but that’s uncommon or bad practice” but it’s unfortunately quite common in many production systems because Python has encouraged embracing its dynamicism for decades. That’s not a flaw, that’s a power. But it definitely has its pros and cons.
I addressed this in the post you replied to. I specifically stated it. Let me quote it:
"__getattr__ is type checked too as long as you type the method signature, I have seen some weirdness around this area for type checkers but that's not the main problem. I understand where you are getting at with __getattr__. When you use this you're essentially creating something akin to a function with a string as a parameter. The contents of a string can't be type checked and if all methods are defined this way on a class none of it can be checked."
You addressed a point I already addressed, and didn't address the points you were factually wrong about: Dictionary access is type checked. Monkey patching is also type checked.
>Anyway I shall not respond further to you because this discussion is hyper fixating on something that was only intended to be an example. It serves no purpose to continue arguing
Completely agreed let's move on from all the BS. But you said some things that were factually wrong about python Dicts not being type checked. You said dictionary access is not type checked. Please address those things. I am interested in your viewpoint on this matter because I can learn something if my statement is wrong.
But! there was one huge flaw with my code! like huge. Only one person in this entire thread caught it. This is a rejection level flaw for sure. It may have been it but this thread is making me think it might not be.
What's astonishing is that nobody caught it. Nobody but one guy. This flaw would've gone past all unit tests all type checking and all integration tests. No engineering process would've caught it other then analyzing the code line by line and seeing exactly what each step does.
So it makes me think that if more or less no one on this thread caught it... it's likely that the reviewer didn't catch it either. I'm thinking it's more likely some superficial aspect of the code screwed me over even though this flaw is huge. Like no unit tests or something.
It's not even some obscure flaw either it's very visible. the ZRANK call isn't doing anything. it's an empty command with discarded output... a snippet generated by code from chatgpt which lied to me about what that command does. I tested that code extensively and it worked fine.
This mistake deserves rejection, but like I said, I somehow think that this wasn't what got me rejected.
Yeah don't bother.
>We're not considering language extensions (which are built in BTW, on par with using the stdlib), but we're considering completely separate ecosystem plugins that do type checking? Nonsense.
It's not nonsense, the language extensions should not be included because the functionality in Haskell is so far and above what ANY type checker typically does. Clearly.
You're being utterly too pedantic here. When I say python types match haskell in power I am obviously not touching upon GADT or RankN. You're getting into the weeds.
It has nothing to do with extensions being "on par with stdlib"
>Tracking usage of variables is useful, whether you use GC or not -- it's a matter of ability in the type system. My point is that you cannot specify in your code that a value should be used "at most once", which is what affine types afford you.
Yeah but not strictly necessary for python which has a GC, but strictly necessary for Rust which has ownership.
>I will not say more on this
Yeah don't bother. Sort of rude. But whatever.
>No, I mean JS, and in particular NodeJS as an execution platform, because it has no GIL, can do threads, async io is a first class concept, were flexible enough to get used to transpilation (which lets something like Typescript exist).
It can't do threads. I just looked it up. Worker Threads are processes that use some form of IPC. Literally a whole new v8 engine. I was right. Also JS is a horrible language. It's crazy you use haskell and you're ok with things like undefined which basically is a nonsense instance that can flow from one end of your code to another.
>The type is called Natural, and I wrote Natural.
Nope the type is called Nat. https://hackage.haskell.org/package/fin-0.3/docs/Data-Type-N... and in Idris: https://www.idris-lang.org/docs/current/base_doc/docs/Prelud....
But this has nothing to do with anything does it? I thought you were referring to a more general type Num.
>You said that it can prove a system to be "correct". Unfortunately I can't know what you meant by "correct", but the type system will not help you with many of the practical issues that are most important when writing code.
And I wrote extensively on what that means and you read it so you know what I'm talking about. There's no need to get pedantic and argue on pedantic points that are obviously contrary to the obvious meaning of what I'm saying.
>That's where good engineering comes in.
Yep, but do you have a point? Why make this statement?
>This will be my last on this discussion, was good!
I don't think you think it was good. I think you're annoyed. That's why you want to cut it off.
The first part is true, I agree with that assessment and I never made a contrary claim. Companies are migrating.
The second part in parenthesis, is less common, I don't agree that it's a generality among companies that have python as a primary language.
>It’s like saying every company uses bash scripts. It’s not really indicative of the prevalence in actual code bases in production use other than saying it may be used somewhere within the company.
I don't even know what you're getting at with this example. Tons of companies use python "somehwhere" within the company. I'm sure in those cases it's often not typed.
But for companies or teams that use python as a primary it's typically typed or in the process of getting migrated to be typed. That is the nuance I added to my claim.
>Between this and your other comments, you’re making very widespread comments that can’t logically apply to everything and nor do they in my experience.
Except you made statements that are factually wrong. I literally ran mypy on some code and your statements were categorically incorrect from your other comment. Usually these debates are anecdotal so logic doesn't apply as it's just fuzzy opinions regarding social aspects of society. But that's not the case here. You made factually incorrect statements and that has bearing on the correctness of your anecdotal statements too.
My experience is different from yours. I'm ascribing my experience to reality not to your experience. I think my experience is more inline with reality then yours is given the metrics.
>And these type checkers cannot detect it. Python’s dictionary access is not guarded by the type checkers and neither is __getattr__.
For this code:
from typing import Dict
x: Dict[str, int] = {2: "hello"}
print(x[3])
class Hello:
def __init__(self) -> None:
self.x = 1
b = Hello()
b.y = 2
c: str = b.x
print(b.y)
generates this: main.py:2: error: Dict entry 0 has incompatible type "int": "str"; expected "str": "int" [dict-item]
main.py:3: error: Invalid index type "int" for "dict[str, int]"; expected type "str" [index]
main.py:8: error: "Hello" has no attribute "y" [attr-defined]
main.py:9: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
main.py:10: error: "Hello" has no attribute "y" [attr-defined]
Found 5 errors in 1 file (checked 1 source file)
Monkey patching is checked. Dictionary access is checked. You are completely Wrong on these statements.__getattr__ is type checked too as long as you type the method signature, I have seen some wierdness around this area for type checkers but that's not the main problem. I understand where you are getting at with __getattr__. When you use this you're essentially creating something akin to a function with a string as a parameter. The contents of a string can't be type checked and if all methods are defined this way on a class none of it can be checked.
>If you’re making such wide sweeping statements you need to be more familiar with the subject matter.
Same for you. You made factually wrong statements. Perhaps you need to be more realistic about people and yourself in general. In life you will encounter people that disagree. It's not wise to rudely call them not "familiar" with the subject matter. All humans make mistakes and you are setting yourself up for failure when you make rude statements like that and then make a factually incorrect mistake right after.