They grow up so fast..
-
At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:
int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
this.dataSource.SelectParameters.Add("status", status.ToString());Given that Status is an enum with integer values, this would actually suffice:
this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());
Bless.
-
At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:
int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
this.dataSource.SelectParameters.Add("status", status.ToString());Given that Status is an enum with integer values, this would actually suffice:
this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());
Bless.
At least the kid theoretically understood what he wanted to accomplish. I'm guessing that you showing him the "correct" way will result in them learning as opposed to doing it over and over again. (Silver lining)
I wasn't, now I am, then I won't be anymore.
-
At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:
int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
this.dataSource.SelectParameters.Add("status", status.ToString());Given that Status is an enum with integer values, this would actually suffice:
this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());
Bless.
-
At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:
int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
this.dataSource.SelectParameters.Add("status", status.ToString());Given that Status is an enum with integer values, this would actually suffice:
this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());
Bless.
That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do. From them, I'd expect something more like this:
if (Page.IsPostBack == false)
{
int status = -1;
if (_statusBy == Status.FirstStatus)
{
status = 0;
}
if (_statusBy == Status.SecondStatus)
{
status = 1;
}
if (_statusBy == Status.ThirdStatus)
{
status = 2;
}
litStatus.Text = status.ToString();
}
string strCmdMySqlCmd = "SELECT * FROM myTable WHERE mtStatus = " + litStatus.Text + " AND mtRecordNumber = " + Request.QueryString["PleaseInjectSomeSql"];
myDataSource.SelectCommand = strCmdMySqlCmd;Count yourself lucky to have such a bright apprentice.
-
That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do. From them, I'd expect something more like this:
if (Page.IsPostBack == false)
{
int status = -1;
if (_statusBy == Status.FirstStatus)
{
status = 0;
}
if (_statusBy == Status.SecondStatus)
{
status = 1;
}
if (_statusBy == Status.ThirdStatus)
{
status = 2;
}
litStatus.Text = status.ToString();
}
string strCmdMySqlCmd = "SELECT * FROM myTable WHERE mtStatus = " + litStatus.Text + " AND mtRecordNumber = " + Request.QueryString["PleaseInjectSomeSql"];
myDataSource.SelectCommand = strCmdMySqlCmd;Count yourself lucky to have such a bright apprentice.
AspDotNetDev wrote:
That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do
Don't get me started, I'll be here all night and it's a friday.
AspDotNetDev wrote:
Count yourself lucky to have such a bright apprentice.
I do, don't get me wrong - I was just surprised that despite his ability to understand and get on with things fairly autonomously he still does some slightly daft stuff. For a measure of how bright he is, he already hates MOSS development, and that after only a couple of weeks. Clever lad.
-
AspDotNetDev wrote:
That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do
Don't get me started, I'll be here all night and it's a friday.
AspDotNetDev wrote:
Count yourself lucky to have such a bright apprentice.
I do, don't get me wrong - I was just surprised that despite his ability to understand and get on with things fairly autonomously he still does some slightly daft stuff. For a measure of how bright he is, he already hates MOSS development, and that after only a couple of weeks. Clever lad.
jim lahey wrote:
despite his ability to understand and get on with things fairly autonomously he still does some slightly daft stuff
Don't we all do that from time to time? :)
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:
int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
this.dataSource.SelectParameters.Add("status", status.ToString());Given that Status is an enum with integer values, this would actually suffice:
this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());
Bless.
Lol we have this code base written by our german counterparts from like 10 years, and i am sure most of them are atleast in their 40+ age having atleast 10+ years of experience. Lol their code starts with main and ends every god damn thing in it only. There are many surprising methods with 2000 lines of code in it. :zzz: :confused:
-
Lol we have this code base written by our german counterparts from like 10 years, and i am sure most of them are atleast in their 40+ age having atleast 10+ years of experience. Lol their code starts with main and ends every god damn thing in it only. There are many surprising methods with 2000 lines of code in it. :zzz: :confused:
We've got them too. I have to rely on an in house component that dynamically changes the datasource in a particular GIS file type. You have to give it the path to the file you want to change and a new filename for the changed version. If you pass it two nulls or two empty strings or two strings that have never been anywhere near a valid path or filename, it runs through without a peep. If you pass it a null or empty path and a valid new file name it creates an empty file with the name you gave it. If you feed it with correct parameters it also runs through without making any noise, so every single piece of software that uses this component has to check the paths are valid and that the created file at least isn't empty. I guess it's taking the single responsibility principle a little too far :)