azinformatika


(This post is partly a response for the Webisztan post for iPad owners)

So, yes, I bought an iPad recently.

Why?

For some reasons, I cannot bring too much pack with me, and I had a half-vacation trip to Amsterdam. Four days, which means, you shouldn’t really bring your laptop with you (nearly 3 kilograms, how I regret that I switched to 15 cols, I don’t need the large display…), yet it’s definitely good to bring some computing power.

I looked at the Androids, and after holding an Android phone for 2 hours in my hand, I decided that this platform is underperforming for me.

I knew that webOSes are also slow, an I would have to wait for them until christmas shopping season at least anyway.

Average netbooks? I used one with linux (moblin, perhaps?), and brought one with me to Paris with windows (thanks again, Balazs), they’re awfully slow, and the reason we brought it with us - namely: calling parents on skypeout - didn’t work: you could skype-skype, but somehow, no skypeout on Atom…

So, why are they slow? Answer is: they have traditional multitasking.

So, this left me with the Apple option. I’m a mac user since 5 and a half years, and it took me just some googling to get an iPad a few days before the trip (they weren’t introduced then in the Netherlands). For the technically curious, it’s a 64-3G, just to make sure I don’t regret buying a smaller one - although 32GB would be also fine.

The thing is, I bought it for work, which it half-failed.

Especially in Amsterdam, when I had to create a homepage, and I couldn’t switch easily between the SSH terminal (vim - editor… ) and the safari browser. I planned to use VNC, but somehow, unusually my home computer was frozen (thanks for Kelt for checking that it wasn’t stolen), so I had to rely on the machine.

But guy, what an immersive platform it is!

The difference between a device with such form factor and a full-blown computer is simple: a computer is a computer; an iPad becomes the thing you’re running on it.

If you use it as a notetaker, it becomes your notepad. If you use it as a piano, it becomes a piano (although it’s easy to miss the keys). If you use it as a drawing board, it becomes your drawing board.

And it’s that easy. The window is the iPad.

Now, let’s get back on why on Earth people need multitasking?

Because they need to switch between things!

In fact, I don’t find it that hard: I can easily switch between mail, safari, and BeejiveIM (an MSN/Gtalk client), press the button, click. The reason of this is that every application stores its last state on flash, and opening it just reloads (we call this serialization, or using the name from the 90s: permanent computing).

So when you close an application, it doesn’t ask for saving the document you’re working on. The next time you open it, it will stay the same, so it will feel just like multitasking.

So, ‘perceived’ multitasking works, and things are blazingly fast - since the computer does only the one thing it became.

There are two things which cannot be handled this way.

The first obvious thing is an alarm clock: you cannot have a good alarm clock on iPad in the background. Also, you can’t play music, especially not youtube music videos in the background, not that it would be feasible for an ARM processor I believe, since streaming video needs the most power from such devices.

The second thing is about network connections (sockets) - although few things need it (my only example is SSH) it makes your life really hard if you can’t keep them.

Maybe it would be good if chats could be open like in GMail, but we’ll have to see how this works on the ChromeOS tablets, and it’s easy to see the limits of such an interface.

So, the iPad is a suitable device for on-the-go. I know it’s a bit heavy, but still I bring it with me to a lot of places. It’s more convenient to use than a phone, and you can solve a lot of things with it.

The most used apps so far:

  • Safari, of course (check timetables, or anything on-the-go)
  • BeejiveIM (talk with your friends in unusual places and situations)
  • iBooks (yes, you can read books on it - it has a brightness setting. Also, it eats .epub and PDFs)
  • OmniGraffle (it’s really immersive to draw on a drawing board, instead of a computer)
  • Virtuoso (a piano app - it’s much more fun creating music than to listening on it)

Disatvantages

First, the sound quality of iPad is below my expectations, so I still prefer to listen to music on computer, but for those who can’t hear the difference between the different qualities of bitrates, it could be fine.

Second, the Mobile Safari programming is harder then expected: For example, there’s no focus() function, so you can’t lead the user through a form easily; or there’s no contentEditable, which basically kills any WYSIWYG HTML-Editor support.

Also, the built-in apps are rather primitive: I’d laugh my ass off at anybody saying that iPad mail is full-featured; at least it could load pictures of people from the addressbook… Or maybe could I type bold text? (BTW, rich text editing is basically missing on the whole platform - except for the Pages app)

Oh, and you can’t attach a photo to a mail, but you can mail a photo. Cute, isn’t it?:)

Even the calendar app is strange: you cannot add new events by clicking (tapping) on their place: you have to press the plus button in the corner, set the date and time from a dropdown, and save it.

