musicmatzes blog

This is the third part of my series about C++.

After some serious discussions with several people, I came to a conclusion. Well, not really a conclusion, as it was clear from the beginning of the series or even before, when I started to learn C++ at my university, but a point where I can say that C++ is not as shitty as I thought before.

Well, even the word “bullshit” isn't the right terminus.

C++ does some things which seem to be really really weird when you first start learning it. After all, I wouldn't suggest it as first programming language to a newbie!

I still consider the syntax of C++ as bloated and not really helpful in certain ways, as (for my taste) one can hide too much of the relevant stuff. One cannot directly see what's happening in a piece of code without knowing the stuff around the code, the infrastructure or at least the types of the variables. Other languages solve this “problem” much better.

I had a discussion with a friend of mine who is really into C++ and he explained the benefits, which I fully understand. I also had a discussion with a friend who is at most a C++-Critic. Both of them made valid points.

After all, it is a matter of taste whether you like C++ or you don't. I do not like it. I can see its benefits over C, but I consider other languages as better. C++ has a historical background, of course. I don't want to ciritcize this, but I think there are other languages which adress the problems C++ addresses much better today.

I'm speaking of D, Rust, Go and the like, of course. I also consider languages like Haskell, Erlang, the whole Lisp Family and the JVM stuff as better solutions to most problems. Not only that I consider them as easier to learn, but also much easier to maintain and less cluttered with language elements one has to understand to work on an existing codebase. tags: #programming #c++

Well, I am switching my blogging tool again. But I guess, this time, everything will be fine the way it is now.

The new tool is called “frog”.

And it is written in Racket, the programming language I'm learning at the moment. It has some nice features and targets bloggers, so it's the right tool for me, I guess. It generates static sites, so yay! No more update hell, at least not on the server! Racket uses a special versioning policy to prevent the dependency-hell, maybe this works also well for updates? I'd love it!

So, I'm using frog now. I converted my old entries to its format (which is Markdown, but it wants a specially formatted header at the beginning of each Markdown file) and it generates it really fast (hopefully it scales...).

So, I hope you like it. Some of you have requested a atom/rss feed, it's integrated, so here you go...

tags: #blog

When developing open source software, one cannot chose who participates on the project. At least not when it's the kind of open source project “I start something on github/bitbucket/whatever and if people want to contribute, they can do it”.

When developing open source software in a team, for example in a project from your university or so, you can, indeed, choose your project members. You can't do this every time, because some universities have some fucked up rules that project members get chosen randomly or something, but sometimes you can.

So here are some short notes what you definitely have to take care of when you're in the position where you can choose your project members:

  • Review capabilities

Your project members must be able to do constructive reviews, spreading positive criticism. Otherwise, they'll freak you out! I gurantee it!

I always try to be constructive when reviewing source code. I try to avoid terms like “this sucks” or “this is complete bullshit” – these just worsen the mood in the team!

  • Skills are not enough – you need enthusiasm

You can choose the most skilled guys around. You won't succeed with your project. Choose people that are not that familiar with the environment but who have enough enthusiasm to succeed. I guarantee you – they will surprise you!

I don't think I'm the most skilled programmer out there – of course not. But I have enthusiasm which keeps me attached to something and I'm willing to improve myself every single day. I think that's much more important than skills per se.

  • Enthusiasm + Skills + 24/7 work = Burnout

This is more an advice for you directly, but it can also help you when choosing your project members. If you have enthusiasm and enough skills to succeed with your project, don't work 24/7. It will kill you! Take a break every 7 days or something. Do something else. In another environment. You will be much more efficient afterwards, when coming back to the original project!

I noticed this myself, after 8 weeks of daily working on a project, I had to stay back for one day. The day after that day was much more relaxed than the days before!

  • Less skills, but will to learn is more valueable then the other way round

I also like to suggest: Choose members who are not that skilled but willing to learn new stuff. If you do the other way round, they might do a great job, but they won't get better and they will do mistakes over and over again.

As I already said, I don't consider myself as the most advanced programmer out there, but I'm willing to improve. I make mistakes – everyone does, of course! But I always try to think back of previous mistakes I made and I'm constantly trying to avoid making them again.

  • If your lifeblood is in the project – always remember that for other project members this is not true

It's sad, but some people do open source just for the sake of open source, their graduation or some assessment at the end of the term or something like that. Always remember: These people are everywhere. And if they are in your project (you may not notice that when choosing them), you can't change that. Just take it as is.

When I'm writing software, my heart is really in it. For others, this is not true. I had a hard time learning this, but it's true. Sadly.


Of course, these points aren't carved in stone. But they are taken from my experience and maybe others can confirm. At end, everyone has to make their own experiences.

