2010/04/21

NHibernate Forge


NHibernate Forge is "The official new home for the NHibernate community". Everyone who wants to start with NHibernate, probably tries to utilize this site. Recently I visited this site because I was looking for some information about NHibernate and decided to write my point of view about it:

1. Best section of site in my opinion, is its Wiki, but it still needs more Wikies like introduction of NHibernate related books and references.
2. From this site, it isn't obvious clear that if it is active enough to contribute or not. Specially when you consider that there is just one blog post in 2010's first quarter in its blog.
3. If someone wants to contribute in site's content and in NHibernate itself, where is a starting point or directions for him? I  found just a short direction in Welcome Message.
4. Deep Grok is forbidden for me, because I use an Iranian IP! It's absolutely  against open source spirit.
5. It seems that creating user in nhforge.org is not very easy because I signed up but I haven't received any email during last 18 hours.

At the end, I hope an active NHibernate Forge for all.




2010/04/20

Many things to learn

I'm always thinking that something may be wrong with my study and learn process. Being a .Net developer in companies in Iran that make enterprise web applications, I'm forced to study and learn so many various things:

1. Web technologies and tools: ASP.NET Webforms, ASP.NET MVC, ASP.NET AJAX, JavaScript, jQuery, CSS and HTML.
2. Application level technologies: C#, NHibernate, LINQ and ADO.NET.
3. Architecture/Design subjects: SOA, various design patterns, MVP, Domain Driven design and UML.
4. Community related subjects: blogging, forum and mailing list activities, contributing in open source projects.
5. Learning English.
6. Miscellaneous technologies: MS SQL Server, MySql, NUnit, Subversion, Git, Visual Studio and Mono.
7. ...

So the question is that: Is it correct to learn or study all of this technologies and subjects along with each other? Specially while I think a typical developer in US/Europe have learning/studying program for just a few of them. For example (s)he learn to be expert in data related technologies only just like ADO.NET, NHibernate and Entity Framework.

Being forced to learn and work with all above mentioned technologies and subjects has a very bad disadvantage: you have not enough time to be skilled in a few subset of them. Because when you are learning advanced subjects of a technology A, need to do some work in technology B arises and you need to cut studying technology A and do some studies in technology B in order to solve new problem. Consequently your knowledge of technology A remains facial. And this story goes on and goes on...




2010/04/14

Learning from Open Source

In all of my passed years in university and development teams, I was wondering if our style of software development is correct or not. I was comparing ourselves with those development teams in well-known companies and universities in industrial countries specially in United States (I live and work in Iran). There was no direct way to learn from or contact them.

The situation was continued till days that open source spread more widely and internet connections get more accessible in my area of study/work. While I was a Delphi developer and while in first years of C#/ASP.NET, the only open source projects I could find was Linux kernel and other similar projects. These projects was almost written in C and were very large to me to understand and compile.

Fortunately open source projects in C#/ASP.NET has after then increased rapidly and people like me find the chance to get familiar with them. This is exactly the time that I begun to learning software development lessons from famous .Net open source projects like NHibernate, log4net, NUnit, Cuyahoga and so many other ones.

After then I started to download, deploy, use, collaborate in community, build and understand them. By doing each activity I learned a new thing, One of the best learner projects I ever encountered is Cuyahoga. Cuyahoga is an open source CMS that is based on C#/ASP.NET MVC and NHibernate. It works fine with Mono and MySql too. By Cuyahoga I got introduced with Git, a decentralized SCM. Cuyahoga project itself uses some other nice open source .Net projects either internally like NHibernate or for its website and community. For example it uses YetAnotherForum.NET as its forum software, ScrewTurn Wiki for wiki, NAnt, NUnit and finally NHibernate.




نکاتی در باب مصاحبه

