SlideShare a Scribd company logo
Scope is much less complicated if functions cannot contain other function definitions (C++,
Java: cannot; Ada, Pascal, Ada, Python, Ruby, Lisp: can). Give one good reason why functions
should not contain other function definitions. Give one good reason why it should be allowed.
Solution
A function is the smallest block of code to perform a specific task. Which can be independently
invoked.
The variable defined in a function are available only to that block not to the whole program
which gives abstraction.
the scope and life of variable defined in the funciton are available only when it is invoked, which
saves memory as well.
b.
To keep a function isolated. It's only used inside the function which is invoked i.e. one place.
when it's locally used why define globally.It's just another way of breaking down a big function
into smaller pieces without affecting the global namespace with another function name. Quite
often the inner function isn't a stand-alone so doesn't rightfully belong in the global namespace.

More Related Content

Similar to Scope is much less complicated if functions cannot contain other func.pdf

20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
Gradeup
 
Functions in Python Syntax and working .
Functions in Python Syntax and working .Functions in Python Syntax and working .
Functions in Python Syntax and working .
tarunsharmaug23
 
Inheritance
InheritanceInheritance
Inheritance
Jaya Kumari
 
Viva file
Viva fileViva file
Viva file
anupamasingh87
 
Python Functions
Python FunctionsPython Functions
Python Functions
Sampad Kar
 
Why Functional Programming So Hard?
Why Functional Programming So Hard?Why Functional Programming So Hard?
Why Functional Programming So Hard?
Ilya Sidorov
 
C++ unit-2-part-3
C++ unit-2-part-3C++ unit-2-part-3
C++ unit-2-part-3
Jadavsejal
 
Function in C++
Function in C++Function in C++
Function in C++
NainaKhan28
 
Function in C++
Function in C++Function in C++
Function in C++
NainaKhan29
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programming
samthemonad
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
Jeevan Acharya
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using ReflectionGanesh Samarthyam
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Synesso
 
About Functional Programming
About Functional ProgrammingAbout Functional Programming
About Functional Programming
Aapo Kyrölä
 
Using RequireJS for Modular JavaScript Code
Using RequireJS for Modular JavaScript CodeUsing RequireJS for Modular JavaScript Code
Using RequireJS for Modular JavaScript Code
Thomas Lundström
 
Python-DataAbstarction.pptx
Python-DataAbstarction.pptxPython-DataAbstarction.pptx
Python-DataAbstarction.pptx
Karudaiyar Ganapathy
 
Java 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the GalleryJava 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the Gallerynjbartlett
 
c.p function
c.p functionc.p function
c.p function
giri5624
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
Amresh Raj
 

Similar to Scope is much less complicated if functions cannot contain other func.pdf (20)

20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
 
Functions in Python Syntax and working .
Functions in Python Syntax and working .Functions in Python Syntax and working .
Functions in Python Syntax and working .
 
Inheritance
InheritanceInheritance
Inheritance
 
Viva file
Viva fileViva file
Viva file
 
Python Functions
Python FunctionsPython Functions
Python Functions
 
Why Functional Programming So Hard?
Why Functional Programming So Hard?Why Functional Programming So Hard?
Why Functional Programming So Hard?
 
C++ unit-2-part-3
C++ unit-2-part-3C++ unit-2-part-3
C++ unit-2-part-3
 
Function in C++
Function in C++Function in C++
Function in C++
 
Function in C++
Function in C++Function in C++
Function in C++
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programming
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
 
Books
BooksBooks
Books
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
About Functional Programming
About Functional ProgrammingAbout Functional Programming
About Functional Programming
 
Using RequireJS for Modular JavaScript Code
Using RequireJS for Modular JavaScript CodeUsing RequireJS for Modular JavaScript Code
Using RequireJS for Modular JavaScript Code
 
Python-DataAbstarction.pptx
Python-DataAbstarction.pptxPython-DataAbstarction.pptx
Python-DataAbstarction.pptx
 
Java 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the GalleryJava 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the Gallery
 
c.p function
c.p functionc.p function
c.p function
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 

More from arshin9

Bats rely on sound localization to be able to fly during the night. O.pdf
Bats rely on sound localization to be able to fly during the night. O.pdfBats rely on sound localization to be able to fly during the night. O.pdf
Bats rely on sound localization to be able to fly during the night. O.pdf
arshin9
 
A layer of dirt must be spread over a circular area 13.5 feet in dia.pdf
A layer of dirt must be spread over a circular area 13.5 feet in dia.pdfA layer of dirt must be spread over a circular area 13.5 feet in dia.pdf
A layer of dirt must be spread over a circular area 13.5 feet in dia.pdf
arshin9
 
Discuss the impact that the tonnage of sulfur or sulfuric acid recov.pdf
Discuss the impact that the tonnage of sulfur or sulfuric acid recov.pdfDiscuss the impact that the tonnage of sulfur or sulfuric acid recov.pdf
Discuss the impact that the tonnage of sulfur or sulfuric acid recov.pdf
arshin9
 
