Tag: software engineering

Entries for tag "software engineering", ordered from most recent. Entry count: 31.

Uwaga! Informacje na tej stronie mają ponad 3 lata. Nadal je udostępniam, ale prawdopodobnie nie odzwierciedlają one mojej aktualnej wiedzy ani przekonań.

Pages: > 1 2 3 4 >

Jul 2010

A Random Thought on Over-Generalizing

I don't post next part of the description of my reflection system yet. Instead I just want to share a small thought that came to my mind today. It's about over-generalizing, over-engineering, writing overly-abstract code or however you call it. Using too much OOP is not only the matter of code perfomance, but something deeper, more ideological. Interesting blog entries about this topic are: 5 Stages of Programmer Incompetence (see "The Abstraction Freak" paragraph) and Criminal Overengineering @ yield thought, Smartness overload and Smartness overload - addendum @ mischief.mayhem.soap. A Counterpoint can be found at cbloom rants. And finally here is my idea:

It is a vicious circle. Here is how it works:

But I believe this is true only to some degree. We obviously need a general, universal code sometimes not to do the same, monotonous or error-prone work over and over again. That's why we create and use libraries. And that's why I've coded my reflection system :)

New: I can see similar vicious cycle in a programming language development, inspired by an article I've read today: Google engineer calls Java and C++ too complicated. For me it looks like this: software engineers, companies and committees develop very sophisticated programming languages because they want them to be as much general and universal as possible so developers don't have to learn and use many specialized languages for different purposes. Developers don't like to learn many new programming languages because they have bad experience from learning and using such universal, spohisticated languages.

Comments (0) | Tags: software engineering philosophy | Author: Adam Sawicki | Share

Jun 2010

Programmer Incompetence?

Today I'll be a little more philosophical, of course in terms of programming philosophy ;) I manage a long list of Web addresses I'd like to visit in my free time (which I gather mostly from Twitter) and today I've visited these two places:

They reminded me of my old thought that on the way of mastering the art of programming there is no such thing as diversity - no place for personal preferences that would be only a matter of taste, like favorite music. There is usually only one correct path. All the good practices and solutions are just a function of what do you want to do and what technologies do you use. I constantly learn stuff, interact with programmers better than me as well as observe and talk to these who just start their adventure in the programming world. From all these experiences I can see that there usually is a single, correct solution or the way of thinking about simply anything. The one who doesn't agree with it is just not "mature" enough to be able to see that. Another sad truth is that this "maturing" process cannot be accelerated - one can read about the "correct" way but just rejects it until he will come to it by himself.

I especially like the 5 Stages of Programmer Incompetence entry. Here is my self-diagnosis against its points:

Comments (1) | Tags: software engineering philosophy | Author: Adam Sawicki | Share

May 2010

Some Thoughts about Library Design

Much has been said about designing good user interface, whether for desktop applications, websites or games. There are whole books available about GUI design and even this year's IGK-7'2010 conference featured two lectures about the interface in games. But what about interfaces for programmers?

I can't find much about the rules of good library API design and I believe there is much to say in this subject. I only know The Little Manual of API Design written by Jasmin Blanchette from Trolltech/Nokia, one of the creators of Qt library (thanks for the link Przemek!). There is also a blog entry about Math Library, which is quite interesting. Inspired by it, I've came up with a general thought that you cannot have all the following features when designing a library and its API, you have to choose 2 or 3 of them and make some compromise:

I think some patterns and best practices as well as some anti-patterns could be found when you look at interfaces of many libraries. Maybe I'll post some more of my thoughts on this subject in the future. In the meantime, do you know any other resources about API design?

Comments (2) | Tags: philosophy software engineering libraries | Author: Adam Sawicki | Share

Nov 2009

The Concept of Immutability and Descriptor

An object of some class represents a piece of data, chunk of memory or other resource along with methods to operate on it. It should also automatically free these resources in destructor. But how should modifying these data look like? There are two possible approaches. As an example, let's consider a fictional class to encapsulate Direct3D 9 Vertex Declaration (I'll show my real one in some future blog entry). A Vertex Declaration is an array of D3DVERTEXELEMENT9 structures, which can be used to create IDirect3DVertexDeclaration9 object. First solution is to define class interface in a way that data inside can be modified at any time.