حتی اگر یک برنامه‌نویس تازه‌کار باشید، باز هم قاعدتاً با خیلی جاها قرار مصاحبه داشته و برای مصاحبه به خیلی جاها سر زده‌اید. درست است که مصاحبه فرایندی است که طی آن یک برنامه‌نویس از سمت شرکت مربوطه مورد ارزیابی قرار می‌گیرد. اما یک برنامه‌نویس هم می‌تواند از همین قرار مصاحبه برای سنجش شرکت مورد نظر استفاده کرده و در صورت لزوم دور آن شرکت را خط بکشد. بنده بر اساس تجاربی که بر اساس چندین و چند مصاحبه‌ای که در چند سال اخیر خصوصاً چند ماه گذشته داشته‌ام به نکاتی پی برده‌ام که علی‌الخصوص در مورد شرکت‌های خصوصی خیلی مصداق دارد:

۱- رعایت ساعت دقیق وقت مصاحبه توسط مصاحبه کننده: اگر شرکت نمی‌تواند در مورد زمان شروع مصاحبه منظم باشد پس در مورد خود مسائل کاری و پرداخت حقوق هم نمی‌توان توقع زیادی از آنها داشت.
۲- گم شدن یا دم دست نبودن رزومه‌ای که قبلاً برای آنها فرستاده بودید: باز هم نشانه بی‌نظمی شدید است.
۳- پرسیدن سوال از تمام زمینه‌های برنامه‌نویسی خصوصاً اگر عنوان شغلی مورد تقاضای شما صرفاً یک حیطه خاص مثل وب را پوشش دهد. در بعضی از مصاحبه‌ها هم از C#‎ سوال پرسیده می‌شود هم از ASP.NET، SQL/SQL Server، WPF، WCF و خیلی چیزهای دیگر. پرسیدن سوال از زمینه‌هایی چنین متنوع معنی‌اش این است که تیم توسعه آن شرکت چیز زیادی از توسعه نرم‌افزار نمی‌داند.
۴- پرسیدن سوالات مرسوم در گزینش‌های ادارات دولتی: مثل پرسیدن سوال از گرایشات سیاسی یا وضعیت مذهبی فرد مصاحبه شونده. پرسیدن این طور سوالات یعنی تمرکز آن شرکت صرفاً بر روی مهارت‌های برنامه‌نویسی شما نیست و معیارهای دیگری هم دارد. به همین خاطر در این طور شرکت‌ها سطح فنی معمولاً پایین بوده و معیار سنجش افراد به جای تسلط فنی آنها، نوع گرایش سیاسی یا مذهبی آنها خواهد بود.
۵- حضور خانم‌ها با ظاهر غیر معمول یا وجود آزادی غیر معمول در رفتار کارمندان شرکت. این موضوع هم نشانه بی‌نظمی است و هم مثل مورد قبلی نشانه عدم تمرکز شرکت مذکور در امور توسعه نرم‌افزار است. در این طور شرکت‌ها وقت افراد بیشتر به گپ زدن‌های غیر کاری می‌گذرد تا به امور کاری.
۶- تاکید بیش از حد بر معدل و نمرات دانشگاهی بدون توجه به مهارت‌ها و قابلیت‌های ملموس فرد مصاحبه شونده.




2010/04/13

Power up Visual Studio 2010 Express



Just one day ago Visual Studio 2010 RTM has been officially released in some priced editions and some free editions. Free editions are named Express editions and is provided as 4 separate editions: Visual Web Developer, Visual Basic, Visual C# and Visual C++.
Express editions have limitations. But this not means that you could not use them professionally. If you are going to use these Expression editions just as I'm going to do, I have 3 ways to power up Express editions:


1. Express editions does not allow any source code management add-on integration. For example you can not use AnkhSVN, and IDE integration for Subversion, with Express editions. As a work-around you can do your source code managements outside of Visual Studio using tools like TortoiseSVN or Git Bash.

2. Express editions has not support of MS Test projects. Don't worry, you can still do testing by use of open source NUnit instead. It has full functionality and can be performed outside of Visual Studio.

