SE4337HW1

.docx

School

University of Houston *

*We aren’t endorsed by this school

Course

3313

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

7

Uploaded by f34xqg5ow0e

Aadarsha Dhungel June 1, 2023 SE4337.0U1 Assignment #1 1. [5 points] What is your opinion of the argument that languages that are too complex are too dangerous to use and we should therefore keep all languages small and simple? Some claim that using programming languages that are excessively complicated is risky. They claim that more complicated languages are harder to learn and comprehend, which can result in coding errors. Furthermore, they assert that flaws have a greater chance of occurring in languages that are more sophisticated. This argument, in my opinion, has some merit. This does not, in my opinion, imply that we should all use small, straightforward programming languages. In many situations, a more complicated language is required to produce the desired effects. For instance, a language made for developing complicated applications will need to be more sophisticated than one made for producing straightforward scripts. The greatest strategy, in my opinion, is to strike a balance between simplicity and complexity. A language that is too complicated could be challenging to learn and use, while a language that is too simple might not be able to express the desired ideas. The best method to achieve this balance is to take the project's particular requirements into account. To conclude, utilizing complicated programming languages has both advantages and disadvantages. The best option for a given project will rely on the requirements of that project specifically. 2. [5 points] Based on your own experience, is Java a good choice to be the first programming language to start with? Explain why. Java is an excellent choice for a novice since it is object-oriented, platform-independent, has a huge community, and is in great demand. It does, however, have several drawbacks, including verbose syntax and dependency on garbage collection. A well-liked programming paradigm called object-oriented programming teaches you how to think of software development in terms of objects. Because Java is platform-independent, it may be used on any computer, regardless of its operating system. A huge community implies that there are numerous resources, like books, tutorials, and forums, that may be used to learn Java. Java developers have a lot of employment options thanks to high demand. Java code may be lengthy and challenging to read due to its syntax. The Java Virtual Machine (JVM) maintains memory automatically when garbage collection is used, which might affect performance. Considering all its benefits, Java is a wonderful choice for a beginning. Before you begin learning Java, you should be aware of its drawbacks. The programming language that most appeals to you is ultimately the best one to learn first.
3. [5 points] List all the computer programming languages you learned in chronological order. Which is your strongest language? Which one do you like most and which one do you hate most? Explain why. Here’s the list of all the programming languages I learned in chronological order: C++ Python Java C JavaScript Python is, in my opinion, my strongest language. Python appeals to me because it is simple to learn and use and provides a variety of modules and frameworks that make it simple to create many kinds of apps. Python is a general-purpose language, which I appreciate because it allows me to utilize it for a range of projects. JavaScript is the language of my choice. JavaScript is my favorite web language since it can be used to build interactive web sites and web applications. JavaScript is a dynamically typed language, which means that I do not have to bother about defining the kinds of variables, which is another benefit that I appreciate. C is my least preferred language. Because C is a low-level language and requires me to worry about topics like memory management and data structures, I do not like it. It can be challenging to comprehend and write C code since I feel C to be a highly verbose language. 4. [5 points] Many programming languages distinguish between uppercase and lowercase letters in user-defined names. What are the pros and cons of this design decision? Advantages of using uppercase and lowercase letters differently in user-defined names: 1. Increased readability: By graphically differentiating between various name kinds, it helps make code more readable and understandable. Variables can be written in lowercase, functions in mixed case, and constants can be written entirely in capital letters. This can make it easier for programmers to understand the function of various code segments. 2. Improved code structure: By enabling programmers to group similar names together, it can aid in improving the organization of code. The code may become more modular and simpler to maintain, for instance, by writing all constants used in a specific function in all uppercase letters. 3. Error reduction: By making it harder to unintentionally type the wrong name, errors may be reduced. For instance, it is less probable that a programmer will unintentionally type MyVariable or myvariable if the variable is named myVariable. This can aid in enhancing the code's quality and lowering the number of defects.
Disadvantages of using uppercase and lowercase letters differently in user-defined names: 1. Increased complexity: By forcing programmers to understand the difference between capital and lowercase letters, it might make the language more complex. For novices, this may make learning and using the language more challenging. 2. Reduced flexibility: By reducing the number of names that can be used, it can make the language less flexible. For instance, it is not possible to use uppercase letters for variables if a language only permits lowercase characters in variable names. Because of this, it could be more challenging to write code that adheres to accepted standards. 3. Increased maintenance costs: By making it more challenging to refactor and update code, it might raise the maintenance costs of code. For instance, if a variable is changed, all references to it must likewise be changed. This method can be laborious and prone to mistakes. 5. [5 points] Explain what "operator overloading" means with examples. Give at least two examples of operator overloading. Some programming languages provide a feature called operator overloading that enables programmers to specify how operators behave for user-defined data types. In addition to enabling programmers to create bespoke operations that are not possible with the built-in operators, this can make code more condensed and legible. Two instances of operator overload are given below: - The + operator can be overloaded in the C++ programming language to add two objects of any type. For illustration, the code below would add two Point objects: Point p1(10, 20); Point p2(30, 40); Point p3 = p1 + p2; - The in operator in the Python programming language can be overloaded to determine whether a value is contained in a user-defined object. For instance, the code below would determine whether the List object my_list contains the value 10: my_list = [1, 2, 3, 4, 5] if 10 in my_list: print("10 is in the list") else: print("10 is not in the list")
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help