You have decided to go to graduate school for Molecular Biology (yay!.pdf
You have decided to go to graduate school for Molecular Biology (yay!.pdfYou have decided to go to graduate school for Molecular Biology (yay!.pdf
You have decided to go to graduate school for Molecular Biology (yay!.pdf
arshin9
 
write the HTML to associate a web page with an external style sheet .pdf
write the HTML to associate a web page with an external style sheet .pdfwrite the HTML to associate a web page with an external style sheet .pdf
write the HTML to associate a web page with an external style sheet .pdf
arshin9
 
Why was any carbon-containing molecule originally called organic.pdf
Why was any carbon-containing molecule originally called organic.pdfWhy was any carbon-containing molecule originally called organic.pdf
Why was any carbon-containing molecule originally called organic.pdf
arshin9
 
Which of the following is true about indexes and index design a. in.pdf
Which of the following is true about indexes and index design  a. in.pdfWhich of the following is true about indexes and index design  a. in.pdf
Which of the following is true about indexes and index design a. in.pdf
arshin9
 
Write a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdfWrite a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdf
arshin9
 
What kind of organisms likely perished due to the increase of oxygen .pdf
What kind of organisms likely perished due to the increase of oxygen .pdfWhat kind of organisms likely perished due to the increase of oxygen .pdf
What kind of organisms likely perished due to the increase of oxygen .pdf
arshin9
 
what is the HTTP protocol used for What are its major parts.pdf
what is the HTTP protocol used for What are its major parts.pdfwhat is the HTTP protocol used for What are its major parts.pdf
what is the HTTP protocol used for What are its major parts.pdf
arshin9
 
What is the between facial action unit and facial landmark differenc.pdf
What is the between facial action unit and facial landmark differenc.pdfWhat is the between facial action unit and facial landmark differenc.pdf
What is the between facial action unit and facial landmark differenc.pdf
arshin9
 
What are contemporary management challenges and opportunitiesSo.pdf
What are contemporary management challenges and opportunitiesSo.pdfWhat are contemporary management challenges and opportunitiesSo.pdf
What are contemporary management challenges and opportunitiesSo.pdf
arshin9
 
Valinomycin is a potassium ionophore. What would be its effect on in.pdf
Valinomycin is a potassium ionophore. What would be its effect on in.pdfValinomycin is a potassium ionophore. What would be its effect on in.pdf
Valinomycin is a potassium ionophore. What would be its effect on in.pdf
arshin9
 
The retrovirus genome is made of the nucleic acid before the virus be.pdf
The retrovirus genome is made of the nucleic acid before the virus be.pdfThe retrovirus genome is made of the nucleic acid before the virus be.pdf
The retrovirus genome is made of the nucleic acid before the virus be.pdf
arshin9
 
the probability that it is raining is .25. the orbability that it is.pdf
the probability that it is raining is .25. the orbability that it is.pdfthe probability that it is raining is .25. the orbability that it is.pdf
the probability that it is raining is .25. the orbability that it is.pdf
arshin9
 
2)In presentation software, you can use a(n) ____ to add movement to.pdf
2)In presentation software, you can use a(n) ____ to add movement to.pdf2)In presentation software, you can use a(n) ____ to add movement to.pdf
2)In presentation software, you can use a(n) ____ to add movement to.pdf
arshin9
 
Significance of Discoveries in Genetics and DNA Our understandin.pdf
Significance of Discoveries in Genetics and DNA Our understandin.pdfSignificance of Discoveries in Genetics and DNA Our understandin.pdf
Significance of Discoveries in Genetics and DNA Our understandin.pdf
arshin9
 
Refer to the drawings in Figure 13.2 of a single pair of homologous c.pdf
Refer to the drawings in Figure 13.2 of a single pair of homologous c.pdfRefer to the drawings in Figure 13.2 of a single pair of homologous c.pdf
Refer to the drawings in Figure 13.2 of a single pair of homologous c.pdf
arshin9
 
Prions are viruses that cause proteins to misfold. Select one True.pdf
Prions are viruses that cause proteins to misfold.  Select one  True.pdfPrions are viruses that cause proteins to misfold.  Select one  True.pdf
Prions are viruses that cause proteins to misfold. Select one True.pdf
arshin9
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
arshin9
 

More from arshin9 (20)

Bats rely on sound localization to be able to fly during the night. O.pdf
Bats rely on sound localization to be able to fly during the night. O.pdfBats rely on sound localization to be able to fly during the night. O.pdf
Bats rely on sound localization to be able to fly during the night. O.pdf
 
A layer of dirt must be spread over a circular area 13.5 feet in dia.pdf
A layer of dirt must be spread over a circular area 13.5 feet in dia.pdfA layer of dirt must be spread over a circular area 13.5 feet in dia.pdf
A layer of dirt must be spread over a circular area 13.5 feet in dia.pdf
 
