Languages in the 2nd Edition of Programming Entity Framework

I have a very difficult task ahead of me with the EF4 version of my book. The book is already over 800 pages and will only get longer with all of the new features in Entity Framework 4. However O’Reilly has tasked me to keep the book to 800 pages. Something has to give.

I am very proud of the fact that the first edition has every example in both Visual Basic and C# even though it greatly added to the length of the book.

This is where I’ve been asked to allocate the additional space. I must use only one language.

Although I have been a VB programmer for a long time, there is no hiding the fact that VB focused books are trailing in sales by orders of magnitude behind books with C# code. I wish it weren’t the case.

So it’s going to have to be the VB that gets cut and I’m going to have to hone my C# skills even further.

I am not happy. I wouldn't want to cut C# either. I truly want to continue providing samples in both languages. And I do not want to contribute to the questions about the future of VB.

With the first edition I provided code samples on-line for all of the big samples that are in the book – in both language. What I plan to do for the 2nd edition is include all of those query examples from Chapters 3 & 4 in my online examples. I probably won’t do entire console apps but provide them for use in LINQPad which anyone writing LINQ queries should be using anyway. There is even a free version – though you’ll probably quickly realize that shelling out $25 for intellisense-like support is well worth it.

I know this is not going to be satisfactory for oh so many VB coders but I’m between a rock and a hard place. Although I am relatively fluent in C# these days, I do remember how aggravating it was to have to try learn concepts that were presented using C# and always have to translate translate translate. It’s not fair. I hope that the extra effort I make to get the VB code out there will help.

#1 Peter Tate on 8.20.2009 at 4:31 PM

Why don't you make some examples in VB and some in C#?

I'm a C# developer and fan of your first book. If you have to make a choice I would prefer C#. I actually wouldn't mind seeing some of the examples in VB and honestly I would actually prefer this to duplicating the examples in both languages every time.

#2 Julie on 8.20.2009 at 4:36 PM

That's an interesting idea. I think the VB folks would be cool with it but have a feeling I'd get grief from many C# devs who are not as generous as you.:)

#3 Muhammad Mosa on 8.20.2009 at 4:48 PM

I am C# coder too. I don't mind reading code in VB.NET but sometimes it is annoying because of too detailed syntax.

However why not making the online/downloadable samples in both C# and VB.NET! Keeping the book with C# to save space. Maybe provide Appedixes with listing of VB.NET Code with references to their relative section in the book.

I guess Appendixes shouldn't be part of the 800 pages.

#4 Julie on 8.20.2009 at 4:55 PM

Hey Moses,

Having the code for download is my plan. I wrote that in the blog post but you are not the only one who missed that and suggested it. :) Maybe I'll go put that part in bold! :)

#5 Leo Moore on 8.21.2009 at 5:35 AM

I'm a big VB fan for many years but I'm pretty used to seeing all the samples in C#. However, good books provide the VB code in the download so if there is some C# which you don't understand you can always look up the VB code.

#6 Joacim Andersson on 8.21.2009 at 5:42 AM

I'm sorry to hear this Julie, I'm a big fan of your book since it's a *must have* for anyone learning the EF. While reading the blog post I was thinking the same thing as Peter above mentioned, why not mix the examples, some in C# and some in VB. I think that seeing some examples in C# and others in VB would help a developer (regardless of their language of choice) to do the translation. I don't think that that would hurt the sales, after all you are writing a .Net book on the Entity Framework, not a C# book on the Entity Framework.

#7 Sysnelli on 8.21.2009 at 7:26 AM

Julie! Your readers first !!! I know nothing of book edition world, but I'm wondering how the size of a technical book can be limited by an editor. If the subject needs 1000 pages to be covered then it's 1000 pages, period; unless a deal on readers frustration or dissatisfaction is taken into account in the contract.

This is a major subject for thousands of developpers; If no switch to another editor is conceivable, then keep both code outline (for download) although my personal view would be to keep C# inline and VB outline. 1000 apologies to VB users, I'm myself a 15 years VB6 user who switch to C#.