So, it does feel like I’m holding a prototype now; but hey, I haven’t seem too much prototypes this fast and usable.

Let’s see what the new OS brings. I hope they won’t ruin the speed of the device.

I have told this multiple times, maybe it’s worth a blogpost on its own. It’s mainly a reaction to recent posts of Dave West from InfoQ, and the discussions formed beneath them. Although I can feel it through what makes someone to think this way, yet I have different opinions which I would like to tell.

I have been hearing a lot of times about wether what programmers do is engineering, is science, art, or what. When I was about 18, even I had some thoughts that building software is not about engineering, but now, perhaps just because I became a master of software engineering officially (ok, it’s called engineer-informatitian in hungarian), I do think it is.

Why does the question arise? Because our daily job - at least, for a lot of us - is not based on science, but rather is about some chaotic finding-your-way thing. It rarely involves drawings and science - not gut - based calculations if you don’t explicitly insist on them, especially not in the enterprise world.

Some say 60 years ought to be enough for an engineering discipline to form, and therefore this isn’t one; I think it otherwise. I think it will take us a lot more time to find out what this thing is, even if we reached this far, and even if our profession has roots in the ancient Egyptian civilization (have you ever thought of that the basis of Egyptian tax administration is a series of calculatiosn based on water sensors and other aggregated data?).

Let’s start with two questions: what is engineering? What is software engineering?

Let me answer the first question with a personal point of view, and a second with an official one.

(more…)

Ez a poszt angolul van most, bocsi. Igaziból egy kommentem egy InfoQ-s cikkel kapcsolatban, de önmagában is megállja a helyét, így gondoltam, kirakom

Recently, a whole module of a legacy web application written in PHP4 around 10 years ago (and constantly “maintained” since) was needed to have new features.

We’re talking about 1000s of lines of code within one function, or even case of a switch case.

Most of the time, people don’t refactor maintained legacy applications, as somebody told me “the first rule of support development is: don’t change anything other than requested, just add your stuff.”

I haven’t been able to track the application back to its beginnings but its imminent to me that if-else branches don’t grow to 600 lines by themselves, without human intervention. Somebody has to mess these up, and someone has to have such kind of thinking. This is pretty general in enterprise programmng:

  • most of the tasks are about legacy applications
  • people fear to clean things up
  • it’s not about development, but adding requested features and fixing bugs.

Also, PHP is a dynamic language, and therefore formal refactoring tools are usually unavailable. For example, PHP refactoring support in netbeans is basically non-existing.

So, what would you do here?

I decided that a system’s answer is dependent only from its input and its context. This seems pretty straightforward:


System ( input, context ) -> output

OK, what is the input of a web application? Of course, its HTTP request! In PHP, it’s hard to think about any other input.

What’s the context? Context is given by two components basically: the underlying platform, whatever it is (no matter you have a framework or just common libraries, we call these platform together), and the persistent data layer. So:


Web app (request, persistent data) -> answer

(I know, I forgot platform to add, but in refactoring scenarios, platform should stay the same anyway. In case you change platforms too, there are other complications which we won’t talk about this time.)

What’s the answer? First, it’s an HTML (or XML, JSON, etc) output. We didn’t have to care about it in this particular case. The other output is: changes to the persistence layer. It’s unusual for web applications to change anything other than their database and cache layers.So:


