14 Replies - 1298 Views - Last Post: 29 July 2015 - 02:23 AM Rate Topic: -----

#1 AlexR8   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 27-July 15

Beginner in C#

Posted 27 July 2015 - 09:02 AM

Hi everyone, I'm new in this environment, I want to ask you where can I learn C# in best way, maybe give me some books or links. I already know a little, how to use classes & other things. My teacher said C# is good for games industry, but is it true? If so, what should I learn first? If not, what language is the best for games?

Here is a little code I made :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class Timp
{
    public void ArataTimpul()
    {
        Console.WriteLine("\tTip : {0} \n", Tipul); 
            switch (ZiuaDinSaptamana)
            { case "Monday":
                    if (Luna == 1)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Ianuarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 2)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Februarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 3)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Martie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 4)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Aprilie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 5)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Mai) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 6)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Iunie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 7)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Iulie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 8)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(August) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 9)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Septembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 10)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Octombrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 11)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Noiembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 12)
                        Console.WriteLine("Ziua : {0}(Luni) \t Luna : {1}(Decembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    break;
                case "Tuesday":
                    if (Luna == 1)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Ianuarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 2)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Februarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 3)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Martie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 4)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Aprilie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 5)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Mai) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 6)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Iunie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 7)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Iulie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 8)
                        Console.WriteLine("Ziua : {0}Marti) \t Luna : {1}(August) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 9)
                        Console.WriteLine("Ziua : {0}Marti) \t Luna : {1}(Septembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 10)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Octombrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 11)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Noiembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 12)
                        Console.WriteLine("Ziua : {0}(Marti) \t Luna : {1}(Decembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    break;
                case "Wednesday":
                    if (Luna == 1)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Ianuarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 2)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Februarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 3)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Martie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 4)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Aprilie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 5)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Mai) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 6)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Iunie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 7)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Iulie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 8)
                        Console.WriteLine("Ziua : {0}Miercuri) \t Luna : {1}(August) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 9)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Septembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 10)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Octombrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 11)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Noiembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 12)
                        Console.WriteLine("Ziua : {0}(Miercuri) \t Luna : {1}(Decembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    break;
                case "Thursday":
                    if (Luna == 1)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Ianuarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 2)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Februarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 3)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Martie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 4)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Aprilie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 5)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Mai) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 6)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Iunie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 7)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Iulie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 8)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(August) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 9)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Septembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 10)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Octombrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 11)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Noiembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 12)
                        Console.WriteLine("Ziua : {0}(Joi) \t Luna : {1}(Decembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    break;
                case "Friday":
                    if (Luna == 1)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Ianuarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 2)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Februarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 3)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Martie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 4)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Aprilie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 5)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Mai) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 6)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Iunie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 7)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Iulie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 8)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(August) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 9)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Septembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 10)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Octombrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 11)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Noiembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 12)
                        Console.WriteLine("Ziua : {0}(Vineri) \t Luna : {1}(Decembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    break;
                case "Saturday":
                    if (Luna == 1)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Ianuarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 2)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Februarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 3)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Martie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 4)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Aprilie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 5)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Mai) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 6)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Iunie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 7)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Iulie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 8)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(August) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 9)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Septembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 10)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Octombrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 11)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Noiembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 12)
                        Console.WriteLine("Ziua : {0}(Sambata) \t Luna : {1}(Decembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    break;
                case "Sunday":
                    if (Luna == 1)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Ianuarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 2)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Februarie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 3)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Martie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 4)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Aprilie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 5)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Mai) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 6)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Iunie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 7)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Iulie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 8)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(August) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 9)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Septembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 10)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Octombrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 11)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Noiembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    else if (Luna == 12)
                        Console.WriteLine("Ziua : {0}(Duminica) \t Luna : {1}(Decembrie) \t Anul : {2} \n ", Ziua, Luna, Anul);
                    break;
		      default:
                    Console.WriteLine("Oops... Something went wrong");
                    break;
	}
            Console.WriteLine("\n \t \t \t {0}:{1}:{2}", Ore, Minute, Secunde);
    }
    public void ziNastere()
    {
        Console.WriteLine("\n\n\n\t\tIntrodu data nasterii tale:\n Anul:");
            Anul1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Luna:");
            Luna1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Ziua:");
            Ziua1 = Convert.ToInt32(Console.ReadLine());
            if (Luna1 == Luna && Ziua1 == Ziua)
                Console.WriteLine("\n\t La multi ani!");
            else
                Console.WriteLine("\n \t Another \t time \t maybe!");
    } 

    private void Rev()
    {
        if (Luna == 12 && Ziua == 31)
            Console.WriteLine("\n Un an nou fericit!");
    }

    public Timp (DateTime datatimp)
    {
        Tipul = Convert.ToString(datatimp.Kind);
        Ziua = datatimp.Day;
        Luna = datatimp.Month;
        Anul = datatimp.Year;
        Ore = datatimp.Hour;
        Minute = datatimp.Minute;
        Secunde = datatimp.Second;
        ZiuaDinSaptamana = Convert.ToString(datatimp.DayOfWeek);
    }
    string Tipul;
    int Ziua;
    int Luna;
    int Anul;
    int Ore;
    int Minute;
    string ZiuaDinSaptamana;
    int Secunde;
    int Ziua1;
    int Anul1;
    int Luna1;

}
public class Tester
{
    static void Main()
    {
        string doarora;
        DateTime TimpCurent = DateTime.Now;
        Timp t = new Timp(TimpCurent);
        Console.WriteLine("Vrei sa afli doar ora? \t y/n \n");
        doarora = Console.ReadLine();
        if (doarora == "y")
            t.ArataTimpul();
        else
        {
            t.ArataTimpul();
            t.ziNastere();
        }
        Console.WriteLine("Press any key to exit");
        Console.ReadKey();
        
    }

}




