# New to coding; need a lotta help!

**URL:** <https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372>\
**Category:** Beginners\
**Created:** [August 14, 2019, 9:11am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372 "2019-08-14T09:11:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 14, 2019, 9:11am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/1 "2019-08-14T09:11:01Z")

</div>

I have been following along with Daniel Shiffman’s tutorial videos on YouTube, and some codes work but others don’t. I’m new to coding, but it seems that the problem is the variables I put in, that the reader(?) doesn’t recognize them. E.g.:

![pendulum%20%5Bdoesn't%20work%5D%201](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d0ad809235104651e162647c6fc1dbc1af6f3288.png)

Nothing appears on the screen; no pendulum! Where have I gone wrong?? The PVectors etc. are unknown? If so, how do I tell it to “know” them??

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [August 14, 2019, 9:35am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/2 "2019-08-14T09:35:23Z")

</div>

you show a photo ? snapshot? of what program ? webpage? ( you call “reader” ?)  
if that is a webpage with a editor using a file  
sketch.js  
you might want to write a

> p5.js code?

your variables ( PVector float ) and functions ( void )  
come from a

> JAVA code

please give more details what you try to do.

* * *

please note that this forum tries to help with BOTH,  
but what we look for is the header… where you selected Processing ( not p5.js )  
and also your code looks like Processing JAVA

so what we expect is that you have installed on your computer Processing 3.5.3 and use JAVA Mode.

> **[Download Processing](https://processing.org/download/)**
>
> Processing is open source and is available for macOS, Windows, and Linux. Projects created with Processing are also cross-platform, and can be used on macOS, Windows, Android, Raspberry Pi, and many o…

if you ref to this video

[![](https://img.youtube.com/vi/9iaEqGOh5WM/hqdefault.jpg "3.4: Pendulum Simulation - The Nature of Code") ](https://www.youtube.com/watch?v=9iaEqGOh5WM)

you also see that he work in the processing IDE ( old version )

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 14, 2019, 11:43am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/3 "2019-08-14T11:43:05Z")

</div>

The snapshot is of my reader (where I put the code in; isn’t that called a reader?) which is Sublime. I type in Sublime and the program runs in Firefox browser. As far as I know, I’m using the p5 code in Sublime (downloaded from the [p5js.org](http://p5js.org) website, so should be JavaScript, right?

I am trying to follow that video, yeah; I didn’t know he was using an old version so it might not translate to what I try…

I do have the p3 Processing reader(?)/text editor(?), but haven’t actually used it. Do you reckon if I try this with the p5.js code in p3 it might work?

As I say, I’m new to all this, so I’m slow to get what I need to be doing! So, apologies if I’m wrong…

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 14, 2019, 11:45am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/4 "2019-08-14T11:45:33Z")

</div>

I should also say, that Daniel from the video told me to ask things in this forum, because there’s a lot more of you than him…

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [August 14, 2019, 12:13pm UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/5 "2019-08-14T12:13:35Z")

</div>

hi, yes , you are very welcome here…

but at first i ask you to forget all the tools, the code , the videos  
it is UP TO YOU what you want to LEARN to DO.

basically you tell me if:  
want learn to make code for a good graphic show

> in a browser / online / so friends can see it ( with a link provided )  
> YOU must learn p5.js / write a sketch.js file / best online [here](https://editor.p5js.org/)  
> ( and make a account there )

OR

> learn JAVA used in a stand alone desktop app on your PC  
> best using processing 3.5.3 IDE and writing mysketch.pde files

* * *

but also it is true that in both cases the CODE you can write by any editor,  
we can not teach all in one question,  
so as a beginner i urge you to use  
JAVA \>\> processing IDE 3.5.3  
JS \>\> p5.js online editor

* * *

JAVA and JS, that are 2 different languages  
but the prepared functionality for processing  
makes it actually easy to work with both / even not all can be translated…

but i can not tell you how much confusing it might be to explore both in the beginning  
might be better you try like  
++ one month JAVA  
++ one month JS

even the teaching videos ( and the mostly also provided code)  
are helping for a fast learning curve,  
( also all the provided examples / tutorials… )  
you must start alone with a empty sketch  
and make just a line!  
JAVA \_ [line() / Reference / Processing.org](https://processing.org/reference/line_.html)  
JS \_\_\_ [reference | p5.js](https://p5js.org/reference/#/p5/line)  
just to prove that you are in the right ( and correct installed ) environment  
and use the correct language syntax.

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 14, 2019, 3:17pm UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/6 "2019-08-14T15:17:25Z")

</div>

Thank you for replying, by the way!

What I’d like to eventually be able to code for is e.g. evolutionary simulations, flocking (boids) behaviour, predator-prey interactions, etc. Simulations that mimic real life scenarios, randomly, if you know what I mean?

And thank you for all the information so far!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 14, 2019, 7:05pm UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/7 "2019-08-14T19:05:09Z")

</div>

> [@CipherMan](#):
>
> ; isn’t that called a reader?

Actually it’s called a text editor:

> **[Text editor](https://en.wikipedia.org/wiki/Text_editor)**
>
> A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be used to change files such as configuration files, documentation files and programming language source code.
> There are important differences between plain text (created and edited by text editors) and rich text (such as that created by word processors or desk...

And when it’s tailored for programmers as well, it’s also called an IDE:

> **[Integrated development environment](https://en.wikipedia.org/wiki/Integrated_development_environment)**
>
> An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as IntelliJ IDEA, Eclipse and Lazarus contain the necessary compiler, interpreter or both; others, such as SharpDevelop, NetBeans do not.
> The boundary between an IDE and other parts of the broader software development environment is not well-define...

> [@CipherMan](#):
>
> As far as I know, I’m using the p5 code in Sublime…

Sublime is both a text editor and an IDE:

> **[Sublime Text](https://en.wikipedia.org/wiki/Sublime_Text)**
>
> Sublime Text is a shareware text and source code editor available for Windows, macOS, and Linux. It natively supports many programming languages and markup languages. Users can customize it with themes and expand its functionality with plugins, typically community-built and maintained under free-software licenses. To facilitate plugins, Sublime Text features a Python API. The editor utilizes minimal interface and contains features for programmers including configurable syntax highlighting, code...

However, if you wanna learn more how to run p5js w/o an IDE, you should take a look at the recipe below:

> [@Code 800A0404 issue](https://discourse.processing.org/t/code-800a0404-issue/2036/3):
>
> Easiest & fastest recipe to run “.js” sketches under p5.js: running_man Install any Firefox-based browser in your OS and use it to open your “index.html” file: fox_faceInstall Notepad2 or Notepad++ (or both) in your OS and use it to type in your “sketch.js” file there: scroll[https://XhmikosR.GitHub.io/notepad2-mod/](https://XhmikosR.GitHub.io/notepad2-mod/)[https://Notepad-Plus-Plus.org](https://Notepad-Plus-Plus.org) You can setup those text editors to use UTF-8 and LF line endings for better compatibility. bulbHere’s my minimum “index.html” te…

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [August 15, 2019, 12:57am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/8 "2019-08-15T00:57:45Z")

</div>

> [@CipherMan](#):
>
> be able to code for is … Simulations that mimic real life scenarios, randomly, if you know what I mean?

no, above my level,  
but if you want learn coding then start:

> variables ( and their scope )

> FOR loops and IF ELSE questions

> functions

> classes

> array / list ( of classes )

for the show you might want to do with the mathematical question above,  
processing is a good tool, ( in all versions / JAVA / JS / PYTHON )

and the very basic question i lined out above already:  
JS \> in browser / local or online /  
JAVA \> in desktop app for Win/Linux/OSX

[![](https://img.youtube.com/vi/AmlAiKsiy0o/maxresdefault.jpg "Q&A #7.1: Comparing p5.js and Processing - Part 1") ](https://www.youtube.com/watch?v=AmlAiKsiy0o)

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 15, 2019, 8:21am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/9 "2019-08-15T08:21:30Z")

</div>

Thanks, Loop. Yeah, I thought it might be a reader; didn’t know about the IDE thing. I’ll try the Notepad way (been watching other Processing and p5.js videos, and one mentions using that), thanks!

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 15, 2019, 8:28am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/10 "2019-08-15T08:28:04Z")

</div>

Yeah, learning those things will definitely help, with all future coding, no doubt; thanks! JS in Sublime, then run in Firefox works (at least with some codes!). Following Shiffman, some codes work perfectly, and other don’t until I mess about and tweak and try a couple different things; but generally they do work, until it gets really complicated.

I do wonder though, about how you set up the whole thing. To use the p5.js etc. one video said to have the folder on the desktop, which I don’t understand (except that it worked when I did it, haha). Is this the same for other readers or coding languages? (Because I tried everything in p3 and nothing happened except a load of error messages! I assume I need to set it up differently?)

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 15, 2019, 8:33am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/11 "2019-08-15T08:33:20Z")

</div>

Also, the Sublime editor I’m using doesn’t show error messages like other editors do; anyone know how to turn them on, so I’m told which code is wrong where?

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [August 15, 2019, 8:55am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/12 "2019-08-15T08:55:27Z")

</div>

if you use the

- P5 JS online editor for JS

OR the

- processing IDE for JAVA

OR after install inside Processing IDE additionally the p5.js MODE

- processing IDE for p5.js

in all cases you got your projects ( like where the files are stored… ) handled.

if you use any external code editor ( or IDE ) / store file to desktop /…  
you must know / and do the project/file handling alone.

also we can not help you about that external tools,  
and even it can be that the SUBLIME thing is better as processing IDE or online editor …  
still you will be alone in this / as not supported here /

* * *

as you obviously decided to go with JS ( p5.js )  
you can ask your coding questions here,  
but still best way is to post just the link to your related online code  
like: [https://editor.p5js.org/kll/sketches/v4hWBOY-E](https://editor.p5js.org/kll/sketches/v4hWBOY-E)

if you try to post your p5.js code here / and it will not run ( as not complete or files missing …)  
might get much less help.

* * *

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 15, 2019, 11:02am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/13 "2019-08-15T11:02:05Z")

</div>

Thanks, kll. I wouldn’t be able to use the online editor, because I don’t have internet access at home!

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [August 15, 2019, 11:18am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/14 "2019-08-15T11:18:14Z")

</div>

> [@CipherMan](#):
>
> I don’t have internet access

that is bad luck,  
without access to the help/reference

> **[reference | p5.js](https://p5js.org/reference/)**
>
> p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.

download [https://p5js.org/offline-reference/p5-reference.zip](https://p5js.org/offline-reference/p5-reference.zip)  
and without the examples  
what do exist/work OFFLINE in the processing IDE 3.5.3 / p5js MODE see:

 ![processing353_p5jsMODE_examples](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/afcd1a60e050ffa68efd4ef2a8930d001a38cd50.png)

you will have a hard time / good luck

---

<div class="post-metadata">

**Author:** ![CipherMan](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Post date:** [August 15, 2019, 11:35am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372/15 "2019-08-15T11:35:45Z")

</div>

Ahh, offline references, that’s awesome, thanks, kll!
