Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
See more:
Sir,
I want to be a good programmar in .NET (C#). But I can not understand such thing properly like what index should be used after one another like to forecolor a text we use this syntax: system.drawaing.color.colorname or dropdownlist1.selecteditem.tostring() to show value of the dropdownlist

Explanation:
Like to upload file I use this code:
C#
String path = Path.GetFileName(FileUpload1.FileName);
        string fileType = Path.GetExtension(FileUpload1.FileName);
        byte[] imageSize = FileUpload1.FileBytes;
        long size = (imageSize.Length / 1024);
        string fileName = FileUpload1.FileName;
        FileUpload1.SaveAs(Server.MapPath("MyUploads/" + fileName));

                Image1.ImageUrl = "MyUploads/" + fileName;
                Image1.ToolTip = FileUpload1.FileName;
                Image1.Height = Image1.Width = 200;
                Image1.Visible = true;
                Label1.Text = "";

You can see after Path we use syntax Getfilename. Then in brackets fileupload1.filename


I just want to do it with rules like mathematics by own. To upload file there are other coding also. Different programmar has their different coding style. Because they learn it exactly which syntax should be used one after another. I want to be like them. I want to code in my own way. My thoughts should be clear what I m going to do and I am to know coding syntax. So please help me.


Is there any rule to program? Or just to cram up in .NET with some fixed rules.
I want to program like I do solve mathematics problem by own, I don’t or rarely follow help book. If I follow math help book I understand what’s going on, how it’s solved. But in .NET I can not understand properly.
So in .NET where I will learn exactly what index should be used one after another. Kindly give me suggestions in simple way.

Regards.

Hasan Al Banna

What I have tried:

I want to be a good programmar in .NET (C#).
Posted
Updated 4-Oct-16 6:41am
v2
Comments
Maciej Los 4-Oct-16 1:56am    
I want to be a good programmer too ;)
[no name] 4-Oct-16 6:49am    
"I want to be a good programmar", learn how to spell, learn how computers work, learn how to ask questions, learn how to do your own research. And most of all, practice, practice and more practice. That's how you become a good programmer.
Philippe Mori 4-Oct-16 9:35am    
If you want to be a good programmer, then start by using code block when you post code on a forum so that your code is readable. Dumping code in plain text, you immediatly loose the reputation of being a good programmer!
BillW33 4-Oct-16 12:42pm    
As Phillippe said, formatting your code block makes it far more readable. I took the liberty of formatting your code block for you. Note how much easier it is to read now.

You think programming is like math - a formula would be your "rule" then? No, that's not how it works.
It's more like an art, e.g. painting.
You have your tools (canvas, pens, brushes - in programming this would be compilers, languages, hardware...). You have your skills (drawing class, painting tech, whatever..) this is like your progamming experience. Then comes a requirement: Like someone tells you please paint a picture of this house - what will the outcome look if you hire 10 painters to paint the exactly same house? Very different I'd guess...
You see the rules are:
1. Every software that is worth writing is non-trivial (if this is not the case then the Software can likely modelled with a tool - think about Excel or something like this).
2. Every requirement translates to a selection of a correct toolset and language (this is the same for a painter, if you tell him: please paint this wall, he will not do it with a pencil but with water-resistant colors and so on)
3. The art in programming is to come up with a good enough representation of the real world problem that your Software is solving. This is where style and experience can make the most difference. Style is good to lessen thinking and to free yourself from common pitfalls and mistakes. Experience is good to find the "right" way a little faster...

Your question remembers me to my mother - when she got her first computer (years ago), she wanted to write down all needed "steps" to complete a task (write email, etc.) - it was hopeless. I told her not to fear making something wrong (I backuped everything), just click arround and try. It was just her "fear" of the unknown stopping her to experiment - Now she is surprisingly good at Computers, btw...
So I would suggest you do something similar with programming: write Code, debug!DEBUG!DEBUG!!! to see what's going on under the hood, learn about the basics of computers, algorithms, technologies... read code (open source projects, articles) - And when you finally find out there was no rule to follow, your code is an "invention", like an unique piece of art... Come back here and help the "next generation" ;)
 
Share this answer
 
Being a Programmer[^]

EDIT==================

I'm not sure why this was down-voted. It answers most of the OP's question on how to be a good programmer.
 
Share this answer
 
v2
Hello

First of all, you have to use HTML controls for Client-Side in .NET as much as you can. it will reduce the transaction time. So for text, images, buttons,links and etc, use HTML tags and controls if possible.

second, it is simple. like when you want to find something, you will call it by it's address, like : Inside 3rd room, inside 2nd locker, under the music CD. so in programming when need to access an object, you need to set the address for it. for example when you want to set a value for a control, you need to address it in the form: control.property : Image1.Visible = true.
or if you want to access a method, you need to code like it :
class.method : Path.GetExtension() or console.readkey();

it is something that you will learn due to coding.
hope I could help you

best regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900