I've also experimented a little with windows forms but that's bit more tricky ;)

Is This A Good Question/Topic? 0
  • +

Replies To: Beginner in C#

#2 macosxnerd101   User is online

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12648
  • View blog
  • Posts: 45,822
  • Joined: 27-December 08

Re: Beginner in C#

Posted 27 July 2015 - 09:04 AM

Start here. :)
Was This Post Helpful? 1
  • +
  • -

#3 Ryano121   User is offline

  • D.I.C Lover
  • member icon

Reputation: 1461
  • View blog
  • Posts: 3,289
  • Joined: 30-January 11

Re: Beginner in C#

Posted 27 July 2015 - 09:08 AM

Also try and see if you can cut down on some of that duplicated code :)
Was This Post Helpful? 0
  • +
  • -

#4 g4143   User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 52
  • Joined: 30-April 09

Re: Beginner in C#

Posted 27 July 2015 - 09:12 AM

Asking the question "which language is best for 'enter area'" is problematic from the start.

Programming areas like game development cover a large horizon of fields and languages. Pick a mainstream language and I bet you could find several games where that language plays a minor or major role. Game development is about implementing API's except for the developers who work for large gaming companies.
Was This Post Helpful? 0
  • +
  • -

#5 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2942
  • View blog
  • Posts: 11,426
  • Joined: 03-December 12

Re: Beginner in C#

Posted 27 July 2015 - 09:38 AM

Don't mean to dash your dreams, but the gaming area is highly competitive and you need to be very well versed in all aspects of programming to get one of those roles. Learning C#, or any single language alone is not going to get you there. If you are in school, focus on your math and physics classes and make sure you take some higher level courses as well.
Was This Post Helpful? 1
  • +
  • -

#6 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6535
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: Beginner in C#

Posted 27 July 2015 - 12:08 PM

There is no need for that horrific chain of if..else - The months are enumerated within the .NET framework. So you can get the enumeration and the globalized name with one call. For example:
CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName (DateTime.Now.Month);
Just feed it whatever number you want: 12 for December etc.

So that massive block from lines 13-197 should be about 10 lines.

You shouldn't be doing cases off strings like "MOnday" because its not cultural/globally aware. There are enums for days of the week: Use those. Avoid string for cases, always. If someone enters "monday" instead of "Monday" then it fails because C# is case-sensitive. There are 100 other ways that string compares can fail.

LInes 232-242 - Way too many globally-scoped variables for a small program like this. Maybe 1 or 2, but not a dozen or more. Your methods should take arguments and return results. The fact that your methods are all void returns and updating global variables is just bad.

For now you should probably just be studying and learning. Don't work on designing anything from scratch yet: You're just not that far along yet. You'll get there. But for now study not build.
Was This Post Helpful? 1
  • +
  • -

#7 jed0228   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 31
  • Joined: 05-April 15

Re: Beginner in C#

Posted 27 July 2015 - 05:56 PM

View PostAlexR8, on 27 July 2015 - 09:02 AM, said:

My teacher said C# is good for games industry, but is it true? If so, what should I learn first? If not, what language is the best for games?


I think it's C++. Maybe you can start off by learning C++ and SDL to make 2d's. There are tutorials over the net and also videos on youtube.
Was This Post Helpful? 0
  • +
  • -

#8 rgfirefly24   User is offline

  • D.I.C Lover
  • member icon


Reputation: 466
  • View blog
  • Posts: 2,212
  • Joined: 07-April 08

Re: Beginner in C#

Posted 27 July 2015 - 06:13 PM

If you truly want to get into the game industry, do some research. Look at the job boards for what EA, Blizzard, Sony, etc are hiring for. There are so many things that they look for now from c++ and C# to LUA or other scripting languages. Decide what part of game development you want to do. Do you want to do UI, Tools, Engine, scripting, etc.
Was This Post Helpful? 2
  • +
  • -

#9 AlexR8   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 27-July 15

Re: Beginner in C#