Discuss the impact that the tonnage of sulfur or sulfuric acid recov.pdf
Discuss the impact that the tonnage of sulfur or sulfuric acid recov.pdfDiscuss the impact that the tonnage of sulfur or sulfuric acid recov.pdf
Discuss the impact that the tonnage of sulfur or sulfuric acid recov.pdf
 
You have decided to go to graduate school for Molecular Biology (yay!.pdf
You have decided to go to graduate school for Molecular Biology (yay!.pdfYou have decided to go to graduate school for Molecular Biology (yay!.pdf
You have decided to go to graduate school for Molecular Biology (yay!.pdf
 
write the HTML to associate a web page with an external style sheet .pdf
write the HTML to associate a web page with an external style sheet .pdfwrite the HTML to associate a web page with an external style sheet .pdf
write the HTML to associate a web page with an external style sheet .pdf
 
Why was any carbon-containing molecule originally called organic.pdf
Why was any carbon-containing molecule originally called organic.pdfWhy was any carbon-containing molecule originally called organic.pdf
Why was any carbon-containing molecule originally called organic.pdf
 
Which of the following is true about indexes and index design a. in.pdf
Which of the following is true about indexes and index design  a. in.pdfWhich of the following is true about indexes and index design  a. in.pdf
Which of the following is true about indexes and index design a. in.pdf
 
Write a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdfWrite a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdf
 
What kind of organisms likely perished due to the increase of oxygen .pdf
What kind of organisms likely perished due to the increase of oxygen .pdfWhat kind of organisms likely perished due to the increase of oxygen .pdf
What kind of organisms likely perished due to the increase of oxygen .pdf
 
what is the HTTP protocol used for What are its major parts.pdf
what is the HTTP protocol used for What are its major parts.pdfwhat is the HTTP protocol used for What are its major parts.pdf
what is the HTTP protocol used for What are its major parts.pdf
 
What is the between facial action unit and facial landmark differenc.pdf
What is the between facial action unit and facial landmark differenc.pdfWhat is the between facial action unit and facial landmark differenc.pdf
What is the between facial action unit and facial landmark differenc.pdf
 
What are contemporary management challenges and opportunitiesSo.pdf
What are contemporary management challenges and opportunitiesSo.pdfWhat are contemporary management challenges and opportunitiesSo.pdf
What are contemporary management challenges and opportunitiesSo.pdf
 
Valinomycin is a potassium ionophore. What would be its effect on in.pdf
Valinomycin is a potassium ionophore. What would be its effect on in.pdfValinomycin is a potassium ionophore. What would be its effect on in.pdf
Valinomycin is a potassium ionophore. What would be its effect on in.pdf
 
The retrovirus genome is made of the nucleic acid before the virus be.pdf
The retrovirus genome is made of the nucleic acid before the virus be.pdfThe retrovirus genome is made of the nucleic acid before the virus be.pdf
The retrovirus genome is made of the nucleic acid before the virus be.pdf
 
the probability that it is raining is .25. the orbability that it is.pdf
the probability that it is raining is .25. the orbability that it is.pdfthe probability that it is raining is .25. the orbability that it is.pdf
the probability that it is raining is .25. the orbability that it is.pdf
 
2)In presentation software, you can use a(n) ____ to add movement to.pdf
2)In presentation software, you can use a(n) ____ to add movement to.pdf2)In presentation software, you can use a(n) ____ to add movement to.pdf
2)In presentation software, you can use a(n) ____ to add movement to.pdf
 
Significance of Discoveries in Genetics and DNA Our understandin.pdf
Significance of Discoveries in Genetics and DNA Our understandin.pdfSignificance of Discoveries in Genetics and DNA Our understandin.pdf
Significance of Discoveries in Genetics and DNA Our understandin.pdf
 
Refer to the drawings in Figure 13.2 of a single pair of homologous c.pdf
Refer to the drawings in Figure 13.2 of a single pair of homologous c.pdfRefer to the drawings in Figure 13.2 of a single pair of homologous c.pdf
Refer to the drawings in Figure 13.2 of a single pair of homologous c.pdf
 
Prions are viruses that cause proteins to misfold. Select one True.pdf
Prions are viruses that cause proteins to misfold.  Select one  True.pdfPrions are viruses that cause proteins to misfold.  Select one  True.pdf
Prions are viruses that cause proteins to misfold. Select one True.pdf
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

Scope is much less complicated if functions cannot contain other func.pdf

  • 1. Scope is much less complicated if functions cannot contain other function definitions (C++, Java: cannot; Ada, Pascal, Ada, Python, Ruby, Lisp: can). Give one good reason why functions should not contain other function definitions. Give one good reason why it should be allowed. Solution A function is the smallest block of code to perform a specific task. Which can be independently invoked. The variable defined in a function are available only to that block not to the whole program which gives abstraction. the scope and life of variable defined in the funciton are available only when it is invoked, which saves memory as well. b. To keep a function isolated. It's only used inside the function which is invoked i.e. one place. when it's locally used why define globally.It's just another way of breaking down a big function into smaller pieces without affecting the global namespace with another function name. Quite often the inner function isn't a stand-alone so doesn't rightfully belong in the global namespace.