среда, 28 ноября 2012 г.

TODOs

TODOs
Our project is in the middle of development sprint, but has 3 //HACK comment, 16 //TODO's, 5 of them is //TODO: refactor this. Something goes wrong или все вообще зашибись©

четверг, 15 ноября 2012 г.

Simple, but genius things

Have you ever thought about spoon? How is it designed? Who's creator? Why does it have exactly that shape, not the other? Why european and japanese spoons are different?

All I want to say with that question is every simple thing is genius(and sometimes vice versa, but not always). Just think a little about it: you need something that would transport food from plate to your mouth. And it has a lot of features inside we never mention about:

  • it is universal, so we can use it for liquids and solid foods

  • it's safe

  • and it's really easy-to-use! Of course, you need some time to cope with, but since you handle it, it's getting normal to your life.

Another example. No, no, I don't mean iphone, everybody knows about it. Just an example from real life. I need to import my blog to my own site. Here's default solution:





If you didn't catch the idea, i'll show you:



That's it! I need to select my blog and press import! No more, no less! How could that be easier? Isn't that KISS principle?



Sometimes I think about things that could be better, easier to use. Today I went to bank and saw an awful bank terminal interface, almostly impossible to use. Tomorrow I'll take off underground and see ugly ads instead of simple but very effective beautiful posters. Month later I'll think about my app lifecycle and will find things that could be made much easier. And it should become my principle - do as simple, as you can.

среда, 24 октября 2012 г.

Your app status is In Review

"Your app status in review"(54 minutes ago)
I'm going to bed after reading new e-mail from Apple company with that subject. I hope it will pass review and tomorrow about 4000 users will get an update.

If everything goes ok, we'll have an update for lugat sozluk. Now it's called cep lugat and has redesigned icon(thanks a lot to our designer)!
What's new:

  • iPad support - some users will be really excited with this!
  • better detailed view - it's much better than previous one
  • automatic paste from copy/paste buffer - i heard this feature was implemented in Lingvo and is one of the most favourite users feature, so why not use that?
  • some bug fixes that will prevent from crash, slow working, etc...

What will be in next release?
  • more words - now it has just only osman words. I have some arabian-osman words, they will be added soon. And I would like to add turkish words to dictionary, but I can't find turkish-turkish offline dictionary. If someone has it(not a paper :) ), please tell me.
  • the most searched words - it's awesome thing when you try to memorize words.
  • [maybe] ANDROID version! I have just wrote some sketches and app seems to be working on android simulator, but i don't have any device to test, so it's delayed until I buy an android device.

пятница, 3 августа 2012 г.

Еще раз о дизайне

К сожалению, прописная истина:  Главная задача дизайна — удержать пользователя в те первые секунды, когда он про продукт(сайт, приложение, девайс) еще ничего не знает.


Никогда не забывайте об этом.

суббота, 30 июня 2012 г.

U do not need scrum

Well, I tried scrum. Honestly. It's a pretty good development method and very effective. If everything goes right, it may rapidly increase yr and teammates development speed. Everyone knows his tasks and may predict time to complete them. If something changes, there will be time to easily change direction of development and fix everything up.
Unfortunately, scrum has its own boundary of applications. In imaginary ideal world, where everything is predicted and anything u want to do u do from first attempt it is an ideal solution. But we live in other reality where above mean sea level may be positive and negative values, where sin or cosine values can be any value and there's no prohibition of taking square roots from negative numbers. And there's no place for creativity.

So, it's just words. Why do u need scrum? U need scrum:

  • when u have detailed, self-explanatory concept document
  • when u know exactly yr tasks
  • when u can estimate yr tasks
  • when u have an image of app in yr head  and may guess how it would work
  • when u need to quickly get results
  • when u need to see changelog of the app
But u do not scrum:
  • if there's no agreement with teammates about design and functionality
  • if u can not estimate yr tasks, because it's a creativity process depending on inspiration
  • and u can make over one task again and again
  • if u need to create something new, conceptional
Now I have six tasks on my board and can estimate three of them. Others are connected with design and may be overdone many times. So, if u ask me when I'm gonna finish my work and release next version, I won't give u any estimates or predictions. Even if I do, that will be not truth.

воскресенье, 24 июня 2012 г.

U do something wrong, man!

Sometimes I'm writing code and my inner voice tells me: "Stop! U do something wrong, man!" There are some signs of writing "code smell" I wanted to share with u. Of course, they aren't true in last  instance, but they are reasons to stop coding and think a little about what u're doing.

