Mibbit vs. Freenode. Drama queens in action.

I am no longer allowed to connect to freenode using mibbit, my favorite irc client because of “security reasons”.

This actually pisses me off. A LOT.

Freenode claims that mibbit is unsecure and that the lack of cummunication between the  mibbit team and  the freenode team about those issues have led to banning all mibbit users.

I use mibbit because it’s comfortable to connect from anywhere to my favorite channels on freenode (which is the only server I use most of the time).

I use mibbit just because I don’t really like any other IRC client and don’t want to download one.

They replaced mibbit with their own lame client. That sounds like politics to me.

It’s amazing that an open-sourced group that allegedly represents freedom does something that really opposes their nature.

For more info read here.

</rant>

Leave a Comment

Metrics FreeMind map

As I promised here is the FreeMind metrics map.

Rating architectural efficiencyI’d love to hear comments and more suggestions.

Leave a Comment

Namespace and encapsulation

Have you ever found the need to hide data inside a namespace in C++.

That isn’t possible since scope attributes are not valid inside namespaces.

Here is an example of how this should have been done in my opinion:
namespace foo
{
private:
int baz;
public:
class bar;
}

This of course provides an error since such thing doesn’t exist in C++.

There are many ways to solve this problem.

1) Using the class keyword instead of the namespace keyword:
class foo
{
private:
int baz;
public:
class bar;
}

While it works it is unclear that class foo is actually a namespace.

Also a class can’t be declared on multiple files so it doesn’t really solve our problem.

Using an unnamed namespace is better in this case.

2) Creating a private namespace:
namespace foo
{
namespace PrivateData
{
int baz;
}
class bar;
}

While this is clearer it still provides access to the private namespace. The boost library uses this approach. They call their private namesapces details

3) There is a third way. One can use a static class where all of the fields are protected and inherit that class.



namespace foo
{
class PrivateData
{
public:
PrivateData &operator=() = delete;
PrivateData() = delete;
protected:
static int baz;
};
class foo : public PrivateData
{
public:
foo(int value)
{
baz += value * 5 + 2;
}
};
int PrivateData::baz = 0;
}

This is a bit clearer and it also hides the data inside a class. Any class that doesn’t inherit from PrivateData won’t have access to the private data of the namespace. Logically no one outside of the class will inherit from it. This is possible but the trick is that it creates external coupling. Inheritence is the thightest coupling possible after freindship. This is costly.
Inside the namespace we create internal coupling but internal coupling is no coupling at all since we already know the namespace. External coupling creates depeandecies.
But this code seems to me too verbose and redundant.
I don’t really think that I’d use this method.

I’d like to hear more suggestions :)

Comments (13)

Program metrics and architectural analysis

While randomaly browsing goolge I stumbled upon this project:

The Two-Tier Programming Toolkit is a software design and re-engineering (or round-trip engineering) tool which supports forward and reverse engineering of object-oriented programs. The current prototype supports authoring visual specifications (‘modelling’), verifying these specifications against Java 1.4 programs, and the visualization of native (plain source code) of Java 1.4 programs (read more). Also available is a video demonstration of the TTP Toolkit.

I found the idea interesting so I sent a mail to the project leader to check if and how can I contribute.

After a short discussion we decided that I’ll start working on  a system that analyze the design and it’s efficiency.

The purpose of my research is to empirically or statistically measure the design’s efficiency according to the goals of the designer.

The problem is that every design has different goals according to the problem.

If the designer makes a fundamental mistake concerning the goals of the design then TTPT will lead him to the wrong design. The question is how do we lead the designer into the right place while checking back if other goals are more appropriate.

As explained by Artem Barger on stackoverflow.com the rating’s calculation can be basically calculated as the following:

I don’t think you can find an ultimate formula for computing design efficiency, since it’s very subjective. But you can adopt some statistic techniques, define the metrics which really important for you in the design. Afterward define for each metric its weight. Now find different use cases and check how does your design fit them in each metric and give them a grade. After all this you can normalize and compute the value with V= Sum(W_i*G_i)/Sum(W_i), where W_i is weight and G_i is a grade. This way you can specify whatever is important for you in the design and calculate accordingly.

Each metric’s weight will be ranked by the user by importance but the toolkit should detect as the design progresses if the grades meet the goals of the system.

I haven’t found all the metrics to be considered yet but there are the ones I thought about:

  • Coupling
  • Design Patterns use
  • Language idioms use.
  • Scalability.
  • High-viability.
  • Code Reuse.
  • Flexibility.
  • Robustness to errors.
  • Testability.
  • Design implications on resource use and memory.
  • Portability.
  • Usage of the correct programming paradigm.
  • Design implications on run-time efficiency.
  • Encapsulation.

What else do you have in mind?

I’ll provide a FreeMind graph that describes the metrics.

Have a nice day, everyone :)

Leave a Comment

Follow

Get every new post delivered to your Inbox.