3. With one specific Express edition you can only create projects of that type and not other project types. For example with Visual C# Express you can create C# project libraries but you can not create ASP.NET website projects. To solve this problem you can just install 2 Visual Studio Express editions simultaneously. So with which one you can create/open your desired project type.




ویژوال استودیو ۲۰۱۰ ویرایش اکسپرس



دیروز نسخه نهایی Visual Studio 2010 منتشر شد. به همین مناسبت من تصمیم گرفته‌ام کاری را که همیشه می‌خواستم انجام بدهم را این بار عملی کنم. این بار می‌خواهم صرفاً از ویرایش‌های Express ویژوال استودیو که رایگان هم هستند استفاده کنم و تا آنجایی که دچار محدودیت‌های فنی خیلی جدی نشده‌ام به استفاده از آن ادامه دهم. برای این کار هم سه تا دلیل دارم:


۱- خسته شدم از بس که به خودم دروغ گفتم و خودم را مدام طوری توجیه کردم که به راحتی از نسخه‌های پولی کرک شده استفاده کنم. نسخه‌های پولی ویژوال استودیو هم مثل هر چیز پولی دیگری صاحب دارد و استفاده از مال دیگران بدون اجازه آنها بدون تعارف یک کار کاملاً غیر اخلاقی است.

۲- بیشتر ما برنامه‌نویس‌های ایرانی واقعاً نیازی به امکانات موجود در ویرایش‌های غیر اکسپرس مثل Ultimate نداریم و حتی به درستی نمی‌دانیم که مثلا همین ویرایش Ultimate چه چیزی اضافه‌تر بر ویرایش Express دارد. منتها چون پولی برای آن پرداخت نمی‌کنیم گران‌ترین ویرایش را انتخاب می‌کنیم.

۳- ویرایش‌های اکسپرس به خاطر آن که خیلی از امکانات نسخه‌های کامل‌تر را ندارند خیلی سریع‌تر از نسخه‌های کامل‌تر کار کرده، نصب راحت‌تری دارند و منابع کمتری را از سیستم مصرف می‌کنند.


البته ویرایش‌های Express آنقدر هم که به نظر می‌رسند ضعیف و بد نیستند و بیشتر افراد به خودی خود به جای استفاده از امکانات آنها از ابزارهای دیگری استفاده می‌کنند. خیلی از نقاط ضعف ویرایش‌های Express را می‌توان با کمک همین ابزارهای جایگزین یا تکنیک‌های دیگری برطرف کرد. به عنوان مثال جدول زیر بخشی از این ابزارهای جایگزین و تکنیک‌ها را معرفی می‌کند.

مشکل: بر روی ویرایش‌های اکسپرس نمی‌توان plug-inهای کنترل سورس مثل AnkhSVN یا TFS را نصب کرد
راه حل: اگر از Subversion یا Git به عنوان سورس کنترل استفاده می‌کنید، می‌توان با استفاده از ابزارهای مثل TortoiseSVN، svn command line یا Git bash کل کارهای commit، update و غیره را بیرون از ویژوال استودیو انجام داد.
مشکل: با ویرایش‌های اکسپرس نمی‌توان پروژه test ایجاد کرد یا از پروژه‌های test دیگران استفاده کرد.
راه حل: می‌توان از ابزار کد باز و رایگان NUnit استفاده کرد. با کمک این ابزار می‌توان بیرون از ویژوال استودیو هم به راحتی به انجام test پرداخت.
مشکل: با ویرایش‌های اکسپرس نمی‌توان solutionی را که هم دارای پروژه Class Library است و هم پروژه Web، ایجاد کرد.
راه حل: باید از دو تا از ویرایش‌های اکسپرس به طور همزمان استفاده کنید. یکی برای C#‎ و دیگری برای ASP.NET Website