#8 Anil on 8.21.2009 at 8:47 AM

IMHO C# code is a little bit more readable/cleaner than VB code, and I think it will be easier for VB devs to follow it, than for C# devs to follow VB code.

This is just my personal opinion based on 10 years of programming in Delphi and the fact that I never liked to write "begin/end", "then" after "if", "do" after "while". Those things are distracting and move focus from what is important - logic. VB is even worse.

I don't want to start a language war here, but my personal opinion is that "text-intensive" languages are just a little bit less easy to "follow".

Again, I vote for C# inline and anything else as a download option.

#9 Ian B on 8.21.2009 at 9:04 AM

Julie,

I am a C# coder by preference, working in a VB environment. Since I am implementing EF in VB environment, I skip over the C# code while reading your book. I think a single language for press is fine. It is great that you are going to supply the VB version of the examples for download. Would the publisher allow two languages to exist in the digital version?

Ian

#10 Paul Sullivan on 8.21.2009 at 10:54 AM

C# in the text - C# & VB in download. That's what I'm seeing these days.

BTW - Your book for me is the DEFINITIVE source for EF. And go with the Rough Cuts again. A killer idea!

Paul

#11 Paul D. Sheriff on 8.21.2009 at 11:06 AM

Hi Julie,

How about where the code is essentially the same, just use C#. Where there are some significant syntax differences between C# and VB, then present both. Most syntax is the same, but sometimes those little differences are killers.

Paul

#12 Julie on 8.21.2009 at 11:12 AM

Hi Paul,

That is what I'm doing. Showing VB where the differences are big. E.g. select new {} vs Select New With {}.

I won't repeat it every time, but I will make a note of it for my fellow VB devs the first time one of those occurs.

Thanks for confirming that its a good approach!

Julie

#13 Stacy Vicknair on 8.21.2009 at 11:28 AM

You have to do what you have to do Julie. A book has to sell, and I think as long as you provide the VB code in an easily accessible way then whether it's in the book or not is a minor detail.

I would just say that you should stress the living daylights out of the fact that the examples in VB are available and where to get them in the book itself. In a way that is noticeable to the person who grabs a copy off the shelf to skin through.

Personally, I buy a book off of recommendation and content. If the book isn't in my preferred language, I get the added learning benefit of porting it myself. It's not additional work, it's additional learning and a deeper understanding.

#14 bobfox on 8.21.2009 at 11:43 AM

C# only in text - C# and VB in samples download.

#15 Sheri on 8.21.2009 at 11:44 AM

Hi Julie,

I'm a VB developer and a big fan of your first EF book. But, being a VB developer, it can be quite frustrating finding good resources out there for code samples as everything remotely-advanced these days seems oriented toward C# in print.

If there isn't space for both, I do like Paul's idea as well: show major syntax differences in the book and have both versions downloadable.

However, can both languages be in the eBook?

Sheri

#16 Dave on 8.21.2009 at 11:59 AM

You can't win, no matter which choice you make, trust me, I've been through this many, many times. Having each example in both C# and VB is distracting - it breaks the flow of the reader - as well as consuming space; a larger book means more potential errors as well as costing more. Pick one language and you alienate readers that prefer the other. Two books, many cry, but we've done that; it's expensive for both the publisher and the book store

Personally I think any .NET programmer should be fluent enough in both languages to be able to read technical books. Even beginners should push themselves to learn the very basics of the other language, just enough so that they can understand it; not only does it make reader books and articles easier, but also it makes you more marketable as a developer.

The multiple language issue in books raises the idea that ebooks could have a format that allows the langauge specific bits to be switched. It wouldn't be that hard to do.

#17 John Bubriski on 8.21.2009 at 12:08 PM

I would just go with C#. Yes, I'm a C# guy, but I truly believe its the wave of the future.

I think VB syntax is just wrong, and I don't think it translates that well to other languages, where as C# is close to Java, C++, and not even far from PHP.

#18 John Bubriski on 8.21.2009 at 12:09 PM

