Sokoban

Week 57 is over. Between weeks 56 and 57 I managed to squeeze in almost entire week where I was away from home, but now I should be back more permanently. Stuff got done, so let’s take a peek.

Continuing client redesign

The 10 main buttons have been pushed to the bottom of the client, and on mobile devices they scale in size, depending on screen width. Old chatbox with its myriad tabs (Events, Public/Private/Empire, Letters) has been broke down into separate forms toggled by the said buttons like this:

Current position of the box is certainly not final. I want it anchored at the top of the screen (instead of bottom), but for that I first need the topbar in place – the bar with the other main buttons/info (settings, elder info, etc). On the mobile front stuff hopefully looks a bit cleaner as well:

The Map drawer button is also destined for oblivion very soon, as it only gets in he way of accessing the map. In any case, the redesign continues.

Code Cleanup

I use PyCharm as my IDE. It’s cool as it obviously is written for Python but supports JavaScript, HTML, and CSS as well. However, over time – as the code gets bigger and bigger – the UI has become ever slower almost to the point of unusability. Trouble is that dtoe.js (the main “script” for the client that handles almost everything) is laden with a thousand warnings.

None of these are actual errors. Warnings are warning, “this code can be written a bit better so you don’t access DOM objects multiple times”, “this if statement can be simplified”, “you’re not supposed to be using a value field in a td block”, “you are referencing an object I know nothing about”, etc. Sometimes I write stuff inefficiently because it’s easier to read (at least to me). Sometimes I have valid reasons to “break” standards and use odd fields for stuff. And of course, after every refactoring, a few bits and pieces remains floating that are not used any more, akin to redesigning an engine and ending up with a handful of bolts and screws that are no longer needed. If you don’t dispose of those, the IDE will throw fits and pester you with the dreaded yellow color of warning. However, when 6 thousand lines of code get a yellow overlay, things slow down.

Or – do they slow down because there are 6 thousand lines in the first place?

Not a clue. I started to clean up this code anyway. After a few days of frantically sweeping left and right, I’m down to something like this:

It still has some yellow and dark warnings, which are warning issues and minor issues I’ve yet to resolve, but it’s certainly different than what it used to look like – an entire yellow warning bar across the whole right side, top to bottom. Is the IDE a bit faster now? Time will tell (but I don’t feel it). I fear that the slowdowns are not caused by actual warnings but by the effort to parse everything over and over again, after every keypress. Still, cleanup was bound to happen.

Enough chatter, onto new victories. See you next week.