未加星标

How to choose your first programming language

字体大小 | |
[开发(python) 所属分类 开发(python) | 发布者 店小二04 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏
How to choose your first programming language Posted 11 Jan 2017 Kojo Idrissa Feed

1

up
How to choose your first programming language

Image by :

opensource.com

The reasons for learning to program are as a varied as the people who want to learn. You might have a program you want to make, or maybe you just want to jump in. So, before choosing your first programming language,ask yourself: Where do you want that program to run? What do you want that program to do?

Your reasons for learning to code should inform your choice of a first language.

In this article, I use "code," "program," and "develop" interchangeably as verbs, while "code," "program," "application," and "app" interchangeably as nouns. This is to reflect language usage you may hear.

Know your device

Where your programs will run is a defining factor in your choice of language.

Desktop applications are the traditional software programs that run on a desktop or laptop computer. For these you'll be writing code that only runs on a single computer at a time. Mobile applications, known as apps, run on portable communications devices using iOS, Android, or other operating systems. Web applications are websites that function like applications.

Web development is often broken into two subcategories, based on the web's client-server architecture:

Front-end programming, which is writing code that runs in the web browser itself. This is the part that faces the user, or the "front end" of the program. It's sometimes called "client-side" programming, because the web browser is the client half of the web's client-server architecture. The web browser runs on your local computer or device.

Back-end programming, which is also known as "server-side" programming, the code written runs on a server, which is a computer you don't have physical access to.

What to create

Programming is a broad discipline and can be used in a variety of fields. Some of the more common examples include:

Data science Web development Game development Work automation of various types

Now that we've looked at why and where you want to program, let's look at two great languages for beginners.

python

Python is one of the most popular languages for first-time programmers, and that is not by accident. Python is a general-purpose language. This means it can be used for a wide range of programming tasks. There's almost nothing you can't do with Python. This lets a wide range of beginners make practical use of the language. In addition, Python has two key design features that make it great for new programmers: a clear, English-like syntax and an emphasis on code readability .

A language's syntax is essentially what you type to make the language perform. This can include words, special characters (like ; , $ , % , or {} ), white space, or any combination. Python uses English for as much of this as possible, unlike other languages, which often use punctuation or special characters. As a result, Python reads much more like a natural, human language. This helps new programmers focus on solving problems, and they spend less time struggling with the specifics of the language itself.

Combined with that clear syntax is a focus on readability. When writing code, you'll create logical "blocks" of code, sections of code that work together for some related purpose. In many languages, those blocks are marked (or delimited) byspecial characters. They may be enclosed in {} or some other character. The combination of block-delimiting characters and your ability to write your code in almost any fashion can decrease readability. Let's look at an example.

Here's a small function, called "fun," which takes a number, x as it's input. If x equals , it runs another function called no_fun (which does something that's no fun). That function takes no input. Otherwise, it runs the function big_fun , using the same input, x .

This function defined in the "C" language could be written like this:

void fun(int x) { if (x == 0) { no_fun(); } else { big_fun(x); } }

or, like this:

void fun(int x) { if (x == 0) {no_fun(); } else {big_fun(x); }}

Both are functionally equivalent and both will run. The {} and ; tell us where different parts of the block are. However, one is clearly more readable to a human. Contrast that with the same function in Python.

def fun(x): if x == 0: no_fun() else: big_fun(x)

In this case, there's only one option. If the code isn't structured this way, it won't work, so if you have code that works, you have code that's readable. Also, notice the difference in syntax. Other than def , the words in the Python code are English and would be clear to a broad audience. In the C language example void and int are less intuitive.

Python also has an excellent ecosystem. This means two things. First, you have a large, active community of people using the language you can turn to when you need help and guidance. Second, it has a large number of preexisiting libraries, which are chunks of code that perform special functions. These range from advanced mathematical processing to graphics to computer vision to almost anything you can imagine.

Python has two drawbacks to it being your first language. The first is that it can sometimes be tricky to install, especially on computers running windows. (If you have a Mac or a linux computer, Python is already installed.) While this issue isn't insurmountable, and the situation is improving all the time, it can be a deterrent for some people. The second drawback is for people who specifically want to build websites. While there are projects written in Python (like Django and Flask ) that let you build websites, there aren't many options for writing Python that will run in a web browser. It is primarily a back-end or server-side language.

javascript If you know your primary reason for learning to program is to bu

本文开发(python)相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程

分页:12
转载请注明
本文标题:How to choose your first programming language
本站链接:http://www.codesec.net/view/522964.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(python) | 评论(0) | 阅读(20)