Recent comments in /f/explainlikeimfive
[deleted] OP t1_iybs4kf wrote
[deleted] OP t1_iybrrgj wrote
Nagisan t1_iybrn9u wrote
Reply to comment by generous_cat_wyvern in ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
Exceptions can open up a whole pandora's box in the flow of a program. I can't speak for every language (because there's lots I don'tknow), but at least with what I'm most familiar with the function does return to the line it was called from depending on how you handle the exception.
In the case of your function catching the exception, you can fail gracefully by logging an error, at which point the program will continue and the function will return to the line that called it then just chug right along (if the result of the function wasn't necessary for the program to continue).
In the case your function doesn't catch the exception, it will bubble up to the place it was called from and repeat this process (if the exception is caught at the higher level, my second paragraph happens, otherwise it bubbles up again, repeat until something catches the exception or the program reaches the main function and crashes).
So yeah, exceptions can be the oddity here, but they also can continue to work the same as no exceptions when it comes to the flow through a program.
ohyonghao t1_iybrk08 wrote
Reply to comment by orangezeroalpha in ELI5 why we first multiply, then add by TheManNamedPeterPan
While taking a course in Group Theory for my mathematics degree, the author of the book declared that parenthesis are unnecessary and redundant.
explainlikeimfive-ModTeam t1_iybrho2 wrote
Your submission has been removed for the following reason(s):
ELI5 is not for straightforward answers or facts - ELI5 is for requesting an explanation of a concept, not a simple straightforward answer.
If you would like this removal reviewed, please read the detailed rules first. If you believe this was removed erroneously, please use this form first. If you believe this was removed erroneously, please use this form and we will review your submission.
NCreature t1_iybrgct wrote
A lot of that money is in shares of his company, stock options, investments, etc. It's not cash. It's not like he has a giant money bin like Scrooge McDuck full of gold and people will be like "what do we do now?"
Also billionaires die all the time. And any number of things can happen with the wealth they leave behind. Often the shares get bought back or divested. Over time the family's personal stake in the company often diminishes sometimes down to basically nothing. The Walt Disney Company is a good example where the Disney family really no longer has any real stake or major influence.
Wealth often just passes down in some form to next of kin but it doesn't always happen that way. Many people have famously not left their fortunes to their children and instead given it to charity or bankrolled other companies (or governments). The US in general doesn't have a ton of multi generational super wealth especially if the younger generations don't really do anything to keep up the wealth or the mechanism that created the wealth. Today's Carnegies, Rockefeller's, Duponts and Vanderbilt's still have some decent money but it's a rounding error compared to their great grandparents. John D Rockefeller's personal wealth in the late 1800s was $900 million or $24 billion in today's dollars. That being said people like Elon have so much personal wealth, literally more than many countries entire GDPs, that we are in somewhat uncharted waters. I'm actually not sure what would happen with Elon's $191 billion.
nesquikchocolate t1_iybr9zv wrote
Reply to comment by Ok_Ad_9188 in ELI5: Why can't you just not eat if you're overweight? by Ok_Ad_9188
Your body weight is mostly water.
You drink a liter of water, you gain 1 kilogram of weight.
You urinate 1 liter, you lost 1 kilogram.
When you're starving, your body functions slow down significantly, meaning you start to retain the water that you drink, so you don't lose weight like that..
But you still need to drink water and urinate, else your blood becomes toxic!
bradles0 t1_iybr5rp wrote
remember what 1+2x3 actually MEANS - multiplication is a shorthand for multiple additions, and further up pemdas exponents are multiple multiplications; so you simplify back down the line.
1+2x3^3=1+2x(3x3x3)=1+((3+3+3)+(3+3+3)+(3+3+3))+((3+3+3)+(3+3+3)+(3+3+3))=55
The other reason is the practical considerations - if you have 5 boxes of a dozen eggs and 2 extra eggs, you have 5x12+2 eggs; the standard case for multiplication will be rows + columns + leftovers, and there are FAR fewer cases where you care adding more rows or columns instead of adding in the leftovers, so it's easier to note the special times when you are adding more columns than the times when you are adding the leftovers.
xzt123 t1_iybr5of wrote
Reply to comment by Milnoc in ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
There's appropriate uses of goto, in C/C++ with nested loops and performance matters, sounds like a reasonable use.
RumpledStiltSkinn t1_iybr5ga wrote
Probably buried with him in a very large pyramid among his prized possessions and extracted organs.
chortling2 t1_iybqywn wrote
Reply to comment by soylamulatta in ELI5 Are cows constantly producing milk? by ms_myco
Right? Redefining food as necessity rather than an indulgence for future generations has got to happen.
People like going into space but don't want to eat space food? The hypocrisy of humans knows no bounds.
Another example: people like luxury boats and are realistic about not being able to afford big ass yatchs. Yet ask them to live in an urban small space and they balk. No, we need single family homes and will fight tooth and nail to preserve our "right" to disallow multi unit housing of any kind.
CRATEBOYZ t1_iybqn0y wrote
Reply to comment by UncontrolableUrge in ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
Perfection.
generous_cat_wyvern t1_iybqmwc wrote
Reply to comment by Nagisan in ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
>functions send the program to another line of code but then return back to the line the function is called from once the function is done.
Except for when Exceptions are thrown, but I guess that's why they're called Exceptions :p (I actually don't know if that's the reason, I probably just made that up) But even Exceptions propagate up a call stack in a predictable manner.
As an aside, it blew my mind when I found out that in ASP.NET, redirects happen by internally throwing a ThreadAbortException behind the scenes that can't be handled by normal means. It made sense that code after calling redirect didn't execute, and the only way to have code behave that way is if an Exception is thrown, I just never put two and two together.
[deleted] t1_iybq703 wrote
[removed]
RJC024 t1_iybq5gi wrote
This entire thread is blowing my mind because it reminds me that we just made math up? I mean, we did though right? Like we could’ve easily decided to always start with subtraction, couldn’t we have?
internetboyfriend666 t1_iybq47i wrote
It's distributed according to their will or, if they don't have a will, state law (after the appropriate taxes are paid) - same as anyone else. They may have vastly more complicated estate plans, but the legal procedures are the same.
FatOldRugbyDude t1_iybptfs wrote
That’s what estate taxes are for. The money they don’t funnel to their families or hide somehow is largely meant to return to the economic system to keep I healthy instead of just sitting in a pile gathering dust.
[deleted] OP t1_iybpl75 wrote
Gigantic_Idiot t1_iybpgt8 wrote
Reply to comment by BurnOutBrighter6 in ELI5 why we first multiply, then add by TheManNamedPeterPan
Adding on since I don't have enough for a parent comment, but multiplication is doing an addition multiple times. So the example could also be written as 1+2+2+2.
Milnoc t1_iybpcua wrote
Reply to comment by xzt123 in ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
C/C++. But as I've said, I use them very sparingly to kick the process out of a nested loop or switch block into a general maintenance chunk of code. I would never use it to jump around within a loop or switch block.
Sloloem t1_iybovkb wrote
Reply to comment by OldHellaGnarGnar2 in ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
Yikes, I'd actually seen code kindof like that written by outsourced contractors for a financial services firm I used to work for. They created these "god" functions that ran through multi-step processes by wrapping the whole thing in a giant for loop and using If's on the iterator like if (i==1)... (i==2)... (i==3) to block each step. It really hampers extensibility.
> Question for you: if I want to improve my coding skills (because I only took one class in school, and have just picked other stuff up as I go), would it be a good exercise to re-write all their code using the structure you've outlined?
Assuming you're talking about re-writing the IF-GOTO code your robots use in more structured style, yeah absolutely. Changing the underlying implementation of some functionality while maintaining its public contract is actually the definition of "refactoring". Being able to cleanly refactor code and write code that's cleanly refactorable are actually the underlying goals of a lot of current best-practices in Object-Oriented programming so it's definitely an important skill to practice.
> And/or if I'm trying to learn another language like python specifically, see if I can re-write it in that, so I can learn that syntax & commands at the same time?
Porting code directly like that is an interesting activity but maybe something that's more of an intermediate activity once you have the fundamentals down. I thought this phrasing was kind of pompous when I first heard it but most languages have "idiomatic" ways of doing some things that is considered the correct way to write code in that language. Of course the languages are flexible enough that they would allow you port structure and style of another language's idioms to this new language, but those sorts of idiomatic patterns usually come out of some key feature of the language and have fundamental advantages in terms of code expressiveness or performance. So it's best to learn "Pythonic" ways of writing code that might be very different from how someone who'd trained as a Java or C++ developer would usually think of implementing them. Then once you feel like you can write Python, you can try re-implementing functionality that used to be written in some other language and paradigm in Python rather than trying to re-write some Java using Python. It's a slight language shift but I think it's a good way to frame it.
In a professional setting you're also unlikely to see a company trying to do a 1:1 re-write of an existing product. The switch in tech stack is usually driven by a desire to benefit from some killer feature of the new stack like NodeJS's fast async I/O or something else, and to do that you usually need to write idiomatically and respect the eccentricities of the language and the framework.
petersrin t1_iyborbp wrote
Reply to comment by gliderXC in ELI5: why is using "goto" considered to be a bad practice in programming? by Dacadey
"Not inherently evil" And in fact we still use something similar regularly for certain types of error handling.
nemplsman t1_iyboolz wrote
Reply to comment by BurnOutBrighter6 in ELI5 why we first multiply, then add by TheManNamedPeterPan
I bet there's a more precise explanation than just "we agreed to it." Without looking it up, it seems it's something having to do with this:
Consider this formula:
- 4 x 8 + 9 - 2 x 7 + 9 ÷ 3
We know that the multiplication sign between 4 and 8 only acts between those two numbers. And the multiplication sign between the 2 and 7 only acts on those two numbers and the division sign only acts on the 9 and 3. BUT, the +4 and -2 and +5 could literally be anywhere else in the formula and nothing would change. Basically, the exact location of the multiplication and division symbols between two numbers matter, whereas the exact location of the numbers added and subtracted doesn't matter.
I don't think this is just because we decided to do it this way as a convention. It's because the multiplication and division signs are unique in that they specifically imply that a calculation should happen between the two numbers on either side of the operation.
Maybe a way to think about it is that multiplication and division essentially transforms the adjacent numbers. Examples:
- 3 x 8 (three, eight times is 24; or eight, three times is 24).
- 45/3 (45 split into 3 is 15).
Numbers that are added or subtracted are more just independent from the rest of the numbers as they can appear anywhere (they don't necessarily need to be added to the adjacent number).
VeryLargeBrain t1_iybog1g wrote
Reply to ELI5 How is the Tether price I pay determined? by LGZee
Crypto was a lie from its very first day. It's based on the principle of the Last Fool. It's a bag of dog shit being passed from person to person, and the Last Fool who can't pass it on to someone else has to eat it.
[deleted] OP t1_iybs4t1 wrote
Reply to ELI5: why does it hurt men to be nut tapped but not when they have sex and their nuts smack against the girl? by [deleted]
[removed]