FYI, I own and enjoy your first book! Personally, I always wished it was a little smaller by removing the VB code >.<

#19 Scott Isaacs on 8.21.2009 at 12:22 PM

I'll echo what many others have said: have one language in the book and both available for download. I also agree with the comments you and others made about pointing out the significant differences the first time, or perhaps in an appendix.

#20 Tonci Jukic on 8.21.2009 at 12:35 PM

You should proceed with C# and just make VB available for download. The power of download :)

#21 Anthony on 8.21.2009 at 1:02 PM

Most serious developers are fluent in both languages, and those that aren't can at least read the other one enough to get by.

Like Dave said above, switching between the languages breaks the flow a bit.

I vote c# with both available for download.

#22 Bob Pulgino on 8.21.2009 at 1:47 PM

I wouldn't say that VB is dead, but I do think it's safe to say that any respectable .NET developer needs to ne able to read/think in C#. So do what you gotta do.

#23 Bill Hyde on 8.21.2009 at 10:34 PM

It's OK with me to go with c#. I used VB, but pretty much had to convert to c# because that was what the organization's going forward language choice was.

#24 Larry Parker on 8.22.2009 at 11:29 AM

My vote is for C# in the book, and C# / VB in the downloads. I personally don't like books with VB code. I did some VB coding about ten years ago, and after switching to C# I never looked back. Just my two cents.

#25 skip on 8.24.2009 at 1:40 AM

The book should be in vb. Put the c# in the download.

There are thousands of us that are considering changing from vb or vba language systems and for us vb.net is a lot lot simpler to grasp.

As per most of the posts here, a lot of people who are already skilled at .net use c#. Well guess who needs fewer additional hurdles when trying to learn something new like EF? The people that are already fluent in c# or the many of us that are not fluent in any .net language? Tech writers writing most examples in c# over vb.net make it doubly difficult for most of the people that are new to .net. It's a stupid convention that is being created.

Why anyone would want to write in a language that is encrusted with useless curly braces is beyond me. That's the antithesis of the clean approach taken by well planned languages like python. C# is just as bad as java, the language it was cloned from.

#26 Marcel on 8.24.2009 at 3:08 AM

What would be convenient is some kind of a "Quick Access Code" (QAC) next to the C# code. With that QAC, I could go to the book's website, enter the QAC and directly see the VB.NET code for the sample.

Personally, I do not like navigating whole sample applications when reading a book.

#27 Shail on 8.25.2009 at 4:30 AM

No matter its VB or C#, write the concepts in English very clearly. As what you have done in first edition. :)

First was a very good book, hope second will be a great one.

#28 William Booth on 8.25.2009 at 7:51 PM

Well, not that it matters a whit, but I bought the first one and will not buy the second one. The only way I can vote is with my wallet. As long as there is VB someone will satisfy the niche market.

#29 Julie on 8.25.2009 at 7:57 PM

@William

Are you not buying 2nd edition because of the lack of VB or because you think it will be redundant or ummm, "other"...?

Just curious, not judging.

#30 William Booth on 8.27.2009 at 6:53 PM

The VB Julie. Just my preference, I certainly respect your knowledge and learned a lot from your first book. However, if I am trying to learn a new technology and the code is in C# most of it is straightforward but then I will run across something like anonymous methods and I will try to convert that to VB and lose my concentration.

Still a fan Bill.

#31 Babak on 8.31.2009 at 7:22 AM

Hello Julia!

I am a C# fan and want to start learning the entity framework. Should I wait for your new book? or buy the recent one?

Thanks

Babak

#32 Julie on 8.31.2009 at 8:55 AM

Hi Babak

The current edition has all of its samples in both C# and VB. Most of the main concepts remain the same. YOu won't waste your time learning EF with the v1 book, and the v2 book will help you transition. I am highlighting differences in the v2 book. That book will not be out until early 2010 with roughcuts available in the late fall. You might also want to check my blog posts tagged EF4 (thedatafarm.com/blog/tags/ef4).

Hope this helps you make a decision.

Julie

Leave a Comment