Web app(request, persistent data) -> (written-out response, persistent data' )

OK, what to do? We have an old system and we want to refactor it to a new system, and the question was: are they equal in functionality?

Question is: Web app == Web app' ?

Let’s see what I did:

  • Ask a manual tester to go through every possible combination on the user interface
  • Recorded these into files (serialize($_REQUEST)), or, even better, (serialize($GLOBALS))
  • Ask the DB layer to NOT write anything to the DB (ugly global variable hack, if it is present, only select queries are executed), this way, we ensure that we keep a consistet state
  • Record every writing operation (so, instead of executing them, take note of them)
  • An algorhythm:
    1. load the serialized request,
    2. start recording db,
    3. run the original controller,
    4. collect db recordings,
    5. re-load request (in case it was modified by the original controller - we could never know)
    6. run the new controller
    7. collect db recordings
    8. see if the two are equal

This way, I could be sure, that in all of the scenarios a manual tester could come up with, both of the controllers behave the same way.

After the original recordings, I did a few additional points:

  1. re-load the request again
  2. enable db writing
  3. run the new controller
  4. display result.

This way I could create an - albeit slower - but seemingly normally functioning version of the software, which did everything it did previously, and it was verified that functionality haven’t changed with the new controller.

I called this blackbox-harness test.

What do you think?

Kértétek, itt van. Alapvetően itt a modultervezésről lesz szó, a komplett rendszerek tervezése egyrészről picit más tészta, másrészt ebből a szempontból meglepően sokszor van megkötve a kezünk. Érdemes elolvasni a cikket is, de a kapcsolódó két esettanulmány a legértékesebb talán.

Ha a specifikáció megvan, hányszor adjuk oda tetszőleges, az implementációs környezetet valamelyest ismerő kollegának azt, már implementált (és titokban: tesztelt) terméket várva vissza cserébe? Mi sem természetesebb ennél, nem igaz? Az alkotói szabadság, a modulok amúgyis függetlenek, a srác amúgyis megbántódna, ha beleszólnának a dolgába… ugye?

Hát egy lúf.szt.

Alapvetően a kód azon részei, amit senki nem menedzsel (nem látja senki a készítőjén kívül), fekete dobozok. A fekete doboz pedig nem elhanyagolható valószinűséggel lehet rossz, hibás. Azt, hogy megvalósítja-e egyáltalán a specifkációt, csak akkor tudjuk, ha ténylegesen leteszteltük (amit általában szintén a programozóra bízunk..). A specifikáció gyakorlatilag mindig interfészspecifikáció: azt mondja meg, adott interfésze(ke)n keresztül milyennek tűnjön a program. Lehet ez UI, lehet ez adatbázis, de lehet épp másik programrész.

A tervezés elsődleges feladata, hogy részekre válassza a megoldandó feladatot, a részek közti összefüggéseket (interfészeket) pedig rögzítse. Tehát eme fázis nem más, mint részekre bontás, és részspecifikálás.

(more…)

Ez már majdnem kód… bocsi, kitaláltam valamit, kell a gondolatmenet felépítéséhez ennek az ismerete… Meg aztán remélem, haszonnal forgatjátok, megismerkedtek egy olyan eszközzel, amiről eddig sokszor csak előítéleteket hallottatok…

A modellek sokszor folyamatokat írnak le, nem struktúrákat (Beiratkozás az egyetemen, forrás: Agilemodeling.com)

Az előző postban elejtettem, hogy “a diagramjaim rendszerint rövidtávra készülnek”. Ez egy nagyon fontos mondat, szeretnék rajt elidőzni.

A modellezésről a legtöbb embernek a Model-Driven Development jut eszébe, ami egy szép elméleti elképzelés, a gyakorlatban viszont nehéz kivitelezni, bár vannak működő rendszerek, főleg bankoknál.

Pedig a modellezés fontos része a programozásnak, enélkül nem lehet átlátni a szoftvereket, nemhogy minőségi programot írni.

(more…)

Az informatikának az elmélete és gyakorlata néha élesen kettéválik egymástól. Két tábor van: az egyik tábor - ők vannak kevesebben - megpróbál az elméleti principiumok mentén létrehozni egy akadémiai alapokra épülő szakmát, ahol a dolgok folyamata valamiféle profi rend szerint történik.

A másik tábor - ők vannak többen - az egyetemi tudás jó részét hasztalannak tartja, a saját életére nem érzi alkalmasnak.

Az Architect dolgok nem titkolt célja, hogy bemutassa az utóbbi tábor tagjainak, hogy igenis, érvényesek az ő életükre is ezek a szabályok. Az pedig, hogy nem így csinálják, hiányosság, ad absurdum legtöbbször hiba.

Ezt általában rendkívül gyakorlati - mindennapi munkámból vett - példák hétköznapi, az akadémiai életben kevésbé népszerű - php, javascript - nyelvekkel való megoldásán keresztül mutatom be.

A mai post ennél picit elméletibb. Én szeretném, ha ez egy kis vitát generálna köztetek, köztünk, így, író-olvasó között, már úgy értve, hogy a blogpostot mégiscsak én írtam, a kommenteket, visszajelzéseket meg majd reméljük, mások.

A Software Crisis arról szól, hogy a projektek 60%-a nem készül el időre vagy költségkeretre. Ez egy folyamatosan létező probléma, nem csupán a korai informatikára igaz, mai napig velünk van.

Amiről a software crisis nem szól, hogy azok a szoftverek, amik a végén így-vagy-úgy elkészülnek, mennyire teszik elégedetté az ügyfelet. Nem árulok zsákbamacskát, a legtöbb esetben semennyire.

Lehet ezért az ügyfelet okolni, hisz nem tudja mit akar, mindig változtat úgyis… De az építészetben ugyanez a helyzet, mégse omlanak össze az épületek, és alapvetően lakható helyeket készítenek jobb - akár magyar - építészeink.

Lehet ezért a beosztott programozóinkat okolni, de hisz legtöbben főiskolát, egyetemet végeztek, de legalábbis elkezdték: az építészetben a végrehajtók sokkal kevesebb képzettséggel rendelkeznek; mégis, a házak állnak, még a középszerű mérnökök által tervezett, vezetett projektek végén is.

Szerintem a hiba bennünk van: senior programozókban, vezetőkben, projektmenedzserekben, architektekben, bennünk, akiknek hozzáértésünket, akadémiai ismereteinket, szakolvasmányainkat kéne hozzárakni tapasztalataink mellett a projektekhez.

(more…)

A mai post kicsit alapszintűbb, műegyetemi infoképzést őszintén végighallgatók sok újat nem fognak benne találni. Az apropója egy új, fiatal kolléga a csapatban, aki teljesen új modult fog kapni, és arról beszélgettünk, ehhez hogy kell nekilátni - szerintem.

A kezdő informatikus - vagy a nem kezdő, ugyanakkor más szemléletű vagy épp autodidakta - ha kap egy feladatot, mivel kezdi?

Az adatstruktúrák felállításával.

You’re doing it wrong. *

(* Legalábbis szerintem, a legtöbb esetben)

Egy programnál sohasem az a kérdés, hogy milyen elemek vannak, ez részletkérdés. Ami a fontosabb: mit kell csinálnia annak a szegény programnak?

Erről ad információt az (egyesek kedvéért huszonötször átnevezett, elrejtett, átsematizált) use case modellezés.

(more…)

(Kettő és feledik rész, linkajánló)

A tapasztalatom az, hogy a magyar programozók, ritka ám tiszteletreméltó kivételektől eltekintve, nem szeretik, nem is értik a javascriptet. A legtöbbje backend ember, jobban megbízik a statikus nyelvekben. Szíve joga.

Egy magyar srácot hallani beszélni arról, hogy hogy használják a javascriptet szerveroldali nyelvként, mennyivel biztonságosabb és skálázhatóbb(!) a javascript kód a javahoz képest, mennyivel egyszerűbb javascriptes embereket szerezni egyszerre meglepő és felemelő érzés.

A java számomra egyértelműen túl van értékelve. Persze nem azért szidom, mint mások, de ettől még nem mindig jó megoldás ott, ahol használják, és komoly problémák vannak vele nyelvi szinten is.

Hallgassátok hát Szegedi Attila előadását a Javascript üzenet-orientált banki rendszerükről az InfoQ-n.

A piramisokat négyezer éve építették.

Az elsők szétrepedtek, jónéhányan összedöltek.

Aztán néhány sikerült.

Majd mások megint nem.

De előbb-utóbb megtanultuk, mit kell tenni ahhoz, hogy megállják a helyüket.

Aztán a végére már elméletünk is volt mögötte.

A szép az, amikor már rutinból nem dőlnek be az épületeid, és azt is tudod, miért nem.

(Egy infomérnök vallomásai: régi draft az adamnemeth.hu -n)

Mostanában a munkámban egyre többet foglalkozom nagyléptékű tervezéssel ismét. Ennek minden szempontból örülök: beosztott kódernek sajnos soha nem voltam jó, és most se vagyok az, kényelmetlenül érzem magam benne, mint holmi szűk kabátban.

Az Architect dolgok ebbe kíván kis betekintést nyújtani. Szigorúan leendő és jelenlegi programozóknak.

I. rész: Logika és Struktúra, avagy Algoritmusok + Adatstruktúrák = Programok [1]

(more…)

Az iWiW új dizánja kapcsán került elő egy ismerősöm, az alábbi beszélgetés zajlott köztünk (rövidítve):

1:07:33 AM XY: kapcsolatban allsz az iwiw fejlesztokkel?
1:07:43 AM XY: kerlek add at nekik a kovetkezo kis uzenetet:
1:07:44 AM Aadaam: mondjuk
1:08:13 AM XY: “Kedves fejlesztok! Kerlek nezzetek meg a Facebook keresodobozat, utana masoljatok le vagy akasszatok fel magatokat. Koszonettel: XY”

(Természetesen nem ezt a módját választottam az információátadásnak, a postban nem erről lesz szó, sok egészséget, boldogságot minden általam ismert iWiW-közeli embernek - van belőlük pár)

Az illető történetesen informatikushallgató.

Némi csúnya visszaszólás után (azóta remélem, már kevésbé haragszik) összekötöttem Benjaminnal, és hozzávágtam a megfelelő technológiát: “Tessék, csináld meg!”

Hogy miért tettem és igazam volt-e (szerintem igen, különben nem tettem volna, a kommentsáv használata meg ismert :) , arról szól a post.

(more…)

Next Page »