class MyMutableVertexDecl
  // Creates an empty declaration.
  // Frees all allocated resources.
  // Copies data from another object
  void CopyFrom(const MyMutableVertexDecl &src);
  // Deletes all internal data so object becomes empty again.
  void Clear();
  bool IsEmpty() const;
  // I/O (Serialization)
  void SaveToStream(IStream &s) const;
  void LoadFromStream(IStream &s);
  // Reading of underlying data
  size_t GetElemCount() const;
  const D3DVERTEXELEMENT9 & GetElem(size_t index) const;
  // Modification of underlying array
  void SetElem(const D3DVERTEXELEMENT9 &elem, size_t index);
  void AddElem(const D3DVERTEXELEMENT9 &elem);
  void InsertElem(const D3DVERTEXELEMENT9 &elem, size_t index);
  void RemoveElem(size_t index);
  IDirect3DVertexDeclaration9 * GetD3dDecl() const;
  std::vector<D3DVERTEXELEMENT9> m_Elems;
  IDirect3DVertexDeclaration9 *m_D3dDecl;

This approach seems very nice as you can create your object any time you wish and fill it with data later, as well as change this data whenever you need to. But at the same time, a question emerges: when to (re)create "destination" IDirect3DVertexDeclaration9 from the "source" D3DVERTEXELEMENT9 array? Each time the array is modified? Or maybe each time the IDirect3DVertexDeclaration9 is retrieved? Optimal solution for the interface above would be to do lazy evaluation, that is to recreate IDirect3DVertexDeclaration9 whenever it is retrieved for the first time since last time the D3DVERTEXELEMENT9 array have been modified. But...

Read full entry > | Comments (2) | Tags: software engineering directx .net physics c++ | Author: Adam Sawicki | Share

Aug 2009

About the Guy Who Made Love

Today I want to talk a bit about what's the dream of almost every passionate game developer. It seems very hard or almost impossible to achieve, but younger amateurs still hope that they will manage to do it someday. Of course I'm talking about making a 3D MMO game.

As it turned out for me today (thanks for the link KriS!), it actually IS possible. I'm talking about the game called Love written entirely by one person - Eskil Steenberg. He have coded all the software from modeling tools through network protocol and renderer until game mechanics. To see it working I recommend watching these videos. The game is powered by his engine called Quel Solaar, which is actually available for download.

I must admit I haven't been impressed so much for a long time. I suppose the amount of time and passion that had to be put into this code is enormous. Graphical style and gameplay, as well as the user interface of his tools are very unusual and surprising. And all of this is made by one guy...

I recommend watching his lecture from this year's Assembly party titled Developing the technology behind "Love". You can see many technical details and if you don't want to watch the entire one hour video, at least watch the beginning (where he talks about his "smarter way of doing things") and the ending (where he expresses his thoughts about the value of good tools).

BTW it's also nice to watch new videos from GC 2009 of the CryEngine 3. "What you see is what you play" and instant asset update (including textures) - that's how good game editor should look like :)

Comments (2) | Tags: software engineering networking web rendering games events engine demoscene philosophy tools | Author: Adam Sawicki | Share

Aug 2009

How Do People Write Bad Code

Recently yarpen posted some thoughts about source code scalability on his blog. His blog entries are always very valuable and this time he touched broader subject which is connected to software antipatterns.

I want to expand this subject further and think a bit about how is such bad code created (we all agree that non-scalable code is bad, right? :) In my personal opinion it's generally caused by the lack of thinking. For example, if a coder have to code something (or, how some people would like to say: to solve a problem), he should first consider what possible solutions are. This may be choice of a technology, programming languages and libraries, some design patterns, algorithms, data structures or even names for some objects. If he doesn't think about it, he just selects the first option that came to his mind without considering alternatives and thus risks that he didn't make the best possible decision.

Next, the coder should design his solution. Designing is all about thinking before doing. If he skips this step, he may meet during his coding a situation when sees he came the wrong way and now he must refactor or even delete big part of his code and then just... rethink it :) I like the saying It's better to think twice before you start coding than to code twice before you start thinking. :)

