DajSiePoznac summary

Daj Sie Poznac summary

With May coming to an end, it is time to summarize DajSiePoznac competition.

First, few numbers:

Views: 1156
Visitors: 891
Posts: 36
Commits: 138

Thanks everyone for visiting!

Second, project progress. It has been good. I’ve done a lot, more than I thought I will manage, between work, private life and everything. 36 posts, 138 commits. And With those commits came some code. Moving objects around, drawing stuff in javascript, calculating collisions in couple of ways, reacting precisely to those collisions. And synchronising everything between multiple players on simple html web page with SignalR. Not exactly ground breaking, but gave me a lot of fun and helped me produce working prototype that will be further extended.

With all of that, I hope I did well. Cheers!

Advertisements

Don’t be afraid of changes

Early this year I changed companies and started working for a bank. They promised me working with highly specialized software, global standard in its category. And they promised me .Net platform. First they delivered, second they failed for more than 9 months now.

Now I do complain a lot. But at the same time I am afraid of acting on what I feel. So I tried explaining it to myself that this is just temporary, they will update their software, we will go forward. Now I finally see things as they are – change is no coming any time soon. And its my life and no one will take care of it better the myself.

I’ve raised my issue to people above me. And starting from next week I’ll be back at .Net project, WPF, WCF, tasks – you name it. It wasn’t hard. All it took was a bit of honesty about the situation and idea on where I would lie to be and everyone was happy to help.

Don’t sit quietly in uncomfortable situation, take care of your professional life and be honest about your work. The world is your oyster!

Does tooling and language actually matters?

We are developers. Software engineers. We struggle everyday with our creations, trying to make them better, faster, more reliable. But we work mostly with text. Programming didn’t change much in that matter – give me a notepad (or better Vim) and compiler and I can rule the world. But can I?

8 months ago I started working at one company in very niche software. Well, it may be actually pretty popular and it made (and continues to make) a lot of money to company that wrote it – that one I’m sure of. I’m working with slightly outdated version. 2-3 versions behind but I’m not sure. So what I do is write scripts to support business logic. And I write them in some C-like language made specifically for this program. It comes with built in functions that help to work with table data (like sorting, calculating values, selecting subsets etc.). But that’s about it. No IDE support, no intellisense, heck, not even easily accessible compiler! I can write those scripts directly inside software running them but the editor there offers less functionality than Notepad (literally! Not even ctrl+a support).

So can I rock the world with notepad? Well, I’m sure making it go round. Scripts are running fine. But at what price?

  • No TDD for me. No compiler, no external runtime environment – no way to run tests. Untested code leads to a lot of small issues in code (mine and others). And a lot of risk with each new feature, bugfix and refactor.
  • No easy compilation means I write a lot of lines of code before I check if they are even correct. Mess up parameter here and there, skip semicolon somewhere, typing mistake in function call – all easy to fix, but when you have dozen of those mistakes in hundred or so lines of code it takes time to fix them. And time is money. You want to know how my compile “shortcut” looks like? Ctrl-a, Ctrl-c, Alt-Tab, Alt-e, Enter, Ctrl-v, Ctrl-s. Seriously.
  • Deploy process is so hard to automate apparently that everyone tries to keep number of files low. 3k lines of code in single file? If you’re lucky. Usually you can easily hit 4k. And to share code, your file needs to be marked as include file. And then it’s not able to run on its own. So most of the code gets copied and pasted around as fast solution for code share because no one bothers moving simple functions to shared libraries.
  • I’ve got so used to C# etc. that it hurts me when I need to create function header at top of the file because otherwise compiler will not recognize functions declared below place of usage. As a result we have long functions doing all kind of things since extracting function is so much trouble
  • Language as a whole is so exotic that there is no tooling support for refactor or anything. I use C# color syntax since it’s the closest to script syntax
  • One could at least have good debugger to work easily with issues. No way. Turbo Pascal had better debugging tools and this was how many years ago? All code is thrown in one window, no distinction between files – so you have 10-20 thousand lines of code to work with. No watch – you need to select variable and click on a button to output it’s value to output window (it’s simple log window). Breakpoints are not even marked somehow readable – just by B letter to the left, over line number. Current execution line is indicated by => characters – try finding it in 10 000 lines. You will make small change to script (say – change one character) and restart debugging – all your breakpoints are lost. There is even no step over functionality. You have to step into each function call or set breakpoint at next line and let the code run.

