[REL] [C#] [WPF] Simple Program
As the title says, it's a "SIMPLE" Program. I'm new to C# and I am learning C# since a few days now.
I made a C# App which does the following:
Asking for User Input for: num1, num2, num3. num4
And then, it gets calculated in the following equation:
Num1 + Num2 - Num3 * Num4
And it's output!
I know this application is simple, it includes my source code as well, I know this is not even worth saying source code since it's small but still, lol!
Download Link: http://hassantech.site90.net/CSharp/CSharp1.rar
Please suggest if I could improve my code or use a better practise! Also, please suggest me some basic project so I can improve my skills in C#!
Re: [REL] [C#] [WPF] Simple Program
Create a agenda application, I used to have a project like that in the first month I learned C# on school.
Use XML to store the data.
Re: [REL] [C#] [WPF] Simple Program
@jur13n no idea hw to do that. I am making a physics calculator.
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
iGalaxy
@
jur13n no idea hw to do that. I am making a physics calculator.
Stop making useless calculatores,
Get real and create something that's atleast usefull.
If you don't know how to do it, FIGURE IT OUT FFS, THAT IS WHAT CODING IS ABOUT.
Stop the fucking "no idea how to do that" crap you try yo pull of every fucking time.
It ain't worth helping you if you come up with that shit.
Re: [REL] [C#] [WPF] Simple Program
@jur13n ok sorry, I'll do my best! :)
Edit: I decided to stop working on C#, its too difficult for me. :[ I'll continue PHP for a few months, and start with C if I find a good compiler for that.. :)
Re: [REL] [C#] [WPF] Simple Program
Re: [REL] [C#] [WPF] Simple Program
@jur13n I know, I decided not to give up! I AM GONNA WORK ON IT NOW! I will work DAY AND NIGHT till I find a solution to the problem you've passed to me, I GOT THIS BRO! Plus I dont understand what features it should have in the agenda application.. :( still, first I will practise to store and retrieve data from an XML file in C#! Suggesting a good tutorial would be good, after-all you are the only person who is helpful to me in this forum.
Re: [REL] [C#] [WPF] Simple Program
So i got to say..
This thread is really really weird.
Some weird ass convo is going on here.
Weirdo1: I made this!
Weirdo2:No idiot make this you should make this!
Weirdo1: I will! No wait i will stop.
Weirdo2:Its so easy!
Weirdo1:I will do what ever you told me! Should i bend over now or later ?
IGalaxy, come on dude grow some..
I am pretty sure you just started and are still learning,
It is fine to just follow your own route to learn it, no need to rush it and do stuff people tell you do do.
jur13n, Your title says "Intelligent DoucheBag", now i ain't so sure about the first one, but the second one i agree with.
He is just showing something, like this sub-section is made for, no need to go on a rage..
OnTopic:
What you just made in indeed quite basic,
Try to make it a bit more advance, like giving the user the option to add/subtract, and all that.
Other then that, try to give variables more proper naming, so people know what it contains, having it being called Num1 etc, won't tell me much at all, other then it being a number, while it being a integer does the same.
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
ThuGie
So i got to say..
This thread is really really weird.
Some weird ass convo is going on here.
Weirdo1: I made this!
Weirdo2:No idiot make this you should make this!
Weirdo1: I will! No wait i will stop.
Weirdo2:Its so easy!
Weirdo1:I will do what ever you told me! Should i bend over now or later ?
IGalaxy, come on dude grow some..
I am pretty sure you just started and are still learning,
It is fine to just follow your own route to learn it, no need to rush it and do stuff people tell you do do.
jur13n, Your title says "Intelligent DoucheBag", now i ain't so sure about the first one, but the second one i agree with.
He is just showing something, like this sub-section is made for, no need to go on a rage..
OnTopic:
What you just made in indeed quite basic,
Try to make it a bit more advance, like giving the user the option to add/subtract, and all that.
Other then that, try to give variables more proper naming, so people know what it contains, having it being called Num1 etc, won't tell me much at all, other then it being a number, while it being a integer does the same.
The relation between the conversations of us has grown due other threads,
Your reference to this is fault because you obviously don't know the other conversations we had.
I think you really have to think about my title again, because you don't know me at all.
A intelligent person can still behave like a total idiot, as example; Einstein.
Oh wait, did I just hit you on the nail?
Re: [REL] [C#] [WPF] Simple Program
@ThuGie your suggestion was really good! I will implement it right away! @jur13n I cannot implement your idea, give me basic idea's first, I'm not even thorough with basic syntax yet.
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
iGalaxy
@
ThuGie your suggestion was really good! I will implement it right away! @
jur13n I cannot implement your idea, give me basic idea's first, I'm not even thorough with basic syntax yet.
The calendar is basic.
It's CRUD
Create, read, update & delete.
It's the main thing to learn all kinds of possibilities..
sigh.
Re: [REL] [C#] [WPF] Simple Program
Hey,
I indeed did not know about any other convo's you had before this, nor should i know,
This is a whole different thread.
And just because you can act like a idiot, does not mean you should.
If you still recommend him to make a calendar, why not point him in the right direction ?
Give him some simply steps he could make a guide perhaps ?
a calendar could save to different formats it could be sql, xml, plaintext and a ton more, perhaps for sql he simply never learned it, for xml some people never even heard of it.
plaintext not the best but a solution for a beginner, give him a simply way on how to best store it in a nice easy to read and parse format.
Well as its 2am, i am off to bed, goodnight.
Re: [REL] [C#] [WPF] Simple Program
@jur13n I'm still new, a tutorial would be great. :) I only know loops, if conditions and basic syntax.
Re: [REL] [C#] [WPF] Simple Program
... This topic...
Quote:
Originally Posted by
jur13n
A intelligent person can still behave like a total idiot, as example; Einstein.
*An
Well on the bright side he knows more than I.
I would not know where to start with C# or WPF.
Re: [REL] [C#] [WPF] Simple Program
@-DefauIT it's not that hard if you know PHP. I at last finished coding my own Calculator, will be releasing soon!
Re: [REL] [C#] [WPF] Simple Program
Go ahead and program hangman for 2 players, C# newbies. :D
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
שเ๒єtгเ๒є
Go ahead and program hangman for 2 players, C# newbies. :D
Omgg thxx i will do it!
Re: [REL] [C#] [WPF] Simple Program
Get out of the habit of writing code in the UI's code behind. Look up MVVM when working with WPF.
It'll save you a lot of headache in the future.
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
Supicioso
Get out of the habit of writing code in the UI's code behind. Look up MVVM when working with WPF.
It'll save you a lot of headache in the future.
Thanks! I will when I get to my laptop.
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
iGalaxy
Thanks! I will when I get to my laptop.
If you need some in-use examples feel free to look around this.
https://github.com/Tsume/Uguu/tree/master/Client
The folder Models is where majority of your code goes.
ViewModels is where ui updates go (more or less).
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
Supicioso
Thanks alot!
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
Supicioso
Get out of the habit of writing code in the UI's code behind. Look up MVVM when working with WPF.
It'll save you a lot of headache in the future.
Well writing code that controls the UI itself has to be placed there, but the only thing. No matter you use WPF, Windows.Forms, ASPX, whatever. Always code with a more tier architecture. Split managing logic off the UI. And split data access logic off the managing login.
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
שเ๒єtгเ๒є
Well writing code that controls the UI itself has to be placed there, but the only thing. No matter you use WPF, Windows.Forms, ASPX, whatever. Always code with a more tier architecture. Split managing logic off the UI. And split data access logic off the managing login.
No, it doesn't. I've halfway through with the program I linked to above, and I haven't written anything at all in the UI's code behind.
Done correctly, you shouldn't have anything at all in that file. If you're altering the ui from that file, you're doing it wrong and you're also opening yourself up to some headaches down the road.
Mostly UI blocking/locked threads.
Re: [REL] [C#] [WPF] Simple Program
Quote:
Originally Posted by
Supicioso
No, it doesn't. I've halfway through with the program I linked to above, and I haven't written anything at all in the UI's code behind.
Done correctly, you shouldn't have anything at all in that file. If you're altering the ui from that file, you're doing it wrong and you're also opening yourself up to some headaches down the road.
Mostly UI blocking/locked threads.
I see what you are doing there, but I wonder for what you got your MainWindow.xaml.cs then? Microsoft made it this way by clicking on events in the designer it adds the subscription method in the xaml.cs file automatically, for a good reason.
Now you just go out and write your own View controller/Model or what ever it is ... I can clearly see you mix UI events with business logic that does not belong there inside of the MainViewModel.cs. But about that there is always a grey zone between right and wrong.