A data processing pipeline with more than a handful of steps?
A subgraph match that needs to check for more than a handful of nodes and edges?
I would not know why both can not be expressed with a set of small functions.
The first part of this, about readability and maintainability, is just begging the question. Perhaps your mind works different than mine. For me it is obvious that a set of smaller functions is easier to understand and maintain than a big one.
Merely breaking out parts of the code into smaller functions doesn't reduce the complexity of the decision tree, so if you want to argue for comprehensive branch coverage then you need just as many tests either way Obviously. But now I don't have one complex test case that tests a big function, but a set of very simple test cases.
In my experience, attempting comprehensive branch coverage as a strategy for writing unit test suites is usually futile and almost always inefficient anyway. Some customers require that.
I usually never write unit tests, I only write User Acceptance Tests (Story or UseCase/Scenario based), high level System Integration Tests and use a coverage tool. OTOH if I was writing a compiler I likely had thousands of unit tests.
Nevertheless I would prefer to write "easy" tests on small functions than on big ones, and if my job was to test big functions: I would refactor them imediatly into small ones.
Nevertheless the Eurofighter is the only plane on the planet that is in service, excels at multiple roles, and even can be fitted to fulfill more than one role in a single mission, aka an anti tank run with an air to air intercept on the way home. The only other planes that are close to its performance are the Saab fighters and the brand new Su-47 (not so brand new anymore ofc.)
You are writing something disturbing... USA is (still?) a first world nation? I mean... now as Trump is dismantling health care... to be honest I rather have an accident in Thailand than in the USA. Not sure if I ever even muster the bravery to visit the USA.
Russia does not have the resources nor technology to conquer Europe. They can bomb us into the stone age, but so we can bomb them.
And why would they? They gain more from Europe by simple trade.
If the US pulls out from Europe, they basically lose the most important bases to attack/control the "middle east".
Pulling out of the NATO, well, then you probably need some new trade agreements, too. Lets see how long a Nimitz class carrier can operate without spare parts from Germany, rofl. (Less than 40 days... for your interest)
3 month after the US pulled out of the Nato, your fleets are no longer operating. You don't have the industry to support it.
The "Greek Debt Problem" can only be solved by the Greek. The "Syrien Refugee Problem" can only be solved by removing the terror regime in Syria. And killing IS(IS).
Why you think Germany or the EU had a magic button it just could switch to solve one of the two problems is beyond me. Germany or the EU per se has no "Syrian Refugee Problem". The total amount of refugees is about 4million. Over 3 million immigrated into the EU. The EU has now about 750 million inhabitants. So this is roughly 1 refugee per 200 EU citizens. That is not a problem.
I'd say that their leadership record doesn't look so hot recently. And I would say: morally and humanity it looks perfect. I have not much a clue how the USA can waste their money in a way that a huge part of the population is poor. Syrien "refugees" are already vitalizing the german economy. Most of them either speak adequate english and/or are learning german.
However I would like to see your comment when you read in the news: thousands of refugees starving and freezing to death at EU borders: "because the EU refuses to let them in"
Even the original point that was linked at the start of this thread suggests an upper limit of 15 lines, which is far too short for a lot of useful algorithms. This is a matter of taste and experience.
I never saw a reason for functions that long. However there is no hard limit for me. If I can not cut out a function with a useful name, then I keep the big function.
Almost anywhere else, it is not, because functions can have side effects, often including interacting with various forms of state kept outside the function. Emphasize on "can". But they should not. So you are arguing because you write bad code (functions with side effects) it is pointless to write shorter functions?
This makes little sense, unless you're talking about languages where all functions live on some class (in most modern languages that is the case) and so sometimes classes are basically just used as namespaces with no state. Because often it makes no sense to move such functions into classes with no state... circular argument... I'm still talking about ordinary classes with state and methods. But some bigger algorithms might be divided into smaller functions. The algorithm modifies state of the object, the smaller functions not necessarily. When an algorithm is modifying the state of an object, and hence is a method, then I keep the "sub functions" usually as methods, sometimes static, in that objects class. Instead of moving them into utility classes "for name space purpose"...
but if you're just breaking a relatively long function into smaller parts because of some arbitrary limit, it's a different story. We don't do that because of an arbitrary limit, like 15 lines. We do it to improve readability and maintainability and on top of that: testability.
A complex algorithm that is divided into several small(er) functions can be tested by testing the functions individually. A big function can only be tested as a block. And then show me your test and proof that every branch in the function is at least tested once... if you are smart you are using a coverage analyzer for that;D
Historically the idea of short methods comes from SmallTalk (and/or Lisp/CLOS), where 5 lines are usually expressing much more code/business logic than 5 lines of lets say C. On top of that in early IDEs - yes, IDEs, not vi/emacs - the code editing widget was rather small. Think about the first Apple Macintoshs, they had a 9" screen if I recall correctly. With a class browser on top and some inspectors on one side, you basically only had a 10 lines * 50 chars code editing widget. However that widget did not show the whole file, but just the selected method in the class browser.
Bottom line it comes down to a simply question of coding approach: do you often copy/paste code? So that a function starts with 3 times 2 lines of identical code but different variables? Then why not placing those 2 lines into a "function" and just call it 3 times? And no: 3 times copy pasting the two lines is not faster than writing it once and then use the IDEs refactoring "extract method".
Or do it as I do: just call the non existing function and answer the IDEs question: "should I auto generate the function for you?" With "yes" and you are automatically with your curser inside of the function and write your code.
Indeed, the point several of us are trying to make is that exactly the opposite may be true: breaking everything down into very small functions That is a strawman. Nobody said very small. They simply should be small enough, that is all.
the number of potential relationships between them grows exponentially, and those relationships may not be as transparent once you've broken everything down into tiny pieces. Then you are doing it wrong. By "definition" a function only works their arguments and returns a result. Usually, if it is a method in a class, it does not even manipulate the attributes of its associated object. The only relation functions have to each other is their call hierarchy, which is easy to figure and in an IDE trivial. Worst case use the debugger.
Let me refer you to me original statement - MOST people are not. Even in Europe. It's just that the ones that are, are especially loud and obnoxious about it.
That is incorrect. In fact the U.S. stores I shop at have a lot more labeling saying "Non GMO" that I ever saw in European grocery stores. Obviously, facepalm. In Europe food containing traces of GMO material must be labeled. Fully GMOed food is illegal to trade. Obviously no one is putting a voluntary 'no GMO' lanel on his food, facepalm.
Reminds me at a/. post a few weeks ago where a mining company was complaining about eagles killing their $10k camera drones. They even where so stupid to "camouflage" their drones as eagles... facepalm.
The bottom 50% paid 2.8% of all US Income tax paid in 2015; the top 50% paid 97.2% In most countries it is the opposite around. I would be shocked of the USA would be different. If the US are different: I would wonder why he bottom 50% have so low income that they pay so low taxes.
...lution to tick a check boy on my order: [ ] fake chicken [ ] real chicken
On the other hand: this does not really concern me. I eat chicken roasted on a grill. It always will be "real chicken" and on other circumstances I eat: beef. Aka cows. Or sheep, I like sheep, or goat, they are tasty too, and as I'm german, I occasionally eat pork aka pig.
To understand why I switch between cow/beef and pork/pig you need to read Ivanhoe by Sir Walter Scott;D
But the closer it comes to the speed of light the heavier it gets, it gains mass. That means, to accelerate it further, you need more power, but mostly you will again: just increase its mass and not its speed. Hence it can not reach the speed of light.
However in labs we accelerate electrons or protons to something like 99.9% of c.
Well, then you are obviously not aware that most people are against GMO. At least in Europe. Or what do you think why GMOs are banned in Europe, and the few exceptions need to be clearly labeled?
Hundreds of german officers got executed after military tribunals in Nurnberg because they commanded mass killings of Jews or prisoners of war. The internet is full with videos about it as the killers where actually proud about doing their job.
Of course it is... The rest are close to trivial engineering problems. There is no difference to creating an empty air less tube, or having a submarine dive mere ten meters deep. Exact the same pressure difference.
The Germans are nothing if not meticulous and weren't of the type to follow verbal orders, processes would have been created, documented, passed along the chain of command, etc. There would be evidence of this, but there isn't. That is wrong. It is all documented. There is plenty of evidence. Want to come to a german town? We are plastering brass stones in front of every house where a jew lived. With the name and date he was killed on it. Alone in my town of ~350,000 inhabitants we thousands of those stones in the streets.
You must be living in a kind of distorted reallity.
There was no significant amount of jews that emigrated. Explain me how you emigrate from a country like Poland that is conquered by the germans?`
The Nazis kept book aboout what they "stole" from the Jews before they killed them, they kept book about every incident, arrival in a KZ, death etc.
When we Germans *know* that we have killed ~6 Millions of jews, then I really wonder what your mental problem is to be live it.
There are no bones to be found in the amounts that would be necessary to corroborate the claimed amounts killed. That is bollocks for several reasons: a) in KZsa they mostly got cremated b) most of the mass graves of killings outside of the KZs are not even found yet
Not enough hyperloop nutters to lobby the government? No, Switzerland is bottom line to small to make it a reasonable investment. Germany already has high speeed trains and a "hyperloop" would only be roughly twice as fast. On the other hand: the USA has no high speed train/rail network, hence: it is a very good idea, and you are jsut an anti tech moron.
We're far, far more likely to go to the Moon again than build a working hyperloop. Fantasize all you like, but it's not going to happen. You seem not to grasp how simple the construction of a hyperloop is, rofl.
A data processing pipeline with more than a handful of steps?
A subgraph match that needs to check for more than a handful of nodes and edges?
I would not know why both can not be expressed with a set of small functions.
The first part of this, about readability and maintainability, is just begging the question.
Perhaps your mind works different than mine. For me it is obvious that a set of smaller functions is easier to understand and maintain than a big one.
Merely breaking out parts of the code into smaller functions doesn't reduce the complexity of the decision tree, so if you want to argue for comprehensive branch coverage then you need just as many tests either way
Obviously. But now I don't have one complex test case that tests a big function, but a set of very simple test cases.
In my experience, attempting comprehensive branch coverage as a strategy for writing unit test suites is usually futile and almost always inefficient anyway.
Some customers require that.
I usually never write unit tests, I only write User Acceptance Tests (Story or UseCase/Scenario based), high level System Integration Tests and use a coverage tool. OTOH if I was writing a compiler I likely had thousands of unit tests.
Nevertheless I would prefer to write "easy" tests on small functions than on big ones, and if my job was to test big functions: I would refactor them imediatly into small ones.
Nevertheless the Eurofighter is the only plane on the planet that is in service, excels at multiple roles, and even can be fitted to fulfill more than one role in a single mission, aka an anti tank run with an air to air intercept on the way home. The only other planes that are close to its performance are the Saab fighters and the brand new Su-47 (not so brand new anymore ofc.)
The Eurofighter does not VTOL, though.
You are writing something disturbing ... USA is (still?) a first world nation? I mean ... now as Trump is dismantling health care ... to be honest I rather have an accident in Thailand than in the USA. Not sure if I ever even muster the bravery to visit the USA.
Russia does not have the resources nor technology to conquer Europe. They can bomb us into the stone age, but so we can bomb them.
And why would they? They gain more from Europe by simple trade.
If the US pulls out from Europe, they basically lose the most important bases to attack/control the "middle east".
Pulling out of the NATO, well, then you probably need some new trade agreements, too. Lets see how long a Nimitz class carrier can operate without spare parts from Germany, rofl. (Less than 40 days ... for your interest)
3 month after the US pulled out of the Nato, your fleets are no longer operating. You don't have the industry to support it.
The "Greek Debt Problem" can only be solved by the Greek.
The "Syrien Refugee Problem" can only be solved by removing the terror regime in Syria. And killing IS(IS).
Why you think Germany or the EU had a magic button it just could switch to solve one of the two problems is beyond me. Germany or the EU per se has no "Syrian Refugee Problem". The total amount of refugees is about 4million. Over 3 million immigrated into the EU. The EU has now about 750 million inhabitants. So this is roughly 1 refugee per 200 EU citizens. That is not a problem.
I'd say that their leadership record doesn't look so hot recently.
And I would say: morally and humanity it looks perfect.
I have not much a clue how the USA can waste their money in a way that a huge part of the population is poor. Syrien "refugees" are already vitalizing the german economy. Most of them either speak adequate english and/or are learning german.
However I would like to see your comment when you read in the news: thousands of refugees starving and freezing to death at EU borders: "because the EU refuses to let them in"
Considering the participation rate in voting it probably was just about 1/3rd ...
Even the original point that was linked at the start of this thread suggests an upper limit of 15 lines, which is far too short for a lot of useful algorithms.
This is a matter of taste and experience.
I never saw a reason for functions that long. However there is no hard limit for me. If I can not cut out a function with a useful name, then I keep the big function.
Almost anywhere else, it is not, because functions can have side effects, often including interacting with various forms of state kept outside the function.
Emphasize on "can". But they should not. So you are arguing because you write bad code (functions with side effects) it is pointless to write shorter functions?
This makes little sense, unless you're talking about languages where all functions live on some class (in most modern languages that is the case) and so sometimes classes are basically just used as namespaces with no state. ... circular argument ... I'm still talking about ordinary classes with state and methods. But some bigger algorithms might be divided into smaller functions. The algorithm modifies state of the object, the smaller functions not necessarily. ...
Because often it makes no sense to move such functions into classes with no state
When an algorithm is modifying the state of an object, and hence is a method, then I keep the "sub functions" usually as methods, sometimes static, in that objects class. Instead of moving them into utility classes "for name space purpose"
but if you're just breaking a relatively long function into smaller parts because of some arbitrary limit, it's a different story.
We don't do that because of an arbitrary limit, like 15 lines. We do it to improve readability and maintainability and on top of that: testability.
A complex algorithm that is divided into several small(er) functions can be tested by testing the functions individually. A big function can only be tested as a block. And then show me your test and proof that every branch in the function is at least tested once ... if you are smart you are using a coverage analyzer for that ;D
Historically the idea of short methods comes from SmallTalk (and/or Lisp/CLOS), where 5 lines are usually expressing much more code/business logic than 5 lines of lets say C. On top of that in early IDEs - yes, IDEs, not vi/emacs - the code editing widget was rather small. Think about the first Apple Macintoshs, they had a 9" screen if I recall correctly. With a class browser on top and some inspectors on one side, you basically only had a 10 lines * 50 chars code editing widget. However that widget did not show the whole file, but just the selected method in the class browser.
Bottom line it comes down to a simply question of coding approach: do you often copy/paste code? So that a function starts with 3 times 2 lines of identical code but different variables? Then why not placing those 2 lines into a "function" and just call it 3 times? And no: 3 times copy pasting the two lines is not faster than writing it once and then use the IDEs refactoring "extract method".
Or do it as I do: just call the non existing function and answer the IDEs question: "should I auto generate the function for you?" With "yes" and you are automatically with your curser inside of the function and write your code.
Indeed, the point several of us are trying to make is that exactly the opposite may be true: breaking everything down into very small functions
That is a strawman. Nobody said very small. They simply should be small enough, that is all.
the number of potential relationships between them grows exponentially, and those relationships may not be as transparent once you've broken everything down into tiny pieces.
Then you are doing it wrong.
By "definition" a function only works their arguments and returns a result. Usually, if it is a method in a class, it does not even manipulate the attributes of its associated object.
The only relation functions have to each other is their call hierarchy, which is easy to figure and in an IDE trivial. Worst case use the debugger.
You should tell that to the mozilla foundation ...
I think he meant the thousands of Java projects hosted by http://apache.org/
Let me refer you to me original statement - MOST people are not. Even in Europe. It's just that the ones that are, are especially loud and obnoxious about it.
That is incorrect.
In fact the U.S. stores I shop at have a lot more labeling saying "Non GMO" that I ever saw in European grocery stores.
Obviously, facepalm. In Europe food containing traces of GMO material must be labeled. Fully GMOed food is illegal to trade. Obviously no one is putting a voluntary 'no GMO' lanel on his food, facepalm.
How do you remote control a drone that is covered in aluminium foil?
Funny, I liked the "ill-eagle drones" :D
Reminds me at a /. post a few weeks ago where a mining company was complaining about eagles killing their $10k camera drones. They even where so stupid to "camouflage" their drones as eagles ... facepalm.
The bottom 50% paid 2.8% of all US Income tax paid in 2015; the top 50% paid 97.2%
In most countries it is the opposite around.
I would be shocked of the USA would be different.
If the US are different: I would wonder why he bottom 50% have so low income that they pay so low taxes.
...lution to tick a check boy on my order:
[ ] fake chicken
[ ] real chicken
On the other hand: this does not really concern me. I eat chicken roasted on a grill. It always will be "real chicken" and on other circumstances I eat: beef. Aka cows. Or sheep, I like sheep, or goat, they are tasty too, and as I'm german, I occasionally eat pork aka pig.
To understand why I switch between cow/beef and pork/pig you need to read Ivanhoe by Sir Walter Scott ;D
McDonalds is not selling GMOed food in France. ... what is your point?
So
Mass does not lose its "physical parameters"-
But the closer it comes to the speed of light the heavier it gets, it gains mass. That means, to accelerate it further, you need more power, but mostly you will again: just increase its mass and not its speed. Hence it can not reach the speed of light.
However in labs we accelerate electrons or protons to something like 99.9% of c.
Well, then you are obviously not aware that most people are against GMO. At least in Europe. Or what do you think why GMOs are banned in Europe, and the few exceptions need to be clearly labeled?
You must be talking about the USA.
Against popular believe most people don't live in the USA.
In the second Iraq war an idiotic Patriot commander shot down a landing british tornado and killed both pilots.
There never was such a sig at the Auschwitz camp.
Hundreds of german officers got executed after military tribunals in Nurnberg because they commanded mass killings of Jews or prisoners of war. The internet is full with videos about it as the killers where actually proud about doing their job.
Get a life, idiot.
Of course it is ...
The rest are close to trivial engineering problems.
There is no difference to creating an empty air less tube, or having a submarine dive mere ten meters deep.
Exact the same pressure difference.
The Germans are nothing if not meticulous and weren't of the type to follow verbal orders, processes would have been created, documented, passed along the chain of command, etc. There would be evidence of this, but there isn't.
That is wrong. It is all documented. There is plenty of evidence. Want to come to a german town? We are plastering brass stones in front of every house where a jew lived. With the name and date he was killed on it. Alone in my town of ~350,000 inhabitants we thousands of those stones in the streets.
You must be living in a kind of distorted reallity.
You are a kind of idiot?
There was no significant amount of jews that emigrated. Explain me how you emigrate from a country like Poland that is conquered by the germans?`
The Nazis kept book aboout what they "stole" from the Jews before they killed them, they kept book about every incident, arrival in a KZ, death etc.
When we Germans *know* that we have killed ~6 Millions of jews, then I really wonder what your mental problem is to be live it.
There are no bones to be found in the amounts that would be necessary to corroborate the claimed amounts killed.
That is bollocks for several reasons:
a) in KZsa they mostly got cremated
b) most of the mass graves of killings outside of the KZs are not even found yet
Not enough hyperloop nutters to lobby the government?
No, Switzerland is bottom line to small to make it a reasonable investment.
Germany already has high speeed trains and a "hyperloop" would only be roughly twice as fast.
On the other hand: the USA has no high speed train/rail network, hence: it is a very good idea, and you are jsut an anti tech moron.
We're far, far more likely to go to the Moon again than build a working hyperloop. Fantasize all you like, but it's not going to happen. You seem not to grasp how simple the construction of a hyperloop is, rofl.