Posted 28 July 2015 - 07:26 AM

View PosttlhIn`toq, on 27 July 2015 - 12:08 PM, said:

Your methods should take arguments and return results. The fact that your methods are all void returns and updating global variables is just bad.

Well, this is how I've seen this code in a C# book

Original Code:
public class Time
{
// public accessor methods
public void DisplayCurrentTime( )
{
System.Console.WriteLine("{0}/{1}/{2} {3}:{4}:{5}",
Month, Date, Year, Hour, Minute, Second);
}
// constructor
public Time(System.DateTime dt)
{
Year = dt.Year;
Month = dt.Month;
Date = dt.Day;
Hour = dt.Hour;
Minute = dt.Minute;
Second = dt.Second;
}
// private member variables
int Year;
int Month;
int Date;
int Hour;
int Minute;
int Second;
}
public class Tester
{
static void Main( )
{
System.DateTime currentTime = System.DateTime.Now;
Time t = new Time(currentTime);
t.DisplayCurrentTime( );
}
}


I'm thinking that book could be with old programming methods?

View PosttlhIn`toq, on 27 July 2015 - 12:08 PM, said:

For now you should probably just be studying and learning. Don't work on designing anything from scratch yet: You're just not that far along yet. You'll get there. But for now study not build.


I know but I can't refrain myself not to go experimenting. It will be tough to learn it, I think (hope not), because at school we only learn C++ which I see boring and not quite powerful.

Sorry if my English isn't quite good ;)
Was This Post Helpful? 0
  • +
  • -

#10 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: Beginner in C#

Posted 28 July 2015 - 09:20 AM

Well, you've got some odd ideas, if you think C++ is "not quite powerful". C++ is unmanaged code. It's literally as powerful as you want it to be. You can do all kinds of low-level stuff in C#. Unfortunately, you can do all kinds of low-level stuff in C++ (see, it's a joke. You have all the power you need to do anything you want, including things you shouldn't do).

The problem is that C++ is hard. At least, compared to more managed, more abstracted languages. But because it gives you the deep functionality, it's excellent for games. Because games need to be optimized, whereas much "business" software doesn't. It can get by with the lower performance offered by the abstracted languages.

We've all been where you were: learning something new, wanting to dive in head first. But slow down, learn what's in front of you before you dive into the deep end. I've seen it happen before: people rush ahead, try a project far beyond their skill level, and abandon it. Often they get burned out on programming entirely. Don't do that to yourself. Learn it correctly first. The code sample you provided shows you have a lot to learn still. Work on that.
Was This Post Helpful? 2
  • +
  • -

#11 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5465
  • View blog
  • Posts: 14,418
  • Joined: 18-April 07

Re: Beginner in C#

Posted 28 July 2015 - 10:11 AM

View PostAlexR8, on 28 July 2015 - 07:26 AM, said:

...because at school we only learn C++ which I see boring and not quite powerful.


C++ can be boring at first because they often teach you console based apps which are just a black screen prompt that prints a few lines of code. But news flash, just about all the software you are using right this minute to read this message has large parts written in C/C++.

Windows, Mac, Linux, browsers, device drivers for your mouse, keyboard, trackpad etc are written in flavors of C/C++. :)
Was This Post Helpful? 0
  • +
  • -

#12 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6818
  • View blog
  • Posts: 28,230
  • Joined: 12-December 12

Re: Beginner in C#

Posted 28 July 2015 - 10:14 AM

Quote

I know but I can't refrain myself not to go experimenting.

This is a very good sign, and something we all do. However, you must restrain yourself while learning the fundamentals. Once you have a good understanding then, by all means, experiment away! But don't do so until you have a good, clear, understanding of the topic.
Was This Post Helpful? 0
  • +
  • -

#13 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: Beginner in C#

Posted 28 July 2015 - 10:21 AM

Truth be told, C++ might be one of the most useful languages that you can learn. It's used practically everywhere. It's got high-level constructs, low-level performance, and broad, broad support. And just understanding C++ (really C, but you get a similar insight from C++) gives you insights into how other, higher-level languages work "under the covers".
Was This Post Helpful? 0
  • +
  • -

#14 jed0228   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 31
  • Joined: 05-April 15

Re: Beginner in C#

Posted 28 July 2015 - 05:49 PM

View PostAlexR8, on 28 July 2015 - 07:26 AM, said:

because at school we only learn C++ which I see boring and not quite powerful.

So you already have a background with C++. Then maybe during your free time you can work on a game project as it's what interests you. By then you'll see that it's not boring and not quite powerful as you say :P/>
Was This Post Helpful? 0
  • +
  • -

#15 AlexR8   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 27-July 15

Re: Beginner in C#

Posted 29 July 2015 - 02:23 AM

So from now on I will as astonecipher said, focus on my math and physics classes and learn well the fundamentals of C# then "dive in" :) In parallel, as this is required for school too, I will deepen the knowledge of C++. Thanks guys! Topic can be closed ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1