14 Replies - 6443 Views - Last Post: 03 August 2011 - 10:30 AM

#1 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Are cookbooks good for learning?

Posted 30 July 2011 - 08:02 AM

I'm currently using Visual C# 2010 Step by Step to learn C# and this is my main focus but occasionally I would like to make my own small applications to gain some experience. As I am new to programming I can't usually get good ideas for programs I am currently capable of writing.

Are cookbooks good to use along side general programming books? Obviously any code I used I would study and understand as copy and pasting would defeat the object of learning!

Is This A Good Question/Topic? 0
  • +

Replies To: Are cookbooks good for learning?

#2 karabasf  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 202
  • View blog
  • Posts: 417
  • Joined: 29-August 10

Re: Are cookbooks good for learning?

Posted 30 July 2011 - 09:12 AM

I think it really depends how you learn and what's the most efficient way to learn. For me, I started in JAVA with lectures, slowly moved to C# (by using Visual C# 2008 Step by Step) and in the end I got proficient in both languages.

Most important thing to learn first are the basics and then the more advanced concepts. As I would say, just start off with your current book and grab the basics like loops, OOP and so on (I found the book quite decent, although I knew a lot from my JAVA course) and then start moving to your own projects. Although, if I remember it correctly, Visual C# step by step have quite a lot of examples and you could always extend these to your own use.

Of course, I wouldn't stop you from making your own thought programs, look at the project idea list and ask questions if you need answers. Or just think things of your own.
While I was programming in C# (or learned programming in C#) back then, I thought up of many own projects, like: "Guess the number", "Number converter (from decimal to binary and vice versa) and so on. In the end, I managed to make a project which calculates the balanced field length of an aircraft, while it was writing its generated data to an Excel sheet. The most important thing is that you start easy (you can't just program a game, while you just learned C#) and gradually moving to more advanced projects.

Personally I'd say if you feel comfortable with using cookbooks, use them. Most important thing is to discipline yourself and not peeking at the solutions before you wrote something. (but to be honest, I never used cookbooks, so I am not sure in their build up)

Hope this helps you out ^^
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,843
  • Joined: 02-June 10

Re: Are cookbooks good for learning?

Posted 30 July 2011 - 10:59 AM

You'll notice in my collection of C# learning resources that I recommend cookbooks as good learning resources. Not just because they can give you a chunk of code, but because they are often written by professionals with real-world experience. They have already stumbled on the same pot-holes that lay in front of you and can give advice on how to avoid them.

With that said, I would still caution you about trying to beyond a program from scratch before you are ready. It is a common trap that new coders fall in to. By their 3rd week they want to build a home automation system as a learning project, or something equally grand. This simple fact is that when you are new you have no idea of just how much you don't yet know. It may not be as much fun, but take the time to work through at least 1 self-teaching book from cover to cover, before you try to design your own projects.


Standard resources, references and suggestions for new programmers. - Updated July 2011

Don't try to create a useful working program to fit a need of yours (or a for-pay contract) as your introduction to coding project. When you are learning to code you don't know enough to code a program, let alone know how to engineer the architecture of a program. It would be like saying "I don't know how to read sheet music, or play an instrument. I think I'll write a 3 act opera as my first learning experience."

The problem with taking on large, complex tasks when you are new to coding is that
  • It will frustrate you to the point of quitting. We don't want you to quit. We want you to succeed and learning how to code and engineer software.
  • You don't know enough about coding to know where to start or in what direction to design your program
  • You risk learning via the 'Swiss cheese' method where you only learn certain bits and pieces for the one project but have huge holes in your education.


Finding answers to specific problems:
Sometimes just knowing where to look can make all the difference. Google is your friend.
Search with either "C#" or "MSDN" as the first word: "MSDN Picturebox", "C# Custom Events", "MSDN timer" etc.
How to do a good search that will get you targeted answers.

Don't think you are the first person to ask a question. Try a search on this site to see if someone has already brought up this problem. Also, as soon as you post your question go to the bottom of the updated page: You will see where the system has already analyzed your question and tried to find similar threads for the same question, so check those links out.

