Serge's Technology View

Talk about Technologies, Software Architecture and Management

Archive for the ‘Delphi’ Category

Is going Linux means replacing I with We?

There we go again… Marketing wars… Is being Linux means replacing I with We?

Accordingly to a new addition to the Mac-v-PC adv. war – Linux – “WE are Linux” – yes.

Personalization in the look at the computers promoted for last few years by Apple, Microsoft, and then followed by Dell and others with “personalize your computer” campaigns now suggested to be replaced with big “communitification“  a-la Linux.

What is a freedom? Ability to be you through the lens of the Big Brothers or ability to be you as part of the Open (Source) World of WE?

Is it a freedom when someone tells you that “you are free to be me”? Does Linux community need to go into war with others, even if it is just advertisements, to prove itself?

I did not like it when Apple said “you are the sad PC and I am the coolest Mac”…

   There you go…
 
Oh, a wrong one, but funny…  

Microsoft had managed not to mention Apple…

then   or now
 

What now? Now we have a new addition – a Linux’s freedom – The big “O”

Did it worth it? What is in it for Linux?

IBM to buy SUN – end of the era?

Updated on 04/07/2009

Talk rumored in 1998 and surfaced once again in 2002 will continue - IBM was in final talks to acquire Sun… It was suspected that some news would be announced by Monday 04/06/2009

http://www.betanews.com/article/IBMs-acquisition-of-Sun-Down-to-the-details/1238698365
http://www.nytimes.com/2009/04/03/technology/business-computing/03blue.html

and they did – it fell apart… offer has been rejected

http://www.bloomberg.com/apps/news?pid=20601103&sid=aijKk7Ur2M0c&refer=news

Will we see negotiation saga continued or would be there another bidder? Or…

In rumors of Sun’s CEO could be replaced, so memorable statement was issued: “As a policy Sun does not comment on rumors or speculation. What we can say is that Sun is committed to its leadership team, growth strategy and building value for its shareholders”. Yahoo anyone?

It is not doom and gloom for Sun, but it all went against market expectations… and what is in there for IBM really?

  • Cannot overrun a competitor, buy it
  • No more patent wars over Java -> IBM JDK to consume final parts of Sun JDK
  • Java push via existing customer base
  • Solaris to replace AIX? Is there market left for Solaris? IBM will keep the goodies and Solaris to go away?
  • NetBeans or Eclipse? Rational or Sun Studio? -> Eclipse+Rational with NetBeans flavor?
  • + IBM JavaFX
  • + IBM X86 virtualization

All good and nice, but remember the Lotus story? Died silently… what would follow? Java? mySQL? New Google DB engine to emerge built by ex Sun employees? Another era of mainframe computers with Java only present on enterprise level?

I am not pro-Java person, but this is the milestone not to miss!

For Trader Joe’s fans

As a long time customer of Trader Joe’s I just love this :)

When I moved from CA, this was first thing we started to look for and unfortunately had to travel two hours to Chicago until TJ opened local store. Talking about loyalty :)

Only if visited TJ on the constant basis for a few years you may get an irony of some verses, but, otherwise, it is very good informal commercial and consider informal style of the TJ, they should use it officially.

Two thumbs up. Enjoy

Wow! Well, what do you expect from the guy who made this

or these.

Assert is your friend… not an end-user’s

As a long time Delphi and C# programmer one become used to some features of the language and may not go deep into “philosophical” thinking about such features. This often happen with Asserts

What is Assert or Assertion?

By its definition Assert:

  • state categorically
  • affirm: to declare or affirm solemnly and formally as true
  • insist: assert to be true
  • In Computing (wiki): “an assert is a predicate (i.e., a true–false statement) placed in a program to indicate that the developer thinks that the predicate is always true at that place”

In general, using assert in the code proven to be useful in many situations because it “checks for a condition and outputs the call stack if the condition is false” and it could help to debug some strange situations in the code.

Assert is your friend

This method is for programmers to use. But what happen often when something is convenient, it started to be used excessively. Why it is happening?

Let’s look at the declaration of Assert in C# (3.x). There are two versions of the Assert(): Debug.Assert() and Trace.Assert(), both in System.Diagnostics namespace.

// Checks for a condition and outputs the call stack
// if the condition is false

[ConditionalAttribute("TRACE")]
public static void Assert(bool condition)

[ConditionalAttribute("TRACE")]
public static void Assert(bool condition, string message)

[ConditionalAttribute("DEBUG")]
public static void Assert(bool condition)

[ConditionalAttribute("DEBUG")]
public static void Assert(bool condition, string message)

As we can see from above code, Assert is to be used for Testing and Debugging and therefore should not be used as a way to present any information to the end-user.

Helping yourself

As useful as it seems, even then Assert infrastructure may not be used to full extend. In the sample declarations above we can see that logic can be invoked with and without providing any additional information.
Imagine how useful is a message “Project raised an Assert in line X” compare to “Project raised an Assert with the Message in line X”.
First option gives you idea where something failed, where second actually tells you what went wrongand where. Let’s use power of the tool-set and provide ourselves with useful information.

Assert is NOT for an end-user

I was asked recently (this seems to be a ongoing discussion) – “Why a programmer should not be using asserts as a regular approach in code conditions validation even when it comes to a production code?”

By default, Assert would show a message box with some information and the current Call Stack. This information, while being helpful to the developer, would not tell much to the user.

With custom TraceListener introduced, message can be hidden from the user and information could be stored, but it is not how it should be used by definition.

If information is expected to be presented to the user in any form, it could be achieved in a form not an exceptional, intended for debugging, situation, but by using regular methods: message box, application log, Windows event log, etc.
Even in the case of component development it is desired to use exceptions (raise/throw) to “bubble” proper message to the error handling layer.

The throw statement is used to signal the occurrence of an anomalous situation (exception) during the program execution.

Assert is a conditional logic

Last, final and probably major concern here is that in Release environment Debug and even Trace functionality would be disabled and therefore, any code/logic which depend on Assert() would be suppressed and all the nice validations became worthless (see declaration above)… and Access Violation errors starting pop up unexpectedly.

Valid XHTML 1.0 Transitional  Valid CSS!