PsychoPy is great, but

PsychoPy is great, and it offers the best options to code experiments. But, there is a but…

Let me clarify that I am not ranting, but rather suggesting.

Builder is great, especially for those who don’t know how to code. It has become so simple to develop experiments that you may get away with running a study without writing a single line of code.

But I think that the encouragement to use builder stymies the development of students to improve themselves to write code. Anyone who uses the builder interface will know how hard it is to debug and find out problems. Especially if you are coding a more complex task which relies heavily on code, using builder becomes the burden.

Also, the code generated by builder is too convoluted or boilerplate code (although I can see that this has improved as new versions of PsychoPy were released) but there is a lack of tutorials which would give people an idea how to code using an external IDE (instead of builder) and write functions which utilize the PsychoPy library. For example, it is very possible to have pre-builtin functions which handle presenting specific types of stimuli (images, text etc.) to draw them, to expect responses and to save data all in one. If these were there, it would be easier to code outside the builder.

The real issue is that using builder pushes students to become lazy to learn how to code. This especially makes it more difficult for them to learn how to debug because most of builder’s functionality is not transparent. Students need to learn how to code to succeed. Builder is so pedagogically appealing makes it difficult for the students to proceed and learn coding.

To summarize, I believe that there should be more encouragement (tutorials and prebuilt functions) to write experiments without using builder and example scripts that utilize the library which allow students to think out of the box. This in turn, will allow students to develop actual skills (coding) instead of specializing in a toolbox (PsychoPy) which need not be transferable to other fields (ie., data analysis or software development).

You may want to use Builder’s built-in option for compiling experiments to Python where you can study the code. Alternatively, use one of the many tutorials that ship with the install of PsychoPy where you can learn how to set up routines in the builder and the underlying code.

1 Like

Personally I’ve found learning Python through adding code components to PsychoPy experiments in Builder a really helpful way to learn the language. It means I can focus on what I want to achieve rather than having to work just to get something onto the screen.


I want to add a few more things to my OP.

In the twitter thread, I saw someone mention that using coder is more modular. I must add that, yes indeed! It is muuuuuuuuuch more modular.

I think I wrote around 7-8 experiments during the past 1.5 years and basically what I did was, write one experiment once and from there I used it as a template for other experiments. Let me do mention that these experiments, by design were very very different from each other! If I used builder, I would have to delete a bunch of routines, bother myself working in the GUI. Or just start-over in builder from scratch for each experiment.

On the other hand, my custom written functions and data handling system allowed me to code new experiments in just a few days.

Sometimes I may need to help someone fix some issue with a builder code. I generally put their builder aside and debug using the python script generated, because I can not handle all the difficulties it causes to track variables etc.

My rant in the original post was about the push for builder, rather than builder itself. I think people should be given more opportunities to use the library itself instead of builder. This can only happen if people see how easy it actually is to use the coder or the library.

This indeed allows students to learn how to code. But, they actually do not know what all is happening in the background. For example, it does not occur to them that a “loop” in the builder, is actually a Python loop which iterates until it’s done. For them, debugging those loops in particular becomes very difficult.

1 Like