So, u do something wrong, man:

  • if u don't recognize ur code after two days u wrote.
  • if u have more than three level deep class inheritance
  • if ur unit-tests change the state(db, ini, etc...)
  • if ur unit-tests runs hours
  • if u have such class names as "AnotherClass, SuperSingleton, ButtonX", or variables like "a, b, buy_1, buy_2"
  • if u have 4-5 connected to each other singletons.
  • if yr task takes 4-5 days to complete.
  • if u have MVVMC instead of MVC
  • if u agree with everything with designer, yr investor and has no idea to change it.
I'm sure, to be continued...


When programmer needs to be designer

In any type of work or hobby inevitably comes such a moment, when u don't like to do. For example, I don't like drawing. I don't know anything about beauty, proportions, I hated every single minute holding brush in my hand in school. I'm negligent about clothes I'm wearing, I really do not care about beauty, about interfaces. It simplifies life.
Unfortunately, it had bad consequences. In past days every program I had written I used just myself. Now I'm writing code for others. And I know they don't care about how program works inside, what design patterns are used, how genius it is and what it really can do. They use program and if it doesn't satisfy their requirements, they will delete it or even write in review something like: "You're such a bastard, return my time, money, ex-wife back!". Their requirements are various, starting with program functionality, ending with design. 

Stop! Here's a big mistake. Firstly design and then functionality, not vice virsa! Program may be super-functional, but the first thing user sees is design. 
Are u knight of brush or not, u need to know how to design good-looking, user-friendly interfaces.
As a example, let me show some screenshots: both of them are ugly. The difference of them is in second line: in first pic, not all text are visible, but in second it's small. What of them is better and what changes can be made to make this screen attractive?




воскресенье, 17 июня 2012 г.

Dropbox & deleted files

Today I suddenly realised that I permanently deleted my project folder, hoping that it had been saved in remote repository. But it hadn't. That was epic fail.

I found program that scans deleted and formatted volumes. No results. Despair, absolutely no ideas.  I have been working on that project 3 months and now all files are gone.

But fortunately I stored it on Dropbox. Dropbox saved me. You may not know about it, dropbox can restore deleted files. Thank you, dropbox!

Two important lessons I've learnt:

  1. do not forget to make backups.
  2. do not be too self-confident, it won't give good results.


Now I'm working on Lugat Sozluk - osman turkish dictionary. If everything goes ok, new version will be available on next week.

English please!

For about three months I wanted to start writing all my posts in english, but couldn't find courage to do it.
From this day on I will write posts in english.

среда, 30 мая 2012 г.

Уязвимости на сайтах

Собрался поискать на одном сайте уязвимости. Пока искал, нашел проблемы(большинство из них XSS) у четырех левых сайтов, используя только гугл-фу.
Теперь боюсь вообще что-либо писать для web.

Вывод: если что-то может сломаться, оно обязательно сломается. Если что-то может пойти не так, это обязательно случится. Рассматривайте все детали.

воскресенье, 27 мая 2012 г.

Как завоевать мир?

Когда ты молод и смотришь телевизор, 
то думаешь, что телекомпании сговорились 
и хотят сделать людей тупыми. 
Но потом ты взрослеешь и 
приходит понимание — люди сами этого хотят. 
И это гораздо более пугающая мысль. 
Заговор — это не страшно, 
ты можешь пристрелить ублюдков, 
начать революцию. Но нет никакого заговора, 
телекомпании просто удовлетворяют спрос, 
к сожалению, это правда.
Стив  Джобс.

Наверное, каждому из нас в детстве хотелось стать космонавтом, Чак Норрисом или Капитаном Америкой. Ну или на крайняк иметь большую квартиру в центре Москвы, быть богатым, ну и так далее - это уже зависит от степени извращенности фантазии человека. Но взрослея, мы понимаем, что космос нам не светит, деньги нам уже не дают, что детские мечты почему-то не сбываются или вообще забыты. А почему так происходит?

На самом деле все просто - мы уже ничего сами не решаем. Мы привыкли делать то, что нам говорят вместо того, что нам нужно делать. Если мы не довольны, мы не пытаемся изменить ситуацию, мы недовольные подстраиваемся под нее.

- А почему выход из Ада не сторожат? 
- Здесь русские. Они сами друг друга не выпустят
Отрывок из анекдота

Простейший пример: человеку нужно делать стулья из материалов. Но у него неудобный рабочий инструмент. Работодатель недоумевает, почему у него такой маленький КПД. Но наш бравый человек молчит, выслушивает злобные ворчания, вместо того, чтобы получить нормальный инструмент и со скороcтью кролика создавать нужные ему айтемы из ничего. Он знает проблему - но не ищет пути выхода из нее.