tags: #programming #open source

Well, I finally managed to get my feet wet with a functional programming language.

Its name is “Racket” and it's a Lisp/Scheme. I really like it by now, as it is a whole collection of programming languages, featuring a lazy variant, typed variant and tools for writing slides or web pages / books / sheets and whatsoever.

I came up with the idea of transforming this blog into a piece of HTML generated by Racket code instead of Markdown-to-HTML rendering with a bash script and maybe I will do this, but not now or in near future, as I don't know Racket enough by now.

Currently I'm trying to implement problems from project euler, to get my feet wet with Racket. My plan is to implement 10-15 euler tasks and then switch to something more advanced (well, euler is advanced for me, mainly because I'm really tired at the moment) like a IRC Bot or a Brainfuck interpreter or something like that.

Stay tuned, I'm sure I will write more about Racket as soon as I have something to write!

At this very moment, I'm writing code for waysome, our wayland based window manager. And it really bothers me that most of the wayland codebase is not documented.

Basic documentation for the API of wayland is simply missing. In some cases, it is obvious what a function gets as parameters, but in other cases it is not. And wayland is not the only problem here, there are other libraries which lack of documentation.

I do not understand why people don't consider documentation as code. For me, documentation is source code and because of that, everything which gets written has to be documented in a proper way.

Also, the wayland people suck when it comes to their build environment. Their documentation is doxygen based. But you cannot generate the documentation using “make doc” or something similar. You just can't, it does nothing.

I don't know what they are doing all day long, but I know it's not documentation.

/endrant

tags: #programming

In my semester project at my university, we're developing a wayland based window manager for power-users, featuring very granular configurability and abilities to customize it.

As the lectures in this semester started on monday, we started hacking it on monday as well. We are 5 team members, me as repository maintainer and guy with the how-to-git knowledge, a close friend of mine doing the workflow and milestone organisations (as kindof scrum-master) and three other close friends of mine, all in the same course of studies.

In my opinion, we are very fast for this first week. Of course, when doing a scrum like approach, you have to get to milestones in short sprints, but I never imagined that we can do two milestones within the very first week, one of them beeing a picture on the screen! That was a very good experience, beeing that fast on the very first strike.

The next milestone, we want to reach in five days is using a desktop application with the windowmanager.

I almost forgot: The window manager is called “waysome”, for “wayland” and “awesome” in one word. We had this name in mind from the very beginning of the idea of writing a window manager on wayland, so we simply took it.

So, why is this so special? Because it is new! We use wayland, which is absolutely new technology when it comes to display server like things on linux. But not only this is new. We also do not define a behaviour of the window manager, but expose an API through which the user can send commands to the window manager for defining its behaviour. The API is meant for beeing used via scripts or utility programs the user has to write himself (not i3-like with “i3-msg bla blubb”). So the user has the power about every aspect of the window manager. This is also why we do not call it a “tiling” window manager, because it doesn't do tiling. If the user writes a configuration/script/plugin which makes the window manager behave like a tiling window manager – fine! But we don't define this!

The very idea is that you can “rebuild” your favourite window manager. You like i3, for example? But you want wayland? So use waysome and write a script which makes it behaving like i3! If you don't like some quirks of i3, you can simply leave them out! If you like awesome more, your can make waysome behave like awesome. Or whatever other window manager you like!

So, that's the idea. Our semester project should be finished at end of January 2015, I hope we can make it. We also have the idea of going to 31C3 and holding a short lightning talk about this. Maybe we will do this.

For more information and watching us working on it, feel free to watch us here.

tags: #programming #open source

Today I will teach a classmate of mine a bit about git. I searched the web for tutorials, so I can refer to them, but hey, there are thousands out there.

So I came to the question: Which one should I link? They have things in common, some of them are better, some or not so good. But some of them have really different approaches on how they teach git. And that's my point: If you want to learn git, you have to search for a tutorial which fits for you and only you. It could absolutely be that you love the tutorial I used when I learned git, but it could also be that you hate it.

What I would encourage you to do is searching 3 to 5 different beginner tutorials and always reading the first two paragraphs or something. Then decide which one you want to use.

There is no “best” tutorial for learning git. There are only ones that fit your needs and other whichs don't. For example, for my classmate, I personally would search some more technical examples which also covers the “how does it work internally” part, at least at the surface. But maybe she would use a really basic tutorial which only tells her how to get shit done... who knows?

And with this statement, I'm coming to the next point: When it comes to git, and you want to collaborate with others (or you want to write a piece of software and share it with others afterwards, which enables them to collaborate with you), there is one thing: Know. Your. Shit.

