Aspects of Coral Programming

Using functions in coral is very useful when creating programs that require their specific input. Using the current case where the manager does not need to waste time creating a coral program to send pictures, breaking the program together with the algorithms used is necessary. This shows the first advantage of using functions rather than modular programming (Cawkwell et al., 2018). The program can be split into small parts that can be managed by several people, making it easy for the program to be handled by several individuals. Secondly, debugging a program created using functions is easy because the program code is independent and composed of subprograms. Thirdly, using functions in a program is suitable, especially when avoiding repetitions. There are cases where a code has to be repeated on various program sections when using modules. However, with function, the codes require only to be called, and it performs the required task in the program. Lastly, using libraries makes it easy for program functions to be used in several programs.

Responding to Nyeshias post, there are six key components of a function in coral. These include modifiers, return type, method name, the list of parameters in parenthesis, the exception list, and the body of the method enclosed in braces. Firstly, the modifier declares whether the program code is private or public. Secondly, the return type determines the value or output displayed by the function; this can be void when the function lacks the value to be returned. Thirdly, the method name provides the field names rules that are applied to the function (Cawkwell et al., 2018).

Fourthly, the list of parameters in parenthesis is a list of parameters inputted in a comma-delimited format enclosed within parenthesis. The data types are before the list, and empty parenthesis is used when the parameters are missing. Fifthly the exception list is used when exclusion is required in a program function. Lastly, the body of the function enclosed in braces provides the location for the codes and the local variables.

Reference

Cawkwell, R., Miller, S., Austin, J., & Bowers, M. (2018). Coral Programming Language Reference Manual. Web.

Java as a Programming Language: Creating an App

Before a computer program can be executed, it must be created and compiled. Any text editor or IDE is used to edit the Java source code. The extension of the file should be.java, while the file name should reflect the term used in the public class line. The next step when creating a program is to compile the code: the JDK package must be installed on the machine. The compiler converts the source code file into a Java bytecode file  it generates a file with the.class extension. Finally, it starts the procedure to execute the computer code. Any platform with JVM, which is an interpreter, is used for this purpose. The virtual Java machine gradually translates individual bytecode instructions into the target machine language code. In other words, a.java file is initially saved, which is converted into a.class at compile-time and then executed by an interpreter.

Three types of errors that occur when creating Java programs are syntactic, runtime, and logical. The first type of error is related to incorrectly typed text code, which is expressed in incorrect punctuation or use of undefined variables (Errors, n.d.). The runtime errors occur when the base code detects an event it cannot handle appropriately. Logical errors are the most difficult to detect because they are not detected by either the compiler or JVM. Such errors are usually tied to inattention or incorrect prioritization of operators. The code shown in Figure 1 produces four different responses because the brackets are set in the wrong way.

 Example of a logical error (Mueller, n.d.)
Figure 1. Example of a logical error (Mueller, n.d.)

A virtual Java machine is a critical component of the platform. Since virtual machines are available for many hardware and software machines, Java can be seen as both a binding software and a stand-alone platform. For this reason, using the same bytecode for many devices allows Java to be described as a universal programming language. The main advantages of this language are its objectivity orientation. The data structure becomes an object that can be controlled to create relationships between different parts. In addition, Java is noticeably more for a beginner because the syntax is similar to a human language. Moreover, Java has a security manager, created for each application to establish access rules: this ensures that the Java application will run in such a way as to avoid vulnerabilities. Finally, the absolute advantage of the Java language is cross-platform.

References

Errors. (n.d.) Web.

Mueller, J. (n.d.). Logical errors in Java.

Object-Oriented vs Procedural Programming Paradigms

Procedural programming and Object-oriented programming (OOP) are two paradigms in programming. They are fundamentally different in how they approach problem-solving and organizing programs. Under procedural programming, a program is organized as a step-by-step instruction to solve a problem. The instructions are executed linearly, but they can include elements that control the flow of a program, such as loops or decision trees (Ahmed & Prasad, 2016). These elements make it possible to divide the program into sub-programs, called procedures or functions, and reuse code (Jog, 2017; Rai, 2019). While this makes procedural programming more intuitive and easy to maintain, its applicability to larger projects is limited (Rai, 2019). Nonetheless, procedural programming is often used for scripts that connect various parts of larger programming projects and database programming (Ahmed & Prasad, 2016). Procedural programming is an older paradigm that is relevant for smaller projects, various kinds of scripting.

OOP is a paradigm that expands upon procedural programming; instructions and data are combined into blocks called objects. Objects can exchange data and interact with one another but are generally designed with a distinct purpose (Rai, 2019). Objects are created from a template, called a class, which supports inheritance, meaning that a parents properties and behavior can be extended without altering its functionality (Rai, 2019). This improves the reusability of OOP code, thus allowing more complicated programs to be built under OOP. Furthermore, OOP projects are easier to divide into blocks that can be developed by multiple specialists in parallel or modify individual components without affecting others (Rai, 2019). However, this approach requires better planning and coordination between the people working on it (Rai, 2019). Furthermore, since individual components can take more time to develop under OOP, they can be less suitable for smaller-scale projects (Ahmed & Prasad, 2016). Thus, OOP may be necessary for complex projects, especially where multiple components must interact with one another, but retain a degree of independent operability.

References

  1. Ahmed, A,. & Prasad, B. (2016). Foundations of Software Engineering. Boca Raton, FL: CRC Press.
  2. Barner, C. (2012). Social media and communication. New York, NY: Sage.
  3. Jog, T. M. (2017). Reactive Programming with Java 9: Build Asynchronous applications with Rx.Java 2.0, Flow API and Spring WebFlux. Birmingham, UK: Packt Publishing.
  4. Rai, L. (2019). Programming in C++: Object Oriented Features. Berlin, Germany: Walter de Gruyter GmbH & Co KG.