|
Mark_Wallace wrote: it's an array (which it still is, but no-one bothers to try to get that into their heads
Oh, you mean they who do char[] c = s.ToCharArray() or char[] c = s.ToArray<char>() ?
|
|
|
|
|
It's worse than the '80s. Pascal and C had complex types at the end of the '60s. Even Fortran had a complex type (a pair of integers) in 1957...
|
|
|
|
|
The multiple arrays design isn't really needed much anymore, but similar issues do occasionally crop up from time to time in the real world. I'd rather see students learn how to handle those issues on assigned toy problems than in real world code. I'd like to believe they just haven't been educated in OOP very well yet, which given that it is early in the school year, may well be possible.
Even the does-not-compile code is a typical student blunder, I used to see several similar problems every semester when I use to work at the school computing center. Kudos to this student since they're well on their way to having a clue -- they're getting to it early, instead of waiting till the end of the class, which is usually when we'd get students that lost.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
<GeezerWarStoryAlert>
My data structures class in college was taught in FORTRAN, where we used arrays to implement everything: linked lists, binary trees, heaps, etc. An array of integers effectively simulated word-wide memory, with array indices corresponding to addresses.
In retrospect, this approach somewhat obscures the 'data structure' in lieu of the implementation. However, it gives you a profound appreciation of how memory works and mysterious beasties like pointers.
</GeezerWarStoryAlert>
Software Zen: delete this;
|
|
|
|
|
It's not a new trend, it's an ongoing current trend
Seriously though, it's actually to do with the current state of I.T education (Well at least here in the UK anyway)
Put simply,
there are way too many "General Purpose Teachers" and not enough "Specialist Teachers" , as a result many teachers that are teaching the next generation (and to be clear here, we are on about 6th form and colleges too), are teaching them from text books.
A friend of mine, recently decided that programming was for him after getting inspired watching a community presentation I delivered. So he trotted off to his local community college and signed up for "Computer Programming Essentials"
His guide book for the college, stated:
"You will learn the fundamentals of software engineering, application design and general software problem solving, enabling you to build high quality software applications for now and the future and providing you with a firm foothold through the gateway of professional software development"
All sounds, rather splendid if I do say so my self.
We are now, 5 months in on his course, and so far he's learned nothing more than putting together simple desktop applications using Visual Basic .NET
He's let me see every assignment he's been set, every bit of homework he's been asked to do and all he's done is learn how to wire VB components together.
He's done nothing even remotely near understanding application architecture, good development practices or anything like that. He's not been told what the difference between integers, doubles & reals are, he understands nothing about how computers do maths.
All he's been doing is learning how to pull data out of various "Things" , reshape it, then display it in ever changing fancy ways.
----------
Not too long ago, my Niece announced she was doing computing at comprehensive school, she came home with an A+ in computing and I.T, needless to say I was a proud uncle, until I dug into her curriculum and looked at the subjects she'd been getting taught.
See attained the A+ because she'd figured out how to do animated sound & graphics on her own using PowerPoint, her teacher then sat her on a virtual pedestal and encouraged the rest of the class to strive to attain these high standards, if they wished to go into the software development & programming industry.
-------------
Lastly, a very good friend in India recently explained to me how I.T and software education works out there.
There are basically a bunch of private companies, that get hold of old text books, 2nd hand PC's and set up "Computing Schools", they charge substantial sums of money (Which many scrimp hard to save up for) for the promise of a better future working in I.T (They play on the whole climbing of the social ladder thing).
These code schools then go on to deliver a perfect page by page textbook rendition of JAVA programming, and at the end give out some form of certification to say the student has passed course X
---------------------
The problem here is NOT the teaching of programming, we all need to have some base to establish our initial adventures on (For me that was Sinclair basic and Z80 machine code, way back in late 1979)
The problem is that, potential programmers are NOT being taught to think. Their not being taught to explore potential and experiment. They simply get taught that A=A and B=B and this is how you do C
Look at the religious wars between C# and JAVA advocates, do you really think we'd have those kinds of feuds if developers where trained to write software and not just program in a language, direct from a text book.
When I graduated from University in the early 1990's I graduated with a "Software Development" degree. I walked away, with a formal education in using Pascal, straight into my first commercial role as a C++ developer, and it was no big deal.
I picked the syntax up almost immediately, and the bits I didn't understand, I went out and studied in my own time.
Developers these days are not trained to think that way, their trained simply to follow instructions, instructions that are often given to them by managers/bosses/clients who don't understand the first thing about software and how it's constructed.
With unrealistic timescales, ever increasing demands and a belief from non I.T folks that this person has been taught therefore it's easy for them, many developers just exist to punch code and take a paycheck home at the end of the week, and never increase their knowledge or even start to explore the wonderfully creative world we actually have in front of us.
Yes I ramble on a bit, yes I make a lot of noise Why? It's simply because I'm passionate about what I do, and I like to rattle the cage bars when I see something that's just not quite right.
|
|
|
|
|
This code (sanitized):
static public void PostSomeCodeMethod(string v1, string v2, string v3)
{
string xmldata = iRecord.CreateField("apicode", APICodes.SomeCode.ToString());
xmldata += iRecord.CreateField("f1", const1);
xmldata += iRecord.CreateField("f2", const2);
xmldata += iRecord.CreateField("f3", v1);
xmldata += iRecord.CreateField("f4", v2);
xmldata += iRecord.CreateField("f5", v3);
ErrorMessage = null;
CallPostAPI(xmldata);
Is duplicated a dozen times. The only difference? The method name and the APICodes enumeration.
I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.
(Not to mention the horrific way the XML data is created. Happy belated Halloween, everyone.)
Marc
|
|
|
|
|
I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.
I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.
I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.
I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.
I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.
I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Warning - you have a C&P error on line 5.
I have some coolaid to sell you.
Marc
|
|
|
|
|
W∴ Balboos wrote: I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code. Where have I read this before?
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
My blog[ ^]
|
|
|
|
|
Marc Clifton wrote: copy and paste should be banned AMEN BROTHER!
Copy/paste is the evil of this world.
I've seen SO much copy/paste bugs. I'll just copy this code, make some edits, forget to change a variable name and... 1 + 1 = 3...
I actually worked with someone who worked with a certain library for well over a year, but couldn't create a new project because he always copy/pasted his code and didn't actually know what he was doing...
And then there's the duplicated code...
I always say copy/paste is a right you have to earn and once you've earned it you won't need it.
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
My blog[ ^]
|
|
|
|
|
Sander Rossel wrote: I always say copy/paste is a right you have to earn and once you've earned it you won't need it.
Well said!
Marc
|
|
|
|
|
Lovely horrendous code. Even a stringbuilder would not be an improvement, it would merely be some paint over a house that is nearly collapsing.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Mopping with the crane open!
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
My blog[ ^]
|
|
|
|
|
Marc Clifton wrote: there must be something we can put into the water There is. Code reviews.
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: There is. Code reviews.
How do you figure out that the guy you hired is creating crap, especially if you're a small outfit and you only have one dev, and it's this guy? Do you hire another consultant to do the code reviews?
BTW, here's is bio:
With degrees in Electrical Engineering and Computer Science, Mr. ... has been programming and designing computer applications for over 20 years. The last five years have been spent on developing mobile apps for iPhone, iPad, Android and Windows Phone and Windows 8 environments. Mr. ... skills also include being a MS SQL Server DBA as well as a web developer..
Now that's scary.
Marc
|
|
|
|
|
Marc Clifton wrote: How do you figure out that the guy you hired is creating crap, I don't see any way other than formal/informal code inspections. The sooner they're done, the easier they are to fix. Eyeballing check-ins at the end of the day may be a valuable yet lightweight approach. If there's no cause for alarm, further reviews may be unnecessary, or at least not frequently required.
You don't want to find yourself in a situation (as I expect you may be in) where several weeks of check-ins are of poor quality.
/ravi
|
|
|
|
|
Marc Clifton wrote: With degrees in Electrical Engineering and Computer Science, Mr. ... has been programming and designing computer applications for over 20 years That's like saying "with qualifications in refrigerator and microwave oven design, Mr. ... has been creating recipes for over 20 years".
The qualifications have little to do with the work he's doing.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Ravi Bhavnani wrote: Marc Clifton wrote: there must be something we can put into the water There is. Code reviews.
Well, we could put the offending developer into the water ... head-first. That would solve the issue.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
I disagree. Copy-paste makes for highly-efficient coding. Not only do you get a perfect duplicate of a line, but the efficiency increases exponentially with the number of copies! Think about it... First you copy-paste one line, then you copy-paste those two lines, then four... You could be copying thousands of lines after only a dozen pastes!
And think about it... Unlike all of those silly objects and functions, you can change just one of those thousand copies without having to mess with all of the rest! It's so much better that way.
So everyone needs to copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....copy-paste more....
(Chris needs to add a <sarcasm> tag to the forums, cause I know someone is going to take the above literally... Well, not now, because they'll read this message... Unless it's too small... Here, let me make it smaller.....)
|
|
|
|
|
Ian Shlasko wrote: you can change just one of those thousand copies without having to mess with all of the rest! It's so much better that way.
Or use it's evil twin, search and replace to easily change everything everywhere with the click of a mouse button!
You've changed my thinking, Ian! I shall strive to become a copy-paste-replace developer!
Marc
|
|
|
|
|
Copy is OK; it's paste that causes the trouble.
|
|
|
|
|
If he was being paid by number of lines of code, I congratulate him. I'd probably do the same.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
C&P is so called static modelling, where programmer runs the program (not the computer), evaluate the exit and then write exactly what he done in his head in code, so computer can repeat it. Ironic thing is that computer is made for automation and actually it is his job to do the repetitive stuff while human neural network (called brain) is very good in finding and giving short description of repetitive stuffs.
So apparently some brains are better than others.
|
|
|
|
|
So, I just compiled a small web service that I, of course, did not write.
Got almost 100 "Unreachable code detected" errors. Why? Here's an example:
case [some case]:
return CallSomeFunction(xmldata);
break;
Marc
|
|
|
|
|
Well, you wouldn't want it to fall through, would you?
|
|
|
|
|