Skip to content

Commit 0ddca3c

Browse files
authored
Merge pull request #30 from gadilashashank/master
Add chapter on ABC
2 parents 21807f2 + cf6056b commit 0ddca3c

14 files changed

Lines changed: 341 additions & 42 deletions

CONTRIBUTING.md

Lines changed: 174 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,208 @@
11
# How to contribute
22

3+
## Prerequisites
4+
5+
First of all fork [this repository](https://github.com/devRant-Community/Community-Programming-Book/)
6+
and join this [discord server](https://discord.gg/TDut3Fq).
7+
8+
Throughout this guide, changes to files are to be made in your personal fork
9+
and submitted for merging in the main repository through a pull-request (PR).
10+
11+
Taking the above mentioned points as granted the contributing guide begins now.
12+
313
## Language already complete
414

5-
You can change and correct the files, by forking and changing the files in the directory /book/languages/[language] in your forked repo. After you're finished make a PR from your forked repo to this repo.
15+
Change/correct the files present in the directory /book/languages/[language]
16+
where [language] is a placeholder for the language you want to change.
17+
18+
Please refer to the "After writing the chapter" section below and make
19+
appropriate changes to the Summary.md file.
620

721
## Language not present
822

9-
You must create a new subdir on /book/languages with the name of your language
23+
Create an issue on the main repository(mentioned in pre-requisites) with title
24+
"Add Chapter on {Name of language}", assign this issue to yourself and add the
25+
label "Enhancement". This helps in identifying that you are writing that
26+
particular chapter.
1027

11-
### Example
28+
Create a new sub-directory in /book/languages with the name of the language.
1229

1330
``` md
1431
/book/languages/kotlin
1532
```
1633

17-
On this subdir you must create the files
34+
In the sub-directory of the language add the files README.md and intro.md (Compulsory)
1835

1936
``` md
20-
readme.md
21-
intro.md
37+
/book/languages/kotlin/
38+
README.md
39+
intro.md
2240
```
2341

24-
The Readme.md is just to get into the next language, something like this:
42+
README.md is a transition from one chapter to the next. An example is given.
2543

2644
``` md
2745
# Welcome
28-
> This chapter has been authored by (Your name goes here)
46+
> This chapter has been authored by <Your name goes here>
47+
2948
Well, next we will talk a bit about Kotlin, the new JVM language by Jetbrains.
3049
Kotlin is less verbose than the original JVM language Java and is now one of
3150
the main development languages of the Android Platfom. Let's get into it.
3251
```
3352

34-
The intro should be a bit longer, it should give you an brief look at the language. Talk about the story of language or tell from where it came. Look into the file intro.md at the repo root for inspiration.
53+
The intro.md should give a brief look at the language. Talk about the story of
54+
language or tell from where it came. Look at the file intro.md present in the
55+
root of the repository for inspiration.
3556

36-
You should also add your new language to the /book/Summary.md by adding
57+
The contents of the chapter are to be added as separate .md files for
58+
each sub-chapter. An example sub-directory with sub-chapters is given.
3759

3860
``` md
39-
* [<Language>](/languages/<Language>/readme.md)
40-
* [Intro](/languages/<Language>/intro.md)
61+
/book/languages/kotlin/
62+
README.md
63+
intro.md
64+
<name_of_sub-chapter>.md
65+
```
66+
67+
It is advised to divide the chapters into sub-chapters for better organization and
68+
readability. If the author decides not to do so then the entire
69+
contents of the chapter should be written in the intro.md file itself.
4170

71+
### After writing the chapter
72+
73+
After writing the chapter, an entry should be made in the Summary.md file similar
74+
to the one given in the example below.
75+
76+
```md
77+
* [<Name of language>](languages/assembly/README.md)
78+
79+
* [Introduction](languages/assembly/intro.md)
80+
81+
* [<Name of sub-chapter>](languages/assembly/<name of file>.md)
4282
```
4383

44-
## Adding chapter
84+
Note that Summary.md contains the order in which various chapters and the
85+
sub-chapters appear in the final product, hence the entries should be made
86+
appropriately. Also, note that various languages in the Summary.md file appear
87+
in the order of creation/release.
4588

46-
To start writing on a new chapter create a new file called [chapter].md at the root of language directory. Also you should add it to the /book/Summary.md
89+
For example the Summary.md file with two languages, Assembly and Python.
90+
91+
```md
92+
* [Assembly](languages/assembly/README.md)
93+
* [sub-chapter](languages/assembly/{name of file}.md)
94+
(leave a blank line)
95+
* [Python](languages/python/README.md)
96+
* [sub-chapter 0](languages/python/{name of file}.md)
97+
(leave a blank line)
98+
* [sub-chapter 1](languages/python/{name of file}.md)
4799

48-
``` md
49-
* [<Language>](/languages/<Language>/readme.md)
50-
* [Intro](/languages/<Language>/intro.md)
51-
* [<Chapter>](/languages/<Language>/<Chapter>.md)
52100
```
101+
102+
Feel free to ask for help regarding this aspect or anything in general.
103+
104+
You may also add your details in the credits.md in a similar way as other existing entries.
105+
106+
## Pull request and CI
107+
108+
After finishing your work, submit a pull request (PR) for merging your changes
109+
into the base branch. Add the editing team as reviewers. If the pull request
110+
adds a new chapter, then add the label "new-chapter".
111+
112+
Also, close any previously opened issue(s) which are fulfilled by the
113+
pull request.
114+
115+
Every pull request undergoes an automatic build process which automatically
116+
generates the updated book. A set of rules on the format of the content is
117+
defined all of which should be followed for the build to be successful.
118+
119+
These rules are given below.
120+
121+
* Lines should **NOT** have trailing whitespace.
122+
123+
* *List elements*, *fenced code blocks* and *headers* should be surrounded with **blank lines**.
124+
125+
```md
126+
Some sentence.
127+
128+
* List element 1 or ## Header 1
129+
130+
* List element 2 or ## Header 2
131+
132+
Continuation.
133+
```
134+
135+
* Each line should contain a maximum of **300** characters.
136+
137+
* Emphasis should **NOT** be used as a header.
138+
139+
* Use ``---`` for horizontal rules
140+
141+
* Two top-level headers should **NOT** be present.
142+
143+
```md
144+
This is wrong format
145+
146+
# Heading 1
147+
148+
# Heading 2
149+
```
150+
151+
* Always use ATX style headers
152+
153+
```md
154+
Correct:
155+
# ATX style H1
156+
157+
158+
Wrong:
159+
## Closed ATX style H2 ##
160+
161+
Setext style H1
162+
===============
163+
```
164+
165+
* Leave a space after hash on atx style header and after the "\*" symbol in list elements.
166+
167+
```md
168+
Correct:
169+
# Heading
170+
* List element
171+
172+
Wrong:
173+
#Heading
174+
*List element
175+
```
176+
177+
For everything else the standard rules, described [here](https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md), apply.
178+
179+
If there are any mistakes in format, the build will fail and the mistakes are
180+
prompted by @SkayoBot to be corrected. An example prompt is given.
181+
182+
"------------------Prompt Begins------------
183+
184+
Checks failed - mdlint output:
185+
186+
```md
187+
devRant-Community/Community-Programming-Book/book/languages/abc/conclusion.md
188+
9:3 no-space-in-links [MD039] Spaces inside link text "...aking of python-An interview ]"
189+
devRant-Community/Community-Programming-Book/book/languages/abc/disadvantages.md
190+
9:100 no-trailing-spaces [MD009] Trailing spaces [Expected: 0; Actual: 3]
191+
devRant-Community/Community-Programming-Book/book/languages/abc/misc.md
192+
6 no-emphasis-as-header [MD036] Emphasis used instead of a header "Function to convert given temp..."
193+
37:85 no-trailing-spaces [MD009] Trailing spaces [Expected: 0; Actual: 2]
194+
devRant-Community/Community-Programming-Book/book/languages/assembly/advantages.md
195+
```
196+
197+
Please fix these errors before merging!
198+
199+
"-----------Prompt Ends-------------
200+
201+
After the CI is successful please wait for the editing team to make changes
202+
(if any) and finally approve your work for merging. You are free to discuss
203+
with the concerned editor(s) about any edits made.
204+
205+
Though this guide is extensive it need not be exhaustive. If you have any
206+
doubts or questions feel free to ask.
207+
208+
Happy Contributing ! :)

book/SUMMARY.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@
2121
* [Conclusion](languages/assembly/conclusion.md)
2222

2323

24+
* [ABC](languages/abc/README.md)
25+
26+
* [Introduction](languages/abc/intro.md)
27+
28+
* [History](languages/abc/history.md)
29+
30+
* [What it solves?](languages/abc/what_it_solves.md)
31+
32+
* [Advantages](languages/abc/advantages.md)
33+
34+
* [Disadvantages](languages/abc/disadvantages.md)
35+
36+
* [An Example](languages/abc/misc.md)
37+
38+
* [Conclusion](languages/abc/conclusion.md)
39+
2440
* [Python](languages/python/README.md)
2541

2642
* [Introduction](languages/python/intro.md)
@@ -37,7 +53,6 @@
3753

3854
* [Conclusion](languages/python/conclusion.md)
3955

40-
4156
* [C#](languages/csharp/README.md)
4257

4358
* [Introduction](languages/csharp/intro.md)
@@ -50,10 +65,9 @@
5065

5166
* [Conclusion](languages/csharp/conclusion.md)
5267

53-
5468
* [C++](languages/cpp/README.md)
5569
* [Introduction](languages/cpp/intro.md)
5670

5771
## End
5872

59-
* [Credits](credits.md)
73+
* [Credits](credits.md)

book/languages/abc/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# ABC
2+
3+
> This chapter has been authored by Gadila Shashank Reddy.
4+
5+
Now is the chapter on ABC. We will try to understand its roots and
6+
how was it able to inspire Python, one of the most popular programming languages in current times.

book/languages/abc/advantages.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Advantages
2+
3+
* Easy to learn and use and is intuitive.
4+
5+
* Structured programming and data structuring are supported.
6+
7+
* It has only 5 data types which are sufficient for most purposes. Others have a larger number of data types.
8+
9+
* The code length is typically much smaller compared to other languages without compromising
10+
on readability or user understanding.
11+
12+
* Great for general purpose programming and prototyping.
13+
14+
* There are no limitations on size of data except due to physical factors.
15+
16+
* This language has introduced the concept of indented code blocks.

book/languages/abc/conclusion.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# A final word
2+
3+
ABC is an excellent attempt at making programming understandable and user-friendly. It has
4+
introduced some terrific features which have inspired several other languages the most notable
5+
one being Python. Despite few design flaws it still is successful in programming more accessible and powerful.
6+
7+
## Sources and further reading
8+
9+
* [Making of python-An interview](https://www.artima.com/intv/pythonP.html)
10+
11+
* [The official page of ABC](https://homepages.cwi.nl/~steven/abc/)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Disadvantages
2+
3+
* Some issues with syntax like uppercase for keywords.
4+
5+
* Variables are persistent and global. Memory management thus is an issue.
6+
7+
* It has a very monolithic design that is low-level optimizations to the code is not possible.
8+
9+
* I/O from files was not implemented. Thus, it could not be used for reading and writing from files.
10+
11+
* Because of the way variables were implemented it was not possible to implement temporary or
12+
session specific variables without exclusively deleting them.

book/languages/abc/history.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# History
2+
3+
## Creation
4+
5+
ABC was created in the early 1980s by Leo Geurts, Lambert Meertens and Steven Pemberton at
6+
the Centrum Wiskunde & Informatica (CWI) in the Netherlands. ABC language was developed iteratively
7+
with it being the fourth iteration. All the previous versions/iterations of this language were called as B.
8+
9+
It is said that the first version of B appeared in 1969. So we can say that ABC went through a long
10+
phase of development and changes before it took its current form.
11+
12+
Note that B is not a predecessor of the C programming language.
13+
14+
## Purpose
15+
16+
ABC was intended for teaching and prototyping purposes rather than systems programming.
17+
It was created to replace some older languages such as BASIC, Pascal and AWK. As it turns out ABC
18+
is easier to learn than BASIC but more powerful than Pascal. It's initial aims were to be:
19+
20+
* Simple
21+
22+
* Interactive
23+
24+
* Structured

book/languages/abc/intro.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Introduction
2+
3+
ABC is a powerful, easy to learn and use, interactive and imperative high level
4+
programming language. This language was born after a lot of research on creating a programming
5+
language that was both powerful with respect to features and also easy to learn.
6+
7+
It is a high level language and supports data structuring and structured programming.
8+
During its time, ABC was a powerful language for beginners and experts alike.

book/languages/abc/misc.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# An example
2+
3+
This section is meant to illustrate a sample code in ABC and compare it with
4+
equivalent code in Python and C.
5+
6+
## Function to convert given temperature from Fahrenheit to Celsius
7+
8+
In ABC language.
9+
10+
```ABC
11+
HOW TO PRINT CELSIUS FROM a:
12+
PUT (a-32)*5/9 IN c
13+
WRITE a, "Fahrenheit =", 2 round c, "Celsius" /
14+
```
15+
16+
The same code in Python3.
17+
18+
```Python
19+
def to_celsius(a):
20+
c = (a-32)*5/9
21+
print(a + "Fahrenheit = %.2f",c + "Celsius" )
22+
```
23+
24+
And in C
25+
26+
```C
27+
void to_celsius(float a)
28+
{
29+
c = (a-32)*5/9;
30+
printf("%f Fahrenheit is %.2f Celsius",a,c);
31+
return;
32+
}
33+
```
34+
35+
The purpose of this example is to illustrate two things: The similarity between ABC and
36+
Python and also a glimpse of how ABC is slightly easier to code in compared to C. The second point
37+
might not be too obvious because the example is too short to notice the differences.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# What it solves
2+
3+
ABC was not designed to solve a specific purpose or problem, instead it was intended for general
4+
purpose programming. It was created to be easy to learn and use yet include powerful features.
5+
Programming in this language is relatively more intuitive and easy. It was the first language to have
6+
implemented indented blocks of code which has also been adopted in python. A better explanation on
7+
its powerful features are mentioned in the next section.

0 commit comments

Comments
 (0)