<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: hepisec</title>
    <description>The latest articles on DEV Community by hepisec (@hepisec).</description>
    <link>https://dev.to/hepisec</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2167%2F15111012.png</url>
      <title>DEV Community: hepisec</title>
      <link>https://dev.to/hepisec</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hepisec"/>
    <language>en</language>
    <item>
      <title>Choosing a programming language for bloody Beginners</title>
      <dc:creator>hepisec</dc:creator>
      <pubDate>Wed, 08 Aug 2018 12:46:43 +0000</pubDate>
      <link>https://dev.to/hepisec/chosing-a-programming-language-for-bloody-beginners-3j4d</link>
      <guid>https://dev.to/hepisec/chosing-a-programming-language-for-bloody-beginners-3j4d</guid>
      <description>&lt;p&gt;This post is a sequel to my post 'Programming for bloody Beginners' and will give you an overview on types of programming languages, their purposes and finally how to chose the language to learn.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/hepisec" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2167%2F15111012.png" alt="hepisec"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/hepisec/programming-for-bloody-beginners-45ia" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Programming for bloody Beginners&lt;/h2&gt;
      &lt;h3&gt;hepisec ・ May 18 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#learn&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programminglanguage&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;On &lt;a href="https://en.wikipedia.org/wiki/List_of_programming_languages" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt; you can find a list with several hundred programming languages. Some of them you may have heard of, others have funny names like 'Brainfuck' and probably the most ones are completely unknown to you.&lt;/p&gt;

&lt;p&gt;But what is the difference between all these languages?&lt;/p&gt;

&lt;p&gt;You need to know that there are basically two kinds of programming languages. These are compiled languages and interpreted languages. Before you can run a program written in a compiled language you have to compile the program. That means that the human readable source code of your program gets translated to machine code, which your computer can understand. We call this machine code the executable (e.g. an .exe file on Windows systems).&lt;/p&gt;

&lt;p&gt;On the other hand an interpreted language requires an additional program to execute your code on your computer. This program is called the interpreter. The interpreter reads the program code and executes its statements.&lt;/p&gt;

&lt;p&gt;You might hear the term scripting language as a synonym for an interpreted language and the term script as a synonym for a program written in a scripting language.&lt;/p&gt;

&lt;p&gt;So why do these two kinds of programming languages exist?&lt;/p&gt;

&lt;p&gt;Both types have their advantages and disadvantages.&lt;/p&gt;

&lt;p&gt;Programs written in a compiled language have to be compiled for each targeted computer platform (e.g. for Windows, macOS and Linux). That is because of the different file formats being used for executables on these platforms. It may also be necessary to compile the program dependent on the targeted hardware (e.g. a x86 CPU in your laptop requires another executable than the ARM CPU in your phone). So the distribution of our program may become complicated. But when we have mastered this complexity, we gain an incredible performance of our program. And typically you do not target all platforms and hardware configurations as you write your program to solve a certain problem, which may only exist on a certain platform.&lt;/p&gt;

&lt;p&gt;So when we exactly know the execution environment of our program, we should chose a compiled language to have the best performance available.&lt;/p&gt;

&lt;p&gt;For interpreted languages someone has already taken the efforts to compile the interpreter for many different platforms and you only have to distribute your source code file. But the process of reading and interpreting the file on every program execution can not be as fast as a compiled program. While due to some optimizations in the interpreter you won't notice much difference during the normal program usage, you will at least notice a difference during the program startup. This is when the interpreter has to read all your program code, a step which is not necessary for a compiled program.&lt;/p&gt;

&lt;p&gt;You don't know on which platform your program will be used or you want to target a broad audience? An interpreted language is the right choice for you.&lt;/p&gt;

&lt;h1&gt;
  
  
  Type-safe vs. weakly typed languages
&lt;/h1&gt;

&lt;p&gt;There wouldn't be as many languages today if programmers only had to chose between a compiled or interpreted language. Another important difference between language is the type system. You can basically distinguish between two type systems: type-safe and weakly typed.&lt;/p&gt;

&lt;p&gt;In a type-safe language your variables, function parameters and return values are declared with a certain type. This helps the computer to run the program with efficient memory management. And with type-safety you are less prone to certain kinds of software bugs. But its another feature which adds complexity. You need to know the range of the values you want to store in a variable to chose the correct type. E.g. most languages have different integer types with a different size in memory and thus a different range of integers, which can be stored. Usually integer types are available in 8 bits (called a byte), 16 bits (small), 32 bits (int) and 64 bits (long). In some languages you might also need to declare whether the type is signed (supports negative values) or unsigned (positive values only). As the sign (+ or -) is stored in the left most bit of your variables memory, you lose one bit to store your actual number. The following table shows typical integer types and ranges.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fvrm9cueskb42wvs58670.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fvrm9cueskb42wvs58670.png" alt="typical integer types and ranges"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same goes for floating point numbers (types called float or double) and others. The type-safety often requires conversion between different types, e.g. to compare two values both must be from the same type. In a weakly typed language you can do something like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (1 == "1") then [...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This actually compares the integer 1 with the string "1", which are differently stored in memory. But a weakly typed language automatically performs a conversion to a common type. In a type-safe language the code would look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (1 == parseInt("1")) then [...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function &lt;code&gt;parseInt&lt;/code&gt; in this example takes a string parameter and after its conversion it returns an integer, which is then compared with the integer on the left side.&lt;/p&gt;

