PDA

View Full Version : Learning .Net


ADM
06-04-2008, 11:08 PM
Ok here's the deal.. I've just had a full time job offer doing web development at the place I currently work part time at. It'll start when I finish uni at the end of the year and it's guaranteed but the only problem is I need to learn .net.

They know I don't know .net yet but they said it's easy to pick up on and they can even teach me but I'd like to pick it up anyway before hand.

I've got advanced experience in PHP and MySQL and in the past I've picked up most programming languages quite quickly since the structuring is very similar.. is that the same with .Net?

Any books you guys can recommend to learn it? Also recommending some sites would be great as well :)

I think they mentioned I need to know ASP.net so hope that helps to target my focus a bit. Also would it be beneficial to learn C# instead and target my focus there? I know that a lot of it is just C# but not too sure which takes after which and so on.

EDIT: Also it's all web based development work so I would need to focus more on that sort of stuff.

Spooger
06-04-2008, 11:32 PM
Hmm, well, when I need to quickly learn something new for work I check the W3Schools (http://www.w3schools.com/default.asp) website. It's more of a reference than tutorial, but it always seems to help :)

I've never used ASP.net so, unfortunately, I can't really recommend any books on it :\ I imagine if you're well versed in PHP you're not going to find anything that'll trip you up too bad, though.

rsmedts
06-05-2008, 04:43 AM
I've been developing in .Net for about 4 years now, before that I was mostly an asp/php guy.
I'm afraid .Net is radically different from what you're used in php. A good knowledge of C++ or Java would be more helpful to get you started on asp.net than php or asp.

The language C# itself you don't need to worry about; it's easy enough to pick up, and similar to languages like java (very much so), and php (but less function-centric). If I were you I'd try to learn as much as possible about object-oriented programming, have a look through the System.Web namespace, and try to build a couple of aspx pages with basic data-binding (download the Visual Web Developer Express from http://www.microsoft.com/express/).

You can write procedural (php like) code in asp.net if you like, but try to completely move to object oriented programming right away, because bad programming will come back and bite you in the behind.

Good luck

ADM
06-05-2008, 08:40 AM
Thanks for that rsmedts. I found out a bit more about the job requirements and they want someone who knows C# and they program with C# with asp.net.

Basically they use Visual Studio 2005 and do everything in C# with asp.net. So as I gather it ASP.Net has a couple of ways of coding.. C# and vb. Is that right? So if I focus on learning C# I should be ok? They use SQL Server as well but I've had experience with MySQL and database design methodology like that so I'm not too worried about that area.

Spooger
06-05-2008, 09:02 AM
If I were you I'd try to learn as much as possible about object-oriented programming, have a look through the System.Web namespace, and try to build a couple of aspx pages with basic data-binding (download the Visual Web Developer Express from http://www.microsoft.com/express/).


PHP's had OOP support for a while now, though I imagine most people still program procedurally with it.

ADM
06-05-2008, 09:05 AM
I've done a bit of OOP with PHP, one of the forums I work with quite a bit is all OOP in PHP: http://getvanilla.com/

I've also done OOP in Actionscript 2.0 funnily enough :p haha.

rsmedts
06-05-2008, 09:34 AM
ADM,

Yes, just use C#, and don't worry about VB.Net. Not that the difference between the two languages is that important, as you'd be using the same set of objects anyway. Functionally they are virtually identical.
Sql Server shouldn't give you too much trouble.

Also: Actionscript 2.0 has some weird prototype/subclassing mix going on that has always driven me to madness. I would be excited for SilverLight just for that. In fact; that is just about the only reason I'm excited about it

peoplessi
06-05-2008, 09:37 AM
http://www.wrox.com/WileyCDA/Section/id-105058.html

I guess you could look up ASP.NET books at your uni's library. Get a good preview what you could possibly purchase. Wrox Blox seems to have very extensive array of ASP.NET books, and they have good authors too, but I have no personal experience of their ASP.NET books. But widevariety, with alot of specific focuses too.

ADM
06-05-2008, 09:56 AM
Thanks guys.

The problem I've found with a lot of those books is that they only cover the beginners aspects of it. The book I looked at today on ASP.NET had one of it's advanced tutorials getting you to make a stupid submit form on a web page. I looked over the code and it was too simple, even I could understand it.

I need to find a book that covers all areas and even goes into more advanced areas like data handling with SQL server and so on.

Nexus_sa
06-05-2008, 10:30 PM
I've been coding in .net since it was 1.0 beta (now up to 3.5). I manage a team of developers (and code myself) providing production code for .NET 2.0. Honestly, if you can do Java you shouldn't find the change a big deal at all. The biggest difference between the two is the libraries (and mostly the IDE) - I find the switching back and forth relatively easy.

Now, when it comes to rapidly building a UI, I think you'll like the ASP.NET model - pages are event driven and code behind (in C#, or whatever .net language you like). Since the web is your primary interest, check out the AJAX control kit and library http://www.asp.net/ajax/ajaxcontroltoolkit/samples/ for some samples of what they offer client side only (generated javascript).

When it comes to databinding, datasets for a native .net environment are quick and easy and will help you get a relational subset of information in memory. The objects natively support change tracking, queries, etc. That said, if you're exposing any functionality via a web service that's intended to be cross platform, you'll want to stay away from .net specific technologies (like datasets).

Anyway, I'm rambling. Short version: Make sure you can code/understand OO programming in C# or Java. Don't make asp.net pages the old asp way (mixed pages) and stick with the code-behind approach for your UI.

Oh, and your thoughts on the DB are correct. You shouldn't have any problems switching from MYSQL. Normally people have a bit of a problem switching TO Oracle because they don't support temp tables (at least they didn't last I heard) and have a different syntax (slightly PLSQL). Architecturally you'll approach them the same.

Peace,
Ian

Nexus_sa
06-06-2008, 09:51 PM
Oh, I almost forgot. Check out the WROX publications http://www.amazon.com/Professional-C-2008-Wrox-Guides/dp/0470191376/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1212807030&sr=8-1 They'll cover the broad spectrum and give you a good leg up.

Ian

Crosma
06-08-2008, 02:14 AM
Check out the MSDN examples, also included with the SDK documentation (not included with Visual Studio, but can easily be downloaded from Microsoft's website). Pretty much any single thing you may want to do will be covered.

Basically, ASP.NET is state driven, so a populated page retains its data on form posts (unlike almost any other system). All ASP name-space tags can be populated in the code and hold state. So, if you've got a form/list/anything you populate it if the page is not being posted back to (check the IsPostback variable) and then you attach buttons to event functions. In many ways its much the same structure as writing a .NET application.

The benefit of the state system is that you do not need to read from the database anywhere near as often. For SQL Server interaction, a pool of database connections is maintained after the first successful connection attempt, so making a connection is actually just telling .NET is use an existing free connection. Similar to MySQL's pconnect, except the database won't have too many connections, because the system will wait for a free one in the pool before proceeding and any changes to the SQL session are flushed when the script runtime detaches.

Personally, I think the whole Master pages paradigm is a lot more clumsy than using templates, but it does keep the code very clean and its certainly quicker than using PHP to achieve the same results.

Another flaw is that the state system uses up a lot of memory. It is assumed that a post-back may be made, so a large list of data will stay in memory per user, just in-case it is needed later. SQL Server itself is a real memory hog and not a particularly fast performer (the connection handshake takes ages, making the connection pool a necessity, and I find that inserts and updates are generally a lot slower than MySQL).

Like Nexus_sa says, your ASPX files should not house your code unless you really have to (sometimes it's just cleaner to modify your display based on the data in the ASPX file, but not often). For one, ASPX files are always compiled at runtime and for two, you're missing the point if you code that way.

By and large, VB.NET and C#.NET are identical, just with different syntax. They are not different platforms.

Back onto SQL Server, it's really bad at web stuff, not supporting enums (you can achieve the same results, but not simply) and not supporting limits (emulating a limit with MSSQL is hideous). You can use MySQL with .NET, which I recommend for all of the previous reasons and because SQL Server is really expensive.

ADM
06-08-2008, 06:24 AM
Thanks guys for that.. helps a lot.

Crosma: That's a pretty good overview of it all. It's an interesting approach to have that much data being collected and as such I really can't see it being that good for web based applications. Luckily the uses we have for it at the place I work won't have hundreds of people using it at the same time, since it's only primarily for the intranet and not the internet I'm pretty sure it wouldn't really be as big of a problem.

If it was up to me I'd prefer to not use .Net for web applications and to continue sticking to PHP and/or possibly picking up Python as I've heard that's a really powerful language to learn.

Anyway I'll make sure I pick up some books and check out the MSDN examples and I'm sure I shouldn't have a problem getting used to it.

Thanks again guys!

Crosma
06-08-2008, 06:51 AM
Crosma: That's a pretty good overview of it all. It's an interesting approach to have that much data being collected and as such I really can't see it being that good for web based applications.You can do the same thing manually in PHP by storing each set of query results (and any pre-filled-in form data) in the session with a unique key, then only retrieving new data from the database if the unique key is not in the post string.

Truth be told, Microsoft's stuff is smart when it comes to memory. SQL Server caches a lot of results, but only if there's plenty of memory to burn. Similarly, ASP.NET will throw away old state data as soon as resources are looking a bit thin. If the state is no longer present, the post-back is treated like it's not one and all events are ignored.