First, sorry for my English guys.
Currently this is my first programming job. I am labeled as the most incompetent programmer in my company that's because they measure the performance and productivity of programmer by how fast you can get things done. I'm not really sure if I'm slow or not, because I always test(manual testing) my code before submitting it, and I'm pretty sure that most programmers here don't test their code the way I test mine. I don't do automated test because I admit that the concept is still complex to me. Since our software is not yet use by the user, we don't know which programmer has the most or fewer bugs. And also the system is for internal use only, so we don't have strict deadline. Time to ship is not that important.
We don't have best practices, automated testing, code reviews, and coding standard here in the company, so basically you are on your own, just make the code works and your fine. Almost all of the programmers here are fresh from college. Even me I'm a fresh graduate.
I think the reason why they are fast it's because they do all of the business logic in sql. So Basically they have all the UI code and Sql code in one .aspx file just like the code below
Patial class InvoiceView : Page { protected void button_click(object sender, Eventargs a) { string sql = "Select * from some blah blah blah"; DataTable tab = .....some Ado.net code here. Gridview.DataSouce = Tab; Gridview.DataBind(); } }
Before I got my first job(although this is my first job), I don't code like this anymore I usually use a custom object just like the code below.
Public class Invoice { public int InvoiceNo {get;set;} Public DateTime PaidDate {get;set;} Public List<Item> Items {get;set;} public decimal Amount { get { decimal amount = 0; foreach(var i in Items) { amount = amount + i.TotalPrice; } return amount; } } }
after that, I'm going to create a DataMapper class, and I'm pretty sure this is the reason why I'm slow, because I have to manually map the row table to objects and test the datamapper. So basically their is no ORM or micro ORM. Our database don't have referential integrety and tables always change. So I thought ORMs are not ideal for this project.
The person that labeled me as the most slowest is actually a junior programmer just like the rest. He has 2 years experience ahead of us, that's why he is our immediate superior. Sometimes I always think that the reason why he said that is because he is still a junior and no experience when it comes to managing a team of programmers.
I'm confident that I can do all the job they will throw at me.
Here is my question.
Should I use DataTable and shove it to gridview just like the rest of my team do?
When to use DataTable instead of custom objects or domain classes?
Currently I only know two Data Access pattern, ActiveRecord and DataMapper. What do you call the pattern that my team uses?
How can I code faster?
Thanks guys, sorry for my English.