But honestly, just typing away and seeing what pops up in Intellisense is going to make your self-education take 20 years. You can learn by trying to reverse engineer the language through banging on the keyboard experimentation - or you can learn by doing the tutorials and following a good "How to learn C#" book. There are so many great "How do I build my first application" tutorials on the web... There are dozens of "Learn C# in 21 days", "My first C# program" type books at your local book seller or even public library.

Beginner:
Build a Program Now! in Visual C# by Microsoft Press, ISBN 0-7356-2542-5
is a terrific book that has you build a Windows Forms application, a WPF app, a database application, your own web browser.

Visual Studio Keyboard Shortcuts


D.I.C. C# Resource page Start here
Intro to C# online tutorial then here...
C# control structures then here.
MSDN Beginner Developer video series
MSDN video on OOP principals, making classes, constructors, accessors and method overloading
MSDN Top guideline violations, know what to avoid before you do it.
Design patterns as diagrams

I hate sending people to another site when we have such good tutorials here, but this series shouldn't be overlooked.
Programming OOP in C# - Part 1
Programming OOP in C# - Part 2
Programming OOP in C# - Part 3
Programming OOP in C# - Part 4
Programming OOP in C# - Part 5

Writing a text file is always one of the first things people want to do, in order to store data like high-scores, preferences and so on
Writing a text file tutorial.
Reading a text file tutorial.

Have you seen the 500+ MSDN Code Samples? They spent a lot of time creating samples and demos. It seems a shame to not use them.

Intermediate:
The tutorials below walk through making an application including inheritance, custom events and custom controls, object serialization and more.
Bulding an application - Part 1
Building an application - Part 2
Quick and easy custom events
Separating data from GUI - PLUS - serializing the data to XML
Passing values between forms/classes

Working with environmental variables
'Why do we use delegates?' thread

And everyone always wants to connect to a database, right out of the gate so
Database tutorials right here on DIC

C# Cookbooks
Are a great place to get good code, broken down by need, written by coding professionals. You can use the code as-is, but take the time to actually study it. These professionals write in a certain style for a reason developed by years of experience and heartache.

Everyone:
Debugging tutorial
Debugging tips
Debugging in detail
Great debugging tips
It still doesn't work, article

Microsoft Visual Studio Tips, 251 ways to improve your productivity, Microsoft press, ISBN 0-7356-2640-5
Has many, many great, real-world tips that I use all the time.

These are just good every-day references to put in your bookmarks.
MSDN C# Developers Center with tutorials
Welcome to Visual Studio
Free editions of Visual Studio 2010

