Codeparl Standards

The codeparl standards are guide-lines for members who upload code examples on codeparl that inform and direct them on how to upload a simplified code example that any learner can easily understand and use.


Please note that when uploading any code example, the following guide-lines should be considered.

Code Example File Type

The code example file type you upload must not be a binary file such as an image, zip file, jar file, .exe file or any executable file. It Should be a text file or utf-8 characters representing a source code to be compiled or interpreted by a given run-time environment.

Uploading a Big Size Code example

Sometimes the code example you want to upload could be a very big file or multiple files That depend on each other the code work properly.
In this case you should follow these guide-lines:

  1. Upload the code example in parts

    • Upload each file as a part by naming all the parts with the same name and adding (Part) and (number e.g. 1,2,3).
    • For example, you could name your file parts like this “Java Calendar Page Part1”, “Java Calendar Page Part2”, and “Java Calendar Page Part3”
    • The suffix “part1” is the hint that tells codeparl that this code example is uploaded in parts.
    • Remember to tell the users in your descriptions how to group and test your code example files.
  2. Upload the main file only with dependencies

    • This should be the easiest way, simply upload the main file of the code example and add the remaining file in a zip file as the dependencies of the main file.
    • Add the zip file with any assets you have got otherwise just upload the dependencies as assets by clicking the “Add Assets” button.
    • Remember to inform the users who download your code example how to run your code example.

Attaching assets and dependencies

Usually code examples contain assets such as images, audio files, video files, fonts and other assets files. Codeparl allows to upload code example assets as a single zip file containing all assets and dependences of the code example.

This file should not be more than 2Mb otherwise it will be rejected. Note that when uploading code examples in parts and you attach some assets for part1, then when you try to attach an asset to part2, codeparl will ignore this asset and stick to the first one.

Code example dependencies are the files that make up the whole code example and without them the code could break when run and tested.

Using Online Code Editor

If you decide to upload your code example using the online code editor we provided, then you Should consider following theses guide-lines:

Set the editing language

Setting edit language will help you capture syntax errors and highlight the keywords of the selected computer language.
Use the editor options Panel and find the “Mode” option and choose which language to upload your code example in. After setting editing language then consider minimizing the lines of the code example you want to upload otherwise if the code example is too long, codeparl might reject your code example immediately.

Editor Option Panel
The Editor Option Panel

Make sure you select editing language first before typeing your code example.

Adding Code Details

Uploading code examples on codeparl requires adding code details in order to identify the code to be uploaded. Viewers can then understand which type of code to view and download. Code details refers to code tile, code language, code description and output screenshot.

Code Title

Code title should be ASCII characters (letters and numbers) that is no more than 100 characters. You should choose a name reflecting the purpose of the code example you want to upload. Use the suffix “Part” plus a number to name code example as a part that will make the whole code example when downloaded. It is better to use spaces to separate words in the name of the code example when naming your code example.

Note that code title is a required field that you cannot ignore when uploading code example.

Code Language

There are 154 computer languages that you can choose from to upload your code example. The code language you choose allows the viewers to search for code examples by their computer programming languages and are categorized according to the language you select for the code.

Note that code language is a required field that you cannot ignore when uploading code example.

Code Level

It is very important for codeparl members to simplify their code examples by setting them in levels so that the viewers who view and download them can easily modify them and benefit from them. The level of a code example on codeparl is determined by the length of lines the author reaches.

Experience shows that short code examples are more interesting and attracting than long code examples.

The Levels

  1. Simple
    • The simple level should make the code to be a maximum of 100 lines of code otherwise the code will be rejected
  2. Intermediate
    • The Intermediate level should make the code to be a maximum of 300 lines of code otherwise the code will be rejected
  3. Advanced
    • The advanced level should make the code to be 310 lines of code and above otherwise the code will be rejected

Note that code level is a required field that you cannot ignore when uploading code example.

Adding Code Description

With code description viewers can get guides on how to use your code example you upload on codeparl. This is done by adding a short description about your code example, code usage, code dependencies and the version of the code example.

The about section

Add an about section on your code description to let the viewers know the purpose of your code example and the expected outcome when it is run and tested.

The Usage section

As its name implies, by adding a usage section on your code description will inform the viewers how to assemble your code example files that are in parts and how, where to run and test the code example. The usage might include telling the viewers where to get the necessary platform and tools to compile and run the code example.

Code dependencies

You should add code dependencies if your code example is in parts or you uploaded it with dependencies wrapped in assets zip file (if your attached any assets). Code dependency is simply a list of files or code example names you uploaded on codeparl that work with the code example the user is currently viewing on codeparl.

Code Version

There are circumstances where versioning your code example is necessary, for example you might write a code example that has many logic errors which you did not realize in the first place or you want to add a feature (e.g. a function, new class and interface) to make your code example work properly. As a code example writer, you might want to refine your code example to make it shorter and easy-to-understand for new programmers.

All these situations allow you to add a version number to your code example so that the viewers find which good code example to download and test.

Attaching output screenshot

It is vital to know that attaching a screenshot will make your code example more interesting to the viewers. For example, a screenshot will help the viewer quickly know the outcome of the code when is downloaded and tested. The reason for output screenshot is very obvious in such that a user might download wrong tools or improperly install or configure his environment to run and test the code example and hence will notice that the code isn’t working as expected or might experience some errors.

For simple code examples it is not really necessary to attach an output screenshot.

Editor Option Panel
Example of an output screenshot for a calculator code example written in javaScript And HTML.

For more information on how to use codeparl web app, please go to help?

Register
Share this page on: