Q+A

<aside> 🧟 Put your two questions here. Please include your [name.](<http://name.Is>)

</aside>

So, everytime we want to draw a shape or a point we need to indroduce is a variable? - Gonçalo

I think the answer to this is "no" but I could give you a better answer if you added some detail and context to the question. :)

PaperJs takes more paremeters that p5js, and sice PaperJs is more focused on graphics and request more information, is it also easier to debug? - Gonçalo

i think that they are both pretty focused on graphics, and they both have a lot of params. In some ways I think Paper.js is more organzized in its "parameters" but overall i think they are similar in complexity, learning curve, and debugging.

What type of situations would call for an immediate mode graphics library over a retained mode? (It seems as if retained would allow for faster/better processing, is that correct?) - Unnati

i started answering this question but every comparison statement I could think of had caveats.

Immediate mode is better/faster/simpler than retained mode _sometimes_ but...
Retained mode is better/faster/simpler than immediate mode _sometimes_ but...

To give you an idea of how debatable it all is...

<https://news.ycombinator.com/item?id=19768156#:~:text=As%20mentioned%20earlier%2C%20immediate%20mode,like%20in%20the%20retained%20model>.

Here are some people debating it.

This really is a _it depends_ situation.

Depending on what you are drawing and what hardware you are using one or the other might be simpler/faster/better.

p5 is immediate mode, and its very conceptually direct. 
1. Draw a rectangle.
2. Draw an ellipse.

This is good for learning and teaching. Pretty good for highly animated and highly interactive scenes. 

The DOM uses retained mode and thats a pretty good fit for a document or app where most of it stays the same from frame to frame, but parts are manipulated.

Similarly, what type of situations on the web would it be better to use raster graphics over vector? I notice when I’m building out sites e.g. my portfolio, it’s almost always preferred to use .svg for resizing/clarity purposes. - Unnati

svg is great for graphic images, logos, etc
but svg doesn't make much sense for a photograph

Do we need to learn an entirely new language to understand Paper? Like the way variables are introduced and how they’re written to just draw a line or rectangle is different; is that going to be the case to really utilize Paper? - Kevin

Paper.js is two things. 
1. A javascript library for drawing with vectors.
2. PaperScript. A different language based on Javascript. 

You don't need PaperScript to work with the library (but the examples tend to be in PaperScript). 

The good thing about PaperScript is it adds a couple of nice things for working with Points and shapes to Javascript.

The bad thing is that PaperScript is based on a pretty old version of Javascript, and lacks more recent features.

Kind of a tough choice. For sketches i might go with PaperScript sometimes. But for a full project I'd go with Javascript every time.

What if we just drew something on Illustrator and saved it as .svg as a sketch? Hahaha. - Kevin