Let me also throw in a couple tips:
  • You have to program as if everything breaks, nothing works, the cyberworld is not perfect, the attached hardware is flakey, the network is slow and unreliable, the harddrive is about to fail, every method will return an error and every user will do their best to break your software. Confirm everything. Range check every value. Make no assumptions or presumptions.

  • Take the extra 3 seconds to rename your controls each time you drag them onto a form. The default names of button1, button2... button54 aren't very helpful. If you rename them right away to something like btnOk, btnCancel, btnSend etc. it helps tremendously when you make the methods for them because they are named after the button by the designer.
    btnSend_Click(object sender, eventargs e) is a lot easier to maintain than button1_click(object sender, eventargs e)

  • You aren't paying for variable names by the byte. So instead of variables names of a, b, c go ahead and use meaningful names like Index, TimeOut, Row, Column and so on. You should avoid 'T' for the timer. Amongst other things 'T' is commonly used throughout C# for Type and this will lead to problems. There are naming guidelines you should follow so your code confirms to industry standards. It makes life much easier on everyone around you, including those of us here to help. If you start using the standards from the beginning you don't have to retrain yourself later.

  • Learn how to search the 'net for examples.
    How to do a good search that will get you targeted answers.

  • Try to avoid having work actually take place in GUI control event handlers. It is usually better to have the GUI handler call other methods so those methods can be reused and make the code more readible.
    btnSave(object sender, eventargs e)
    {
        SavePreferences();
    }
    
    SaveMenuItem(object sender, eventargs e)
    {
        SavePreferences();
    }
    
    SaveContextMenu(object sender, eventargs e)
    {
        SavePreferences();
    }
    
    FormMain_Closing(object sender, eventargs e)
    {
        if (IsDirty) SavePreferences();
    }
    


  • This can't be stressed enough in today's world of cell phone messaging:
    Don't use txt/sms/leet/T9 speak like: u no, u r, dnt, wut i m do-n, coz, al gud, b4, ny1, and so on. like this guy:

    dis not b d'hood dawg... You are sitting at a real keyboard with a real monitor, not a cell phone. You are not here texting your high school posse to come to your kegger after their shift at Taco Bell. You are here asking for help from senior coding professionals who graciously donate their valuable time to helping the next generation of coders with their chosen craft. Please try to show them, yourself and the industry some respect by writing at least at an eighth grade level. (IE: English not ebonics or SMS, real words, punctuation and so on). If you can't take your own problem/question seriously enough to write like an adult, then why would you expect anyone else to take it seriously?

  • I strongly suggest installing VMware or some other virtualization technology on your development PC so you can create a couple virtual computers for testing. This would allow you to debug and test inside: WinXP32, XP64, Vista, Win7x32, Win7x64... etc. without having to actually have 5 physical PC's. Visual Studio will let you send the debug directly into one of these virtual machines so you can watch it operate, check its variables, see the crashes and so on just as if it were debugging on your real machine.

Was This Post Helpful? 2
  • +
  • -

#4 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Re: Are cookbooks good for learning?

Posted 30 July 2011 - 11:43 AM