بنده خودم اولین بار است که می‌خواهم دست به چنین تجربه‌ای بزنم و می‌دانم که عملی کردن این ایده چندان بی‌دردسر نخواهد بود. مطمئناً غیر از سه روش ذکر شده در جدول بالا نیاز به ابداع و به کارگیری روش‌های دیگری نیز خواهد بود. اما در مجموع امیدوارم به مشکل خیلی جدی برخورد نکنم تا شاید برای همیشه از شر ویژوال استودیوهای کرک و غیر قانونی رها شوم. شاید روزی هم توانستم یا پول ویندوزم را پرداخت کنم یا آن را با یک لینوکس رایگان جایگزین کنم.

پی‌نوشت ۱: معرفی ویرایش‌های مختلف ویژوال استودیو ۲۰۰۸
پی‌نوشت ۲: پیوند دریافت نسخه‌های اکسپرس Visual Studio 2010




2010/04/11

Good days with Subversion

Despite debate of these days which argue that Subversion's gold days has been gone and it must be replaced with a distributed SCM like Git, we recently get rid of SourceSafe and migrated to Subversion happily. Before continuing I must emphasis that we were not the only company that uses SourceSafe. There are yet many other companies in Iran that are using SourceSafe. Even there are many other companies and development teams that are not using any SCM at all.

In my opinion our delay of migrating to an up-to-date SCM just like Subversion, Git or TFS was lack of knowledge about new technologies and tools and fear of change. Fortunately in last 2 month I managed to convince my boss to replace SourceSafe with Subversion by showing him that Subversion could be integrated with Visual Studio too by utilizing AnkhSVN. He went happy with hooks that can send emails and with easy branching provided by Subversion. At last he was satisfied when realized that Subversion has a minimum hardware requirement in comparison with TFS. TFS was an old Subversion competitor in our company when we were planning to find a better replacement for SourceSafe.

It is second week that we turned SourceSafe into read-only mode, moved all needed sources to Subversion and updated all process to use Subversion. And fortunately this was a happy migration, nothing went bad, we got no trouble and our client machines and developers complained of nothing. Our style of utilizing Subversion included using 3 excellent tools: Slik Subversion 1.6.9, TortoiseSVN 1.6.7.18415 and AnkhSvn 2.1.7819.411.




2010/04/10

Installing Subversion

Congratulations to myself! Finally beat SourceSafe and installed Subversion instead of it. There was a long time that we thought it's the end of SourceSafe specially when using it offline but we needed confirmation of boss. Nowruz holidays was a good time for a thorough reading of Subversion. Just days after end of holidays, we migrated from SourceSafe to Subversion.
Installing Subversion was not as hard as I thought. In server I just installed slik subversion and followed a very concise guideline in CODING HORROR. After then each client installed TortoiseSVN and AnkhSVN and desired SourceSafe sources imported to Subversion. The only problem that we saw was an incompatibility between Subversion itself and its clients, AnkhSVN and TortoiseSVN. I was using latest version (at the time) of TortoiseSVN and AnkhSVN with an relative old version of Subversion. This caused AnkhSVN error message that was saying you should downgrade something. To get rid of this error I uninstalled everything, downloaded all latest versions (Slik Subversion 1.6.9, TortoiseSVN 1.6.7.18415 and AnkhSvn 2.1.7819.411) and installed them again.




2010/04/04

Joy of complete reading

Many times we need to learn new technologies. There is two major ways for reading a new technology's book. Firstly reading miscellaneous articles and papers about that technology and second way is reading a complete book about that thing.

In first approach you find short articles or blog posts about desired subject, read it and then try to find all other parts that you need to learn. In this way there is an opportunity to consume your time in an efficient way by not reading none interesting parts of subject. And there is a threat that says you won't create a complete picture about the subject in your mind. For example some times you will never realize if ever exists a special feature in a technology or just it is you that don't know anything about it.

In second approach you consume more time for reading (and practicing) whole book or manual. But instead you will understand anything about it. And you will enjoy of a complete reading. Notice that in this approach you still have the chance to by pass unrelated parts.

Recently I was forced to learn SVN, a well known source code management software. As described before I preferred to use second approach by complete reading svn book. This book covers all needed commands and have been partitioned into some chapters very nicely.