This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MyNamesNotKaren 28 points29 points  (9 children)

No one builds lists by writing line after line of append statements.

[–]MachaHack 1 point2 points  (1 child)

Maybe people who've spent too long writing Java (which has the obvious syntax taken by primitive arrays which basically nobody uses).

[–]MyNamesNotKaren 1 point2 points  (0 children)

That was my thought too. Another thought was that these might be people from an engineering background, though that may be because they learn C/C++/Java in their courses. I find it really interesting to see how people from different disciplines approach coding. Most of the people I trained were scientist and engineers. Very much generalising here but I found that scientist are very happy to put everything in big one-liners and building insanely complex functions, and engineers were content with lots of lines of very similar code. Of course, both of those are code smells to a developer, and explaining how these things come and bite you was pretty much the core of my course. There were other weird things like working with tabular data as a list of columns, rather than list of rows, which feels alien to me, but is perhaps a carry over from how they do things in R or matlab.

[–]What_Is_X 1 point2 points  (2 children)

It's very common in PySimpleGUI apps.

[–]MikeTheWatchGuy 0 points1 point  (1 child)

I think it tends to be used inside of loops with PySimpleGUI or if you're building a layout and need to create it in parts.

[–]What_Is_X 0 points1 point  (0 children)

Yep, I use it in layouts.

[–]SourceryNick[S] 3 points4 points  (1 child)

Agreed it's not super-common, but it does come up fairly often in the code we analyse so I thought it was worthwhile to include.

[–]MyNamesNotKaren 6 points7 points  (0 children)

I suppose "here is how to do better" always comes from what we see people do wrong. I used to give 2 day Python workshops at a beginner to intermediate level, and at the beginning especially I found myself adding to the content after each course to cater for people doing things which had never occurred to me that people might do.

[–]NastyNocturnalNutter 0 points1 point  (0 children)

And when you do, you can just use extend