Thanks for the in depth reply tlhIn`toq, I'll continue working through my C# book cover to cover then think about my own small programs (and study some cookbooks!)

If you don't mind me asking, in your current job do you often work with new or junior developers?

I just checked out pankajgoyal06's thread, wow.
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,843
  • Joined: 02-June 10

Re: Are cookbooks good for learning?

Posted 30 July 2011 - 05:31 PM

View Postinsanepenguin, on 30 July 2011 - 12:43 PM, said:

If you don't mind me asking, in your current job do you often work with new or junior developers?


Yes and no. I often have to work with developers from other companies in order to integrate our system with theirs. For example, their Point of Sale or their Ticketing System, with our photography system. Most of the jr. coders are shocked when we tell them we don't use a database. That there is no need for it. They just can't wrap their heads around the idea of a program that doesn't use a database because its all they have been taught. They aren't software engineers so much as database query generators.

Be we don't hire recent graduates and as a rule avoid university educated - for ANY position in our company - as much as possible unless university was in their far past and they have since had several years of employment to "grow them up" and get them out of all the bad habits and thinking from school.

We just aren't big enough to be able to take on the role of maturing people into adulthood. That's what the military is for. Or someone as big as Google or Xerox, who can afford 24 months of salary with no return, to take a lump of clay and mold them into a product producing employee. When we hire someone we expect them to be able to start working. Not just being employed: With a 'deer in the headlights' gaze for the first couple years.

I'm not saying that all university students are like that. Its just that with no real-world experience to look at to sift them out, there is no way to tell if 'this' student with a 3.5gpa is any better than 'that' student with a 3.5gpa. One might be the second coming, one might be a total waste of carbon. How do you tell which is which? And it is just an aweful lot of work to break through the aire of superiority most graduate have. Somehow they tend to think that everything they learned in school is right (LOL) and that they are the answers to every corporations woes - they are going to take the industry by storm and change the way everything is done. They all think they are going to be brilliant and form the next Facebook or Google and retire at 25 years old. Who has the energy to break through all that and make them realize they are destined to be code-monkeys for the first 10 years just to get into the industry and be taken seriously?
Was This Post Helpful? 2
  • +
  • -

#6 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 03:25 AM

I like the realism in your post :D

No chance of me retiring at 25 I'll be 29 when I graduate!

With that in mind next summer (I'd of finished year two of my degree) should I go looking for placements?

I feel by then I'll have another year of C# under my belt, I've done a module in Java year one but it's all intro stuff.

A lot of the younger students don't seem to put much effort in and I get the feeling they think a degree is their key to the big money and life is all roses after that (ha!).

I don't care what they'd want me to do, fixing typos, testing etc.
Code monkeying for years doesn't bother me either I just want my foot in the door so to speak and to do some real learning after I graduate
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,843
  • Joined: 02-June 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 06:37 AM

View Postinsanepenguin, on 31 July 2011 - 04:25 AM, said:

With that in mind next summer (I'd of finished year two of my degree) should I go looking for placements?


Is there another choice other than looking for a job? Welfare... Rich parents... Yeah, you should probably go looking for a job. Either that or join the military. With the college under your belt you could pick up 4 years of real world experience that civilian employers respect.


View Postinsanepenguin, on 31 July 2011 - 04:25 AM, said:

I don't care what they'd want me to do, fixing typos, testing etc.
Code monkeying for years doesn't bother me either I just want my foot in the door so to speak and to do some real learning after I graduate

Sounds like you already have a better attitude about work than your classmates. Just find a way to work that into the job interviews so the prospective employers realize it.
Was This Post Helpful? 1
  • +
  • -

#8 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 06:52 AM

I checked out your site earlier, amazed at the shot of Saturn you got with no telescope! :tup:
Was This Post Helpful? 0
  • +
  • -

#9 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,843
  • Joined: 02-June 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 07:08 AM

View Postinsanepenguin, on 31 July 2011 - 07:52 AM, said:

I checked out your site earlier, amazed at the shot of Saturn you got with no telescope! :tup:


I just got back from 7 weeks in Arizona, where I got an even better one. Although Saturn was further away, I was 3700 feet higher in altitude in a very dry climate. The earlier shot was in Galveston TX where I had to shoot through 3/5ths of a mile of hot humid air.

I have a few other photos from this trip that I still need to process and post on my site.


Attached Image
Was This Post Helpful? 0
  • +
  • -

#10 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 08:32 AM

That must be some camera you have, I saw a program on TV here in the UK where someone had posted their picture of Saturn via a camera attached to a telescope and it was pretty much the same as the one you posted above.
Was This Post Helpful? 0
  • +
  • -

#11 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,843
  • Joined: 02-June 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 11:11 AM

Camera is a Canon 7D - 18mp
Lens is a Sigma 50-500mm super-telephoto with a doubler making it 100-1000mm

What I don't like is that I can't do a long exposure (more than 2-3 seconds) because that causes motion blur as both the Earth and the other celestial bodies are in constant motion.

I'd like to pick up a small motorized telescope like
http://www.telescope...ortelescope.cfm
just for the motorized tracking system. I'd put a mount for my lens on it in place of it's crude telescope. That way it moves with the star/planet and I could do longer exposures.
Was This Post Helpful? 0
  • +
  • -

#12 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 11:46 AM

Sounds cool, so the telescope moves with the object you are tracking (a planet)allowing longer exposure ?

Is photography a hobby or part of the day job too?
Was This Post Helpful? 0
  • +
  • -

#13 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,843
  • Joined: 02-June 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 12:44 PM

View Postinsanepenguin, on 31 July 2011 - 12:46 PM, said:

Sounds cool, so the telescope moves with the object you are tracking (a planet)allowing longer exposure ?

Yes.


View Postinsanepenguin, on 31 July 2011 - 12:46 PM, said:

Is photography a hobby or part of the day job too?

Yes.

This post has been edited by tlhIn`toq: 31 July 2011 - 12:45 PM

Was This Post Helpful? 0
  • +
  • -

#14 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Re: Are cookbooks good for learning?

Posted 31 July 2011 - 01:04 PM

Nice. :D
Was This Post Helpful? 0
  • +
  • -

#15 insanepenguin  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 238
  • Joined: 08-July 10

Re: Are cookbooks good for learning?

Posted 03 August 2011 - 10:30 AM

Just had a good look at MSDN, loads of tutorials on there great stuff
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1