🔥 "เรื่องอื่นอาจจะประนีประนอมได้ .. แต่เขียนโค้ดสไตล์มั่วซั่ว ประนีประนอมไม่ได้เด็ดขาดดด !"
.
หลายคนน่าจะเคยเจอปัญหากันมาบ้างไม่ว่าจะเป็น
.
🤣 "เมื่อวันก่อนตรูเขียนอะไรลงไปเนี่ยยย !?" จนไปถึง "งงจัด เมื่อเพื่อนร่วมทีมส่งงานมาให้ช่วยดู"
.
ปัญหานี้จะหมดไปถ้าเรารู้ และ เข้าใจสิ่งที่เรียกว่า Coding Style ซึ่งจริง ๆ แล้วในหลาย ๆ ภาษาก็มีให้เราได้อ่านอยู่
.
✅ โดยเจ้าสิ่งนี้จะเป็น "คำแนะนำ" ในการเขียนโค้ดที่ดีของแต่ละภาษา หรือ แต่ละองค์กร ที่ได้มีเกณฑ์ต่าง ๆ กำหนดไว้แล้วนั่นเอง
.
ไม่ว่าจะเป็นเรื่องทั่วไปอย่าง
.
▶️ ควรตั้งชื่อตัวแปรแบบไหน ? ชื่อฟังก์ชันควรเป็นอะไรดี ?
.
▶️ การ Import ของจากข้างนอกมาใช้ อะไรควรทำก่อน หลัง หรือ ไม่ควร ?
.
▶️ จนไปถึง การออกแบบเงื่อนไขการทำงานควรออกแบบอย่างไร ?
.
ซึ่งแน่นอนว่าคำแนะนำที่ดีเหล่านี้จะช่วยให้โปรเจคของเราผ่านไปได้โดยราบลื่นนั่นเอง หากนำมาใช้ในทีมด้วยก็ยิ่งทำให้พวกเราเข้าใจตรงกันได้มากขึ้น
.
"มันเลยเปรียบเสมือนข้อตกลงในการทำงานร่วมกันนั่นเอง <3"
.
แต่จะต้องบอกก่อนนะว่า ไม่ใช่ทุกงานที่เหมาะกับ Coding Style นั้น ๆ หรือ ไม่ใช่ทุกปัญหาจะมีใน Coding Style บอกว่าแก้ไขยังไง หลายครั้งเราอาจจะต้องเพิ่มเติมเอาเอง
.
⚠️ "แต่สิ่งที่เพิ่มเติมจะต้องคุยกันในทีมให้เคลียร์ก่อนเสมอนะ !"
.
ดังนั้นวันนี้เรามาดู Coding Style Guide ของแต่ละภาษาไปพร้อมกันเลยดีกว่า !! (บางภาษาอาจมีตัวน่าสนใจมากกว่า 1 ตัว แอดก็รวมไว้ให้แล้วจ้า)
.
👉 ภาษา Java
.
http://www.oracle.com/technetwork/java/codeconventions-150003.pdf
https://google.github.io/styleguide/javaguide.html
.
👉 ภาษา C
.
http://www.maultech.com/chrislott/resources/cstyle/indhill-annot.pdf
http://www.maultech.com/chrislott/resources/cstyle/Peter_CStyleGuide.pdf
.
👉 ภาษา C++
.
http://www.maultech.com/chrislott/resources/cstyle/Wildfire-C++Style.html
http://www.maultech.com/chrislott/resources/cstyle/CppCodingStandard.html
.
👉 ภาษา Python
.
https://www.python.org/dev/peps/pep-0008/
.
👉 ภาษา C#
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/index
.
👉 ภาษา JavaScript
.
https://github.com/airbnb/javascript
http://google.github.io/styleguide/javascriptguide.xml
https://www.w3schools.com/js/js_conventions.asp
.
👉 ภาษา Dart
https://dart.dev/guides/language/effective-dart/style
.
👉 ภาษา PHP
http://www.php-fig.org/psr/psr-1/
http://pear.php.net/manual/en/standards.php
.
👉 ภาษา Objective-C
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html
.
👉 ภาษา Kotlin
https://kotlinlang.org/docs/reference/coding-conventions.html
.
👉 ภาษา Swift
https://github.com/raywenderlich/swift-style-guide
.
👉 ภาษา Visual Basic.NET
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/index
.
👉 ภาษา Ruby
https://github.com/bbatsov/ruby-style-guide
https://github.com/airbnb/ruby
.
👉 ภาษา R
http://web.stanford.edu/class/cs109l/unrestricted/resources/google-style.html
.
👉 ภาษา Go
https://golang.org/doc/effective_go.html
.
"เรียบร้อย ครบจบทุก Guideline ใครที่อยากทำงานกับทีมง่าย ๆ แนะนำให้ลองใช้กันดูได้เลยจ้า" <3 <3 <3
.
#borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
「dart language」的推薦目錄:
- 關於dart language 在 BorntoDev Facebook 的精選貼文
- 關於dart language 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的精選貼文
- 關於dart language 在 Step Up English Facebook 的最讚貼文
- 關於dart language 在 Dart - GitHub 的評價
- 關於dart language 在 What is the role of Google's Dart programming language? 的評價
- 關於dart language 在 Dart Programming Language - Home | Facebook 的評價
- 關於dart language 在 Dart programming language - Pinterest 的評價
dart language 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的精選貼文
จะสิ้นปีแล้ว มาเชคเรตติ้งกันเถอะ ว่าภาษาโปรแกรมมิ่งอะไร? เป็นที่นิยม ตั้งแต่ 1- 50 อันดับ ณ เดือนธันวาคมปีนี้ (วัดเรตติ้งความนิยมเฉยๆ ไม่ได้วัดว่าภาษาใดเขียนโปรแกรมได้ดีที่สุดนะครับ)
จะประกอบไปด้วย (ถ้าเซฟรูปจากมือถืออาจไม่ชัด เซฟผ่านคอมดีกว่า)
1 Java
2 C
3 C++
4 Python
5 C#
6 JavaScript
7 Visual Basic .NET
8 R
9 PHP
10 MATLAB
11 Swift
12 Objective-C
13 Assembly language
14 Perl
15 Ruby
16 Delphi/Object Pascal
17 Go
18 Scratch
19 PL/SQL
20 Visual Basic
21 SAS
22 Alice
23 Dart
24 Scala
25 Erlang
26 Awk
27 Transact-SQL
28 Kotlin
29 COBOL
30 D
31 LabVIEW
32 VBScript
33 Prolog
34 ABAP
35 Crystal
36 VHDL
37 Fortran
38 Lua
39 (Visual) FoxPro
40 Apex
41 Verilog
42 Ada
43 Rust
44 Lisp
45 Hack
46 Logo
47 Julia
48 Groovy
49 Clojure
50 Maple
#############
ที่มา จากTIOBE ซึ่งเป็นดัชนีตัวชี้วัดภาษายอดนิยม โดยข้อมูลการจัดอันดับจะถูกอัพเดตทุกเดือน เดือนละครั้ง อย่างในรูปเอาข้อมูลเดือนธันวาคมของปีนี้มาให้ดู
เรตติ้งจะวัดจากจำนวนผู้มีทักษะจากทั่วโลก, คอร์สเรียน และจาก vendors
รวมทั้ง search engine ที่นิยมได้แก่ Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube และ Baidu ก็ถูกนำมาคำนวณวัดเรตติ้งด้วย
แต่ทั้งนี้ดัชนี TIOBE เขาไม่ได้การันตีว่าภาษาอะไรดีที่สุดในการเขียนโปรแกรมนะครับ จุดประสงค์ให้เราตรวจสอบตนเองว่าจะอัพเดตทักษะเขียนโปรแกรมอะไรเพิ่มเติม หรือใช้ตัดสินใจเวลาจะสร้างระบบซอฟต์แวร์ใหม่ๆ อะไรขึ้นมา
https://www.tiobe.com/tiobe-index/
dart language 在 Step Up English Facebook 的最讚貼文
Sự hòa hợp giữa chủ ngữ và động từ
Nguyên tắc chung: Chủ ngữ số ít thì hòa hợp với động từ số ít, chủ ngữ số nhiều thì hợp với động từ số nhiều.
VD: English is an important language.
A great many people are involved in the use of English.
Tuy nhiên, đôi khi chủ ngữ còn hòa hợp với động từ tùy theo ý tưởng diễn đạt hoặc danh từ/đại từ đứng trước theo các quy tắc sau:
QUY TẮC I:
Hai danh từ/đại từ số ít, nối liền bởi “and” thì phải theo sau bởi 1 động từ số nhiều:
She and I are friends.
Linh and her friend are going to the library.
Nếu hai danh từ diễn đạt cùng 1 ý/1 sự kiện thì động từ chỉ là số ít. VD: The lecture and author is coming to the stage.
QUY TẮC II:
Hai danh từ/đại từ được nối bởi “with”, “as well as”, “together with”, “along with” thì động từ phải hòa hợp với danh từ đầu tiên thứ nhất:
Dương with her friends is very tired.
His friends together with Nam are going on holiday in Ha Long Bay.
QUY TẮC III:
Danh từ số ít đứng sau “each”, “every” hay danh từ số nhiều/đại từ số nhiều đứng sau “each of” đều hợp với động từ số ít:
Each boy and girl has an English dictionary.
Each of us gets a tin of coke.
QUY TẮC IV: Hai danh từ/đại từ được nối bằng “or/not”, “either…or/neither…nor”, “not only…but also” thì động từ phải hợp với “S” gần nhất:
Either you or your husband is going to the meeting.
Neither I nor you are young.
QUY TẮC V:
1.A number of nouns + verbs:
A number of workers are on strike.
2.The number of nouns + verb (số ít):
(Vì 1 số danh từ, tuy có hình thức số nhiều (s) nhưng ngụ ý là số ít, nên chỉ hợp với động từ số ít):
+ Danh từ chỉ bệnh tật như: meals, mumps, herpes, rickets (còi xương).
+ Danh từ chỉ môn học (academic subjects) như: physics, economics, linguistics, mathematics, statistics…
+ Danh từ chỉ địa danh như: Athens, Algiers, The United States, The Philippines, Brussels…
VD: The number of meals has raised, especially in the crowded population areas.
+ Trong một số danh từ tập hợp, cụm từ định lượng, việc sử dụng động từ số ít/số nhiều đôi khi tùy thuộc vào ý người nói muốn nhấn mạnh đến một tổng thể hay các bộ phận cấu thành tổng thể đó.
VD: The number of students who have withdrawn from class this quarter is appalling (dễ sợ).
Dart is/are often played in pubs. (dart = 1 mũi phi tiêu/ darts: trò chơi ném phi tiêu)
QUY TẮC VI: Danh từ chủ ngữ chỉ thời gian, tiền bạc, khoảng cách, trọng lượng thì hợp với động từ số ít, VD:
Twenty dollars is too much for that shirt.
Ten tons of rubber is exported to Japan.
Two years is long enough for them to separate from each other.
Five kilometers is too far to walk.
QUY TẮC VII:
1.Phần trăm (percentages), phân số (fractions)
Phần trăm/phân số + of + uncountable noun + verb (số ít), VD:
Sixty percent of waste paper is recycled.
Three quarter of the world’s population lives in bad living condition.
2.Phần trăm, phân số + of + plural noun + verbs:
Half of the students in this class come from the country.
Less than fifty percent of students are bad at foreign language.
QUY TẮC VIII: Gerunds hay infinitives làm chủ ngữ đều hợp với động từ số ít:
Smoking is bad for health.
To live is to struggle.
QUY TẮC IX: Hợp thì với adverbial clause of time.
1.Adverbial clause of time được bắt đầu với connectors:
When/as (khi), before/after, by the time = before, while, whenever, as soon as (ngay khi), as long as (chừng nào mà/cho đến khi), till, until = just as (cho đến khi), since, no sooner …than = vừa mới thì đã = hardly…when.
2.Thì của động từ trong các mệnh đề phải phù hợp với nhau và phù hợp với nghĩa của connector, VD:
Until I lived in Vietnam, I had never known hot weather.
+ had know = past perfect à xảy rea trước lived
+ từ until = giải thích rõ điểm mốc thời gian: đến tận khi, do vậy tình huống had never know và lived phù hợp logic với nghĩa của connector until.
3.While thường dùng với continuous tense:
While I was walking down the street, I saw Maily driving a Toyota.
4.Adv. Clause of time không dùng thì tương lai:
I’ll remember that day as long as I live (không dùng as long as I’ll live). I’ll tell you that when you come
dart language 在 Dart Programming Language - Home | Facebook 的推薦與評價
Dart Programming Language. 3532 likes · 61 talking about this. Share, Explain and Discuss with other Dart Developers. ... <看更多>
dart language 在 Dart - GitHub 的推薦與評價
Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps. - Dart. ... <看更多>