If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How to Learn the Parts of Programming that Aren't Programming.

Yes, I am aware that the title of this thread could use some work, but truth be told, the question I have is fairly broad and difficult to narrow down. In fact, it is likely better expressed as a series of questions. The reason I post it here is because the language I am currently using is C#, and I'm sure it's at least possible that the solution could very well be specific to it and/or .NET in general.

Anyway, I have been working in PHP for the past year, and recently I started learning C#. I have learned a lot and am ready to start a project to continue my learning, but I find that I don't know some basic things that have nothing to do with coding that maybe someone here can help steer me in the right direction.

Working with web applications, I understand for the most part what all file types I need to complete a given project. An example would include .css files for formatting, php files for form processing and dynamic html, js files for javascrpt, and a hook into a data source for those sorts of things. All syntax aside, I have no idea what kind of components are used for what when it comes to this sort of development.

Now I have seen examples of reading information from a text file, and I know that these applications can hook into databases, but how are these sorts of needs measured and planned for?
- Is having something like a json file the way to go for specific needs and not others, or is it completely up to me?
- Does using a database cause unnecessary performance increases that are solved by reading from a file?
- What if that file needs to be kept safe from the user?

I am using data as an example, but in truth this is just an item of convenience. What I am really looking for is a site/article/course that deals with the non-programming aspects of development like my data example, because any that I have read generally assume some knowledge or future exposure that will shed light on this. I can grasp the syntax, but this is so foreign to me that I am having difficulty even finding a place to look. Also, I am teaching myself and do not do this as a profession, so I have no colleagues to ask, nor do I have a project to work on that guides me to these answers.

Re: How to Learn the Parts of Programming that Aren't Programming.

If you plan to build a web site with C#, check out creating a new web site using MVC5 and Razor.

As far as reading data from a file, you can do that for read-only files that rarely get updated. But for anything more substantial (in my opinion), you are better off going with a database.

What databases do well is handle concurrency. If you want to try to replicate that using files, you'll need to manually implement thread-safety and synchronize access to the files (because web requests come in on different threads and if you don't synchronize you can get file corruption).

Re: How to Learn the Parts of Programming that Aren't Programming.

Thank you for your answer.

I am not planning a web site, though the project in question will likely need a companion in that form. Does your answer stand for non web-based projects? I attribute the lack of clarity with the fact that the only interactions that many online guides and courses address generally include reading from a file, but they mention database access as a sort of afterthought.

Re: How to Learn the Parts of Programming that Aren't Programming.

Originally Posted by decimer

Thank you for your answer.

I am not planning a web site, though the project in question will likely need a companion in that form. Does your answer stand for non web-based projects? I attribute the lack of clarity with the fact that the only interactions that many online guides and courses address generally include reading from a file, but they mention database access as a sort of afterthought.

If you are building C# apps on Windows, then it depends. For read-only data, you can use the app.config file (and the XmlSerializer to read the data). For read-write, user or app setting data, check out the Settings class (look in the Settings tab of the Project properties to define the settings).

You also can read or write to any files, but you have to be careful where you put these files, because some of the system folders are locked down and you can't write to them while the program is running (unless the program has elevated permissions).