You really should know how you do certain things right, so you don't break the overall workflow of the project you contribute to. That sounds more complicated than it actually is. You basically have to know how to fix history if it got messed up (in manner of a lot of “Fixup abc” commits), how to update your local copy and rebase your work onto the changes of the upstream repository, how to do pull requests right and how to write a clean history. Again, that sounds more complicated than it is.

If you know how to do the basic things right, you will have a less hard time using git in collaboration with others.

For example, I have another classmate. He uses git for ... dunno... maybe 4 weeks or so. He still did not get the difference between his local copy, his remote copy and the upstream repository. This leads him to confusion every single time he wants to contribute. And he fucks up the history pretty often, resulting in pull requests the maintainer of the main repository (me, actually), rejects because there is stuff in it which does not belong there. For example merge commits where he merged the upstream master. Or the pull requests is the hell of an outdated one and I cannot merge it because of merge conflicts.

He doesn't know his shit, and it slows down the workflow of the whole project sometimes (actually, just mine, but whenever I have to struggle around with his damaged pull requests, I cannot do the actual work with the other pull requests).

So, again: Know. Your. Shit.

And every good git tutorial should teach you these things. If it doesn't, it is not a good one. So here goes my next advice:

If you do not understand in a git tutorial after reading it several times, switch to another one and restart. Yes, restart. Start reading the other tutorial right from the beginning. Why? Because:

  1. The tutorial might has stated important things you're skipping when you switch directly to the point you stopped in the old tutorial with.

  2. Re-reading things you already know memorizes it.

It is like learning a song on the piano: The more often you do it, the more you know it. But if you always play it from the start to the end, you know the start really good (as you play this one more often if you restart after failing), and the end not that good. That's why some people start at the end when learning a song on the piano: The play the last line, then the 2nd last and the last, and so on. When they made it to the very beginning, the have to re-learn the beginning several times and afterwards, they can play the song just perfectly.

That's a really basic trick, but very effective. Sadly, this does not work when learning something from a tutorial, because a tutorial has to be done sequentially. But I guess you get the point.

So, let me make my points up:

  1. Know. Your. Shit.

  2. Learning with tutorials is good, but they have to fit your taste and need. If you do not understand certain things after re-reading them several times, switch to another tutorial

  3. Extra point: Take your time. Rom was not build in one day, and neither you have to get from beginner level to expert level in git just in one day.

  4. Another extra point: Tutorials are good, but sometimes it is better to actually talk to someone (I know... yuck!)

  5. Finally: When working on a collaborating team after you learned the basics: Ask people about how they did things and about their tricks (short: go on learning. Every. Single. Day).

That's it. Cheer up, you can make it! tags: #git #tutorial

From today until friday, there will be a number of presentation for software development tools and basics at my university. I organized this with a friend of mine as preparation for our semester project.

We will talk about 9 different topics:

  • bash scripting
  • git and github
  • C programming (no basics but advanced stuff)
  • How to properly document source code
  • C++ programming
  • How to use gdb and valgrind
  • How to use cmake
  • Threading in C and C++
  • Introduction to OpenGL

in this order. Three of these presentations are held by myself: The one one git and github, the one on source code documentation and the gdb/valgrind one.

My slides will be, of course, published on github, as soon as the presentations are over. Note that they are entirely written in german.

These presentation will be a preparation for our semester project, which will be written in C. So, some of these presentations are not relevant for the project, but they are interesting anyways. We initially wanted to teach ourselves how to do things properly. Then, some more stuff got into the list of presentations and we decided to make the presentations open for everyone, so everyone can benefit from them.

Today, the first two (bash scripting and git/github) will be sermonized.

tags: #software #tools

I own a second notebook (my old one) which currently runs Debian stable. I use it for skype only, as I don't want this proprietary software on my main machine. Recently, I deinstalled a lot of crap which comes with Debian per default (in the Gnome version). I deinstalled Libreoffice. I deinstalled Gimp. I deinstalled similar software nobody needs (on a skype-only machine).

Suprisingly I deinstalled network-manager as well. I don't know how this could happen! Now, how to reinstall the network-manager if you cannot access the internet? Well, if you did not reboot, it might work. But I did! It's really simple: Just go to the Debian-packages website and download the package. Then, transfer it to the appropriate machine and install it with

sudo dpkg -i package

Well, you can only do that if you have another machine where you can download the package. If you don't have such a machine, you should ask a friend or so! If you didn't run

sudo apt-get autoremove

The package may be remaining in the cache of apt-get. You have to google around where this cache is, but the procedure should be the same, if you found the package.

tags: #linux #debian

I'm really happy at the moment. I recently started in contributing to neovim.

I've done three pull requests by now, one is already closed (without merge, though), the other two are still pending but one of them looks really good. Just wanted to share...

tags: #vim #programming #neovim