跳到主要內容


程式語言學習概論(1)

程式語言

介紹

      程式語言是一種跟電腦溝通的語言,就跟人與人之間的溝通一樣(人的語言也被稱為自然語言),跟人類的語言一樣電腦程式語言也是有很多種類的,種類不同強項不同,因此在學習的時候必須確認自己學習的目的,來確立自己應該學哪種程式語言,而本blogger給的建議都是給新手,也就是完全沒學過或是學過卻完全不知道在學什麼的人。

歷史

電腦發展史

年名稱說明
1642計算尺可以計算八進位的尺
1801雅卡爾織布機可以用卡孔編輯圖案的織布機
1820第一部完全可程式化計算機用來自動化處理數據
1930-1940模擬計算機針對機械或電子進行模擬分析使用
1941第一部電子計算機可程式化,二進制運算
1959-1964第二代計算機使用微處理器
1960第三代計算機可商業化生產
1970第四代計算機降低成本後,大量生產的電腦


程式語言發展史

年名稱
1940之前打孔卡
1940年代組合語言
1954Fortran
1958Lisp
1959COBOL
1972C語言
1978SQL
1983C++
1987Perl
1991Python
1995Java
1995JavaScript
1995PHP
2001C#
2014Swift

      表格內容沒有非常詳細,但可以看到隨者電腦的進步,也帶動程式語言發展,尤其是第四代電腦發表後,各種程式語言更是如雨後春筍般冒出。

學習方法

      我認為的好的學習方式為從基本於法開始,中間學習各種檔案開啟以及內容處理,再來與資料庫連線跟其他種類的函式庫使用,進而研究設計模式以便大型軟體開發,再有時間之餘研究如何優化程式等議題。

  • 變數定義
  • 條件敘述
  • 回圈
  • 函數
  • 類別或結構
  • 開起檔案
  • 與資料庫連結
  • 資料結構與演算法
  • 函式庫的應用
  • 設計模式
  • 其他

一開始學習建議學習的語言

       這些建議選項不是依照難易度排序,只是單純以照在排行榜上常見的程度選出來的,又再依照使用領域選出,一開始並不建議從C開始學習,因為學習難度最高,而本人建議先學Python,再去學C#,可以縮短撞牆期,也較不會喪失信心。


  • C
  • C++
  • C#
  • Java
  • Javascript
  • Python
  • Swift
下圖為2018-IEEE上的排行,Web意思為與網路相關,Mobile意思為與行動裝置有關,Enterprise意思為商用軟體(通常為桌機),Embedded意思為嵌入式系統,而Swift為Apple系統的必要學習程式,故也特別列出,當然也排出個人比較不喜歡的程式語言。


排行參考網站:



教學目前不包含對各種語言最佳化的內容,主要是針對如何快速學會程式語言。


投影片-slideshare:程式語言學習概論(1)
影片-youtube:程式語言學習概論(1)
程式碼-Github:程式語言學習概論(1)

留言

這個網誌中的熱門文章

Python-程式優化設計-module

class Objects, values and types CPython implementation detail:  For CPython,  The standard type hierarchy User-defined functions __doc__ The function’s documentation string, or  None  if unavailable; not inherited by subclasses Writable __name__ The function’s name Writable __qualname__ The function’s  qualified name New in version 3.3. Writable __module__ The name of the module the function was defined in, or  None  if unavailable. Writable __defaults__ A tuple containing default argument values for those arguments that have defaults, or  None  if no arguments have a default value Writable __code__ The code object representing the compiled function body. Writable __globals__ A reference to the dictionary that holds the function’s global variables — the global namespace of the module in which the function was defined. Read-only __dict__ The namespace supporting arbitrary function attributes. Writable __closure__ None ...

python-設計模式-原型模式

python 設計模式 原型模式 import copy  class Prototype:     def __init__(self):        self.obj = {}     def Registor(self, key,new_obj):        self.obj[key] = new_obj     def UnRegistor(self, key):        del self.obj[key]    def DeepClone(self, name, **attr):        obj_clone = copy.deepcopy(self.obj.get(name))        obj_clone.__dict__.update(attr)        return obj_clone     def Clone(self, name, **attr):        obj_clone = copy.copy(self.obj.get(name))        obj_clone.__dict__.update(attr)        return obj_clone  class a:     def __init__(self):        self.name = ['a1','a2']  class b:     def __init__(self):        self.name = 'b'...

Python-資料庫-mysql-sqlalchemy

Python 資料庫 mysql-sqlalchemy 安裝 Linux、mac : pip3 install SQLAlchemy windows     :之後補充 第一部分 from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///:memory', echo=False) Base = declarative_base() Session = sessionmaker(bind=engine) 第二部分 from test_sqlalchemy import * from sqlalchemy import Column, Integer, String class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) name = Column(String) fullname = Column(String) password = Column(String) def __repr(self): return "<User(name={})>".format(self.name) 第三部分 from test_sqlalchemy import * from build_model import * Base.metadata.create_all(engine) user1 = User(name='user1', fullname='user1', password='user1') user2 = User(name='user2', fullname='user2...