Вернемся к нашему детству. Почему ребенок с завышенным ЧСВ считает, что у него все получится, что он станет тем, кто является для него примером и не видит преград в осуществлении своей мечты? Да потому что он верит, что ресурсы у него(ну и у родителей тоже) бесконечны, что у мамы есть бесконечное(в детстве эту величину еще можно было представить) количество денег на мороженое и единственная проблема - это договориться с людьми, которые тебя окружают, чтобы они тебя научили, объяснили, дали, подарили(вставить нужное слово). Так почему теперь мы начинаем оценивать себя приниженными, ставим себе глупые, а зачастую и материальные грани, и думаем, что наше счастье кто-то нам принесет? Надо счастья добиваться!

вторник, 27 марта 2012 г.

Два маленьких факта

Факт №1: с улыбающимися людьми легче разговаривать, идти на контакт.
Факт №2: выделенный текст бросается на глаза, следовательно, лучше запоминается

четверг, 9 февраля 2012 г.

Сначала думать, потом делать

Вчера я ужаснулся от кода, который я написал часом ранее. Не, если бы это была одна функция из сотни, которая не слишком часто вызывается, то я даже смотреть на это не смотрел. Но данный участок кода будет выполняться много раз на девайсе с ограниченными ресурсами(это я про мобильники).

среда, 8 февраля 2012 г.

работа со строками в objective c

Всем известно, что objective c является надмножеством старого доброго С.

Что это может значить для разработчика? Это значит, что язык взял свойства языка-предка, добавил туда свои фичи,  постарался исправить свои недочеты и вуаля! Новый мега-понтовый язык уже готов. Стойте, я сказал недочеты? Да, недочеты. Это, блин, все равно, что взять черную ладу, покрасить в белый свет, поставить туда значок мерседеса и надеяться, что он вдруг станет белым мерином.

Вот простейший пример: есть алфавит, преимущественно латинский, но с добавлением новых букв типа буквы ı (читается как русская ы). Есть правила преобразования, к примеру, предыдущая буква должна трансформироваться в старую добрую i. Дана строка, даны правила преобразования, нужно написать функцию, возвращающую преобразованную строку.

Казалось бы, что проще:

string ret = "";
for (int i = 0; i < str.length; ++i) {
  char ch = str[i];
//тут правила преобразования
  if (ch == 'ı') {
    ch = 'i';
  }
 ret += ch;
}

return ret;

ну... примерно так должна выглядеть функция на шарпах(почти символ в символ в джаве). Да, его нужно выписать в функцию, выписать правила преобразования в отдельную структуру данных, но дело не в этом.

Код вполне себе читабелен, не нужно писать поэму, чтобы объяснить компилятору, что ты хочешь сделать.


Строки в сях всегда таили в своих глубинах подводные камни, таким же образом они перекочевали в виде новых фич в objective c.
Перед тем, как я покажу код на языке яблочников, я объясню, в чем будет различие в плане реализации.

  1. Самое главное отличие - это юникодные char-ы. Если чары в джаве уже юникодные  и никаких проблем с сравниванием у нас нет, то в сях == мы уже не можем поставить. Хотя поставить-то поставим, только никакой гарантии, что будет работать, у нас нет.
  2. В objective С к NSMutableString можно добавлять только NSString! Чуваки, на дворе 21 век, почему я должен писать много кода, чтобы попросту работать со строками? Я как ленивый человек, стараюсь делать как можно телодвижений для достижения своей цели и никак не считаю это своим недостатком. Разве сложно предоставить хотя бы аналог stl-ных строк? Слава богу, хотя бы метод appendFormat оставили.
Ну соответсвено, сам код:

    NSMutableString* str = [[NSMutableString alloc] init];
    NSUInteger len = [word length];
    NSUInteger i;

    for (i = 0;i < len; ++i) {
        unichar ch = [word characterAtIndex:i];
          if (ch == 'i') // тут правила, я устал копипастить эту букву
           ch = 'i';
           [str appendFormat:@"%c", &ch];
        }

     return str;


Хотя согласен, переборщил с негативом. Код не так уж сильно и пахнет, надо только привыкнуть писать под него. Кто знает, как бороться с unicode char-ами?

вторник, 7 февраля 2012 г.

айфон или айпад

Очень часто(ну для меня ну очень часто) становится нужно определять, под айпад или айфон пишешь: заточить размеры гуи, контролы поменять и т.д. и т.п.

Сегодня натолкнулся на очень полезный дефайн:


#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

Скучаю по дефайнам и тайпдефам в джаве

А вообще, очень вредно писать код "для всего". Чем больше пишется кода, тем больше приходится делать хаков, чтобы это работало одинаково везде. Так что, compile once, run everywhere - всего лишь слоган астронавтов.