Since now we know the fundamentals about strings and their structure, it is time to learn about the various operations we can perform on them. The simplest of these operation is concatenation, or joining two or more strings together and obtaining a new string as a result.… Read more
Concatenation
April 21st, 2017Strings
April 21st, 2017So far, we have often used Console.ReadLine() in our Console programs, in order to get some text input from the user. Whenever we needed to use that text (and even inspecting the Console.ReadLine() method signature), we needed to store that text in a string variable type.… Read more
Recursive functions
April 20th, 2017Recursion is a mathematical concept that defines any object that is contained or defined by itself. That should be the official, academic definition. In simple words, recursive functions are functions that make a call to themselves from within their own body, in order to solve a problem.… Read more
Best practices when using methods and functions
April 19th, 2017There are two main reasons why methods and functions are even used. First one, which I already mentioned in a few of the previous posts, is code re-usability. The second is modularization of the code, splitting of complex tasks into smaller sub-tasks, which can offer us a better overview of the entire functionality.… Read more
Return operator
April 18th, 2017In few of our previous lessons, we used functions – methods that not only can be called, perform some action, but also return a value to the caller – the piece of code that called them. You can imagine this as placing the returned value in the place where the function was invoked from.… Read more
Methods and functions signature
April 17th, 2017I talked in the previous lesson about methods and functions signatures, and I offered there a brief explanation on the topic. It is time to explain this new concept in more detail. At a basic level, there are only two things that are mandatory to specify a method or function signature: the parameters type and the order in which the parameters are listed.… Read more
Functions and methods overloading
April 17th, 2017There are times when we have functions or methods that perform basically the same thing, but use different kind of parameters. So, in other words, there are cases when we have methods with the same name, but with different signatures.… Read more
Optional parameters
April 16th, 2017When I explained functions and methods parameters, I said that we can use them to send different values that our methods and functions can use in their calculations. You should also know that methods and functions can have optional parameters, parameters with a default value, which can be skipped when calling a method or function.… Read more
Execution workflow
April 15th, 2017Whenever a method executes, it takes control over execution workflow of the program. However, if in the caller method we call yet another method, the execution is transferred to this new method, until it’s code is executed, and when that finishes, the execution control is returned to the first calling method.… Read more
Variable Scope
April 15th, 2017A very important concept in programming is what we call variable scope. Though this concept should have been explained when I explained variables, it wouldn’t have made much sense back then, because it was relying on stuff we did not yet explain.… Read more