&lt;p&gt;If you want an easy to learn language, you should start with a weakly typed language. But if you are not afraid of complex type systems, go with a type-safe language.&lt;/p&gt;

&lt;p&gt;(weakly typed languages usually have other pitfalls than required type conversion)&lt;/p&gt;

&lt;h1&gt;
  
  
  Memory-safe vs. memory unsafe languages
&lt;/h1&gt;

&lt;p&gt;One more feature to check is memory-safety. A memory-safe language takes care of managing all the memory your program requires to run. That means you don't have to care much about the size of your types and data, which you store in memory during the program execution. This makes learning a language very handy. With a memory unsafe language you have to code the memory management on your own. This might be helpful for performance critical programs but in most cases such self coded memory management is prone to security vulnerabilities and requires some experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  Programming paradigm
&lt;/h1&gt;

&lt;p&gt;With only 3 options to chose from we still wouldn't have several hundred programming languages. But programming languages are not only created considering the 3 features discussed before. Another very important feature of a programming language is the programming paradigm. It defines how your code is organized. E.g. you could write object oriented code where you define classes with methods and properties or you write procedural code which is executed more or less "from top to bottom" or functional code, where every statement is a function. There are many different programming paradigms, but I'm mostly used to object oriented code. During your career as a developer you'll build your own preference.&lt;/p&gt;

&lt;h1&gt;
  
  
  Examples
&lt;/h1&gt;

&lt;p&gt;Now we have heard of enough features of a programming language to create a variety of languages. Here are some examples of popular languages and which features they use.&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP
&lt;/h2&gt;

&lt;p&gt;PHP is my current language of choice for web projects. It is an interpreted language and the interpreter is available on almost any platform. It is typically used in server-side applications. PHP is weakly typed, memory-safe and supports procedural programming style as well as object oriented code. With newer versions the PHP community enforces more type safety within the language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Java
&lt;/h2&gt;

&lt;p&gt;Java is my preferred language for client-side applications. It's kind of a hybrid language as the code is compiled but it still requires a host application to run the program (that is called the JVM - Java Virtual Machine). So you can compile your application once and run it everywhere where a JVM is available (almost anywhere). Java is type- and memory-safe and strictly object oriented. The JVM abstracts system specific behavior, therefore Java is well suited for platform independent applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript
&lt;/h2&gt;

&lt;p&gt;JavaScript has no relation to Java. As you can guess from the name, it is a scripting language. You are currently using the default JavaScript interpreter of any desktop system, your web browser. So all you need to get started writing a "Hello World" application in JavaScript is a text editor and your web browser. It is a weakly typed memory-safe language and supports different programming paradigms, including procedural, functional and object oriented.&lt;/p&gt;

&lt;h2&gt;
  
  
  C
&lt;/h2&gt;

&lt;p&gt;C is a compiled language, which is memory-unsafe and type-safe. If you want to write applications for normal users with a graphical user interface, you typically won't choose C. But if you want to develop hardware drivers or very performance critical algorithms, C is the language of your choice. It's a procedural language and has an object oriented descendant called C++.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This post should give you an overview about basic differences between programming languages and hopefully you are now able to pick a language to learn.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learn</category>
      <category>programminglanguage</category>
    </item>
    <item>
      <title>Programming for bloody Beginners</title>
      <dc:creator>hepisec</dc:creator>
      <pubDate>Fri, 18 May 2018 19:35:06 +0000</pubDate>
      <link>https://dev.to/hepisec/programming-for-bloody-beginners-45ia</link>
      <guid>https://dev.to/hepisec/programming-for-bloody-beginners-45ia</guid>
      <description>

&lt;p&gt;I made my first steps in coding about 20 years ago. I can remember that I’ve created websites using WYSIWYG editors (What you see is what you get - graphical web page builders) and had a few books on certain programming topics (HTML, Perl, later PHP, Java, MySQL and so on).&lt;/p&gt;

&lt;p&gt;Now, tens of thousands of lines of code, months of debugging and countless hours of programming later, I have the opportunity to teach an apprentice in software development. Before the apprenticeship will start in August, he took a one week internship with me to find out whether programming is the right choice for his future work life. He had no prior knowledge and watching him writing code showed me some essential lessons, which are missing in most coding tutorials.&lt;/p&gt;

&lt;p&gt;These missing lessons will be discussed in this post.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lesson 1:
&lt;/h1&gt;

&lt;h2&gt;
  
  
  What’s the purpose of a programming language?
&lt;/h2&gt;

&lt;p&gt;With a programming language you can tell a computer what he has to do. Usually you have a certain problem. It doesn’t matter whether its a mathematical problem or a real life problem like remembering your grocery list. Using a programming language you can solve this problem using the seemingly unlimited computing power which is available today. As there are many very different problems in the world which want to get solved, there are also many different programming languages which may be more or less suitable to solve a certain problem. But there are a few basic elements which are part of almost any programming language.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lesson 2:
&lt;/h1&gt;

&lt;h2&gt;
  
  
  How does a programming language work?
&lt;/h2&gt;

&lt;p&gt;Most programming languages provide the following basic elements, which are used to write a program.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. a statement
&lt;/h3&gt;

&lt;p&gt;A statement is an instruction which is executed by the computer. E.g. it could be „print a line of text“ or „calculate 1+1 and assign the result to a variable“ (see below).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. a variable
&lt;/h3&gt;

&lt;p&gt;A variable is a named storage for data which is used within the program. Each variable holds a value in the computers memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. a data type
&lt;/h3&gt;

&lt;p&gt;The values which are stored in variables usually have a certain data type. Some basic data types are integers, floating point numbers, strings (think of it as a sequence of alphabetic characters if you have never heard of the term strings before) and booleans (true or false).&lt;/p&gt;

&lt;h3&gt;
  
  
  4. an operator
&lt;/h3&gt;

&lt;p&gt;An operator is a special symbol of the programming language with a certain meaning. There are different kind of operators: assignment operators (e.g. to assign values to variables), comparison operators (e.g. to compare the values of two variables), increment and decrement operators and maybe more.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. control structures
&lt;/h3&gt;

&lt;p&gt;The most programs require some control structures to implement the business logic. These can be branching structures to tell the computer to run different code dependent on certain conditions (if … then … else …) or loops to let the computer repeat certain parts of the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. input
&lt;/h3&gt;

&lt;p&gt;A typical program requires some input to compute the result which is based on the input. The input can be data, which is entered by the user or data which is obtained from other programs or storage.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. output
&lt;/h3&gt;

&lt;p&gt;To let the user or other programs know the result of a computation, a program requires an output mechanism. The output can be a display, a kind of storage or the input of another program.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. functions, methods, procedures
&lt;/h3&gt;

&lt;p&gt;These terms usually mean very similar things. For this explanation I will use the term function. A function is a reusable part of code which may consist of all the other elements mentioned above. Functions are used to divide complex problems in many smaller problems. Each small problem is solved within its own function and the complex problem is solved by combining the functions for the smaller problems. Functions can have an input, typically called parameters, and an output, typically called return values.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lesson 3:
&lt;/h1&gt;

&lt;p&gt;This is where a typical programming tutorial starts. We have examples of the basic elements from lesson 2 in a programming language specific syntax. The language syntax defines how each of the elements from lesson 2 has to be written so that the computer can understand the code.&lt;/p&gt;

&lt;p&gt;Now that you’ve read about the missing lessons, pick the beginner tutorial for the language of your choice and continue with lesson 3 on your own. I hope my lessons have improved your understanding of what’s going on.&lt;/p&gt;

&lt;h1&gt;
  
  
  Happy coding!
&lt;/h1&gt;

&lt;p&gt;I appreciate any comments which can improve the lessons and help others to get more easily into programming.&lt;/p&gt;


</description>
      <category>beginners</category>
      <category>learn</category>
      <category>programminglanguage</category>
    </item>
    <item>
      <title>Hi, I'm Hendrik</title>
      <dc:creator>hepisec</dc:creator>
      <pubDate>Tue, 30 May 2017 06:59:07 +0000</pubDate>
      <link>https://dev.to/hepisec/hi-im-hendrik</link>
      <guid>https://dev.to/hepisec/hi-im-hendrik</guid>
      <description>&lt;p&gt;I have been coding for almost 20 years.&lt;/p&gt;

&lt;p&gt;You can find me on GitHub as &lt;a href="https://github.com/hepisec" rel="noopener noreferrer"&gt;hepisec&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I live in Germany.&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: Java, PHP.&lt;/p&gt;

&lt;p&gt;I am currently learning more about anything ;-)&lt;/p&gt;

&lt;p&gt;Nice to meet you.&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