The same applies to all changes made to an existing code. If somebody have to change something in a program, he'd better review the code carefully to discover and understand its architecture. If he just starts making changes to the code, he risks that he will break some hidden assumptions in some aspects of the code (like variable values, objects lifetime, order of function calls etc.) and thus create bugs.

The reason behind writing poor code may be rush. If a coder wants to code something as quick and simply as possible (or his boss tells him to do it this way), he will do ugly hacks and never refactor anything, even if some refactoring is necessary at this point. Of course this it to bad code and will backfire in the future, when the code will have to be changed and it will turn out to be totally unscalable. So we obviously see that such attitude is just the lack of thinking.

But this problem may also be something deeper. I can see that some coders just always write bad, unscalable code by their nature. I don't want to offend anyone, but I think maybe that's the crucial difference between junior and more experienced programmers. To work as a programmer, everyone needs to "speak fluently" his programming language to freely express his thoughts using it, but experienced programmers are also able to see a bigger picture - some invisible assumptions and more abstract concepts behind the code. They see words like "handle", "manager", "alignment", "serialization", "callback" and hundreds of other terms (anyone thought about creating coder's dictionary with words like these?) and just knows what hides behind them.

Three days after yarpen's entry there appeared a blog entry about code documentation on EntBlog. It describes two main types of documents - API documentation and technical articles. I fully agree with this text. I value documentation very much and I think that good documentation is another piece of this big puzzle.

They say that there are two types of people: these who make backups and these who will make it :) I think it's the same with writing good code and documentation. It's just the matter of thinking forward.

Comments (1) | Tags: software engineering philosophy | Author: Adam Sawicki | Share

May 2009

Humor komputerowy

Jest dużo stron z humorem i każda ma swój klimat - np. Joe Monster.org, funiaste.net czy Perełki.net.

Z takich typowo komputerowych najlepsze są chyba bash.org.pl (który zbiera cytaty z IRC) i przede wszystkim Roflcompter.pl (dowcipy informatyczne i matematyczne). Dawno się tak nie uśmiałem, jak czytając ten ostatni :) Humor komputerowy zbieramy też na Warsztacie w dziale Humor. Z innych perełek to gorąco polecam Choinki matematyczne. Ponieważ oryginalny link od pewnego czasu nie działa, pozwoliłem sobie zrobić MIRROR. W ogóle to najśmieszniejsze moim zdaniem obrazki (głównie humor komputerowy) zbieram w katalogu regedit.gamedev.pl/pub/Humor.

Żeby ta notka nie była bez ani jednego dowcipu, przytoczę dwa - niestety mające dużo wspólnego z całkiem poważną rzeczywistością.

Gdyby murarze budowali domy tak, jak programiści piszą programy, to jeden dzięcioł zniszczyłby całą cywilizację.

Dlaczego tak jest? Trafnej odpowiedzi udziela inny dowcip w temacie informatyczno-budowlanym:

Jak do kierownika budowy przyjdzie klient i, w momencie kiedy jest już położony dach, powie, że on by chciał jeszcze jedno piętro pod tym dachem, to kierownik popuka się w czoło. W analogicznej sytuacji kierownik zespołu programistycznego zapyta:
- A na kiedy?

Comments (0) | Tags: humor software engineering web | Author: Adam Sawicki | Share

Mar 2009

Fanatyzm obiektowy i mania wrapowania

Napisałem mały felieton, esej czy jak to się tam nazywa (polonista ze mnie kiepski :) Zwykle nie lubię narzekać, wolę pozytywnie podchodzić do życia. Nie lubię też wygłaszać swoich poglądów (bo "poglądy są jak d*** - każdy ma swoje, ale po co je pokazywać" ;) Jednak tym razem postanowiłem podzielić się swoimi przemyśleniami na temat programowania obiektowego. Tekst nosi tytuł Fanatyzm obiektowy. Właściwie to ten tekst umieściłem w dziale Download już dawno temu, ale dzisiaj dopisałem do niego nowy rozdział - "Mania wrapowania". Zapraszam do czytania i komentowania.

Comments (0) | Tags: software engineering philosophy c++ | Author: Adam Sawicki | Share

Pages: > 1 2 3 4 >

STAT NO AD [Stat] [Admin] [STAT NO AD] [pub] [Mirror] Copyright © 2004-2016 Adam Sawicki
Copyright © 2004-2016 Adam Sawicki