And I could get few more points probably. So to sum it up – code quality is very low, code duplication is very high, no easy way to fix it. Working in such conditions is very hard, everything takes way more time than it should in decent working environment. And developers time is money. Business have to struggle with issues, waiting long before fix finally makes it to production – this cost even more money. And we’re not talking about hundreds of dollars.

You could tell it’s our fault – we could work with this and still make good code. We could extract shared code, refactor it. Create custom tools etc. But that takes an effort – you need to work hard to get simple things done. Things that any other popular language these days have already worked out in many ways – just pick solution that suits you best! And we, as developers, are lazy. We want things to be easy. We want work in 21st century conditions.

And I’m right now at year ’95. Or maybe not even there…

Binary serialization is no fun

I’m currently working on an iPad project that communicates with Java service. Nothing fancy, right? Yet, instead of using JSON or XML, communication goes using AMF protocol with binary serialization. Doesn’t sound scary at all, binary serialization is fast, output is small, we all like it, right?
Wrong.
Now, I didn’t get any automatically generated classes that I can synchronise with service in few clicks, like I could do with WCF. I got some classes generated by developer who was taking care of the project before, but those classes got a little bit outdated recently. There is possibility to convert Java classes into Objective-C code using some converter that this guy wrote, but it’s not perfect, it would take me some time to fix some issues from autogenerator. But more important, if something breaks down it takes so much time to find out what is wrong.
Few days back I was trying to figure out what went wrong so I can no longer deserialize data from service. In world of XML you look at elements, attributes and it’s pretty easy most of the time to find out what’s wrong. If XML has some additional attributes or elements, serialization usually don’t care or at least gives you clear error message saying what is wrong, which piece you are missing. Binary serialization – it don’t. You just get some pieces of binary data and convert them into objects hoping everything will go right. Of course AMF helps you with that up to some point, but not always.
So I was trying to fix this problem. Watching binary data, trying to figure out what’s going on. One thing that helped me was library reported object of type 78. Clearly, this didn’t fell into enum values, which start me wondering – what could it be? Quick look into ASCII reveals capital ‘N’ letter. Then, next property should be “New” text value. But next property, not the current one. Clearly – I got 2 bytes to far into the data. No need to go into details, but this made me to go to Java service, and piece by piece look through clases to find out which property I missed. And there it was, boolean property that appeared in service class definition.
All this took me some time. Using JSON or XML it would take me minute or two.
My advice – go with JSON or XML to make your life easier. If you think that it’s to big or to slow, thing again. Try to redesign your service, think if you really need to send all this data to client. Probably not. Time saved on coding, debugging, looking for errors – it invaluable. You must have really, really slow device that couldn’t handle parsing normal data formats so you would need to go into binaries.
Save binaries to images, movies and music. Keep data easy to discover, easy to read, easy to use.

Let’s get it started

It’s time to finally start blogging. Hope this will help me organize things in my mind and put some of ideas and/or solutions into the web for future me and possibly for you, dear reader.

First let me introduce myself. I’m Jarek, software developer from Poland. I’m currently coding for last three years (as an employee), but I’ve been having some serious fun with code for past 10 years or so. I’m using mostly Microsoft’s technologies on .NET platform, like C#, VB.NET (unfortunately), Visual Studio and so on. Apart from that I like reading good (not necessarily software-related) book, watching good movie or tv show. And who doesn’t.

Yeah, that’s more than enough, let’s get it started with some more serious stuff soon.