Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
i'd at least like to know if they *think* they're going to be.

I don't think so. When I was in third and fourth year at Uni I was a lab demonstrator for the second year CS students. The ones who thought they would end up being professional programmers never talked to me, they did not need to. The ones who thought a CS degree meant good money after Uni but did not want to program, or who thought they did but had now learned their lesson: they talked to me.

I did have some sympathy for them though. Edinburgh at that time made everyone use ML which can be pretty confusing to start with, especially if you can already program in a non-functional language!
 

miniConvert

macrumors 68040
i do expect them to know how to test the code they themselves write. or how to pound away at it until it works. or at the very least, be able to read a compiler error and know wtf it's on about.
See, when I was at Uni I just did this. Plenty of the others, however, literally got the staff or other students to write their programs for them. Compiler error? "Help! I did it all right but it's not working!"

I don't think things have changed much. I just think a changing world has made dumbasses easier to spot.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
With programming homework, you have to remember that there are many more people doing this today than twenty or thirty years ago, so the average will be lower. There are just as many talented people today as thirty years ago. There are just many more untalented people that would never have gone into programming thirty years ago.
 

Nibbles

macrumors newbie
Apr 12, 2006
12
0
<grumpy old programmer>
Back in my day we didn't have no compilers, programming languages, internet, or errors that you fancy pants kids have nowadays.

You goddamn spoiled whippersnappers don't appreciate anything and take everything for granted. (waving cane wildly in the air for emphasis)

We wrote out machine code directly to punch cards and hand loaded it into the input feeders and if the code was wrong there were not any errors displayed only pages of raw garbage memory values output if you were lucky, punks.

And would someone turn down that damn music, I can't think with all you youngsters gallivanting around like oversexed rabbits. The kids today.
</grumpy old programmer>

;)
 

ChrisA

macrumors G5
Jan 5, 2006
12,912
2,158
Redondo Beach, California
so what's the deal? when the kids come here and unashamedly ask for "help" with their homework, is this a symptom of a larger issue? or am i just seeing the bad side in both situations? i don't expect kids coming out of college to be awesome, but... i do expect them to know how to test the code they themselves write. or how to pound away at it until it works. or at the very least, be able to read a compiler error and know wtf it's on about.

experienced developers, are you seeing the same thing? what gives?

I think it depends on the industry. The level of general competence of web based programming is "OMG horrible". I've seen some of the worst code there. People designing databases that couldn't have even scanned a textbook on the subject.

But in my Industry, aerospace. I think the HR people and the hiring managers are smarter and they know the better schools and what questions to ask. Mostly they seem to find people who got into programming because they like it Ask them questions like "what do you think about Sun's new compiler?" "What's your option about Posix threads vs. processes? When would you use each How to decide?" "If we gave you free time like Google does for you to work on your own project what would it be?" Who cares what the answers are. People into computers have strong opinions on this and can talk for hours. The ones who got through school by memorizing the text book and asking for help on the web won't have a clue

One thing that seems not to be taught at all except in some graduate level management courses is the theory of large scale development. That is how to write a millions lines of code "correctly".
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
Programming turns out to be a very personal thing. It is literally an extension of how you think. Everyone has his or her own styles, and adopts certain conventions for everything from language preference, structure, down to spacing, comments, variable names, etc.

As a result, I don't think it's for everyone, and even those who "get it", vary in the ways we wrap our heads around things. I can't tell you how many times I've looked at a problem and come up with a complex way to solve it, only to have my coworker look at me oddly and say, "Um, why don't you just do this?" ... huh, look at that!

There are those who are programming because they want to be, and some because they have to be -- it's part of the core curriculum of some other discipline, either in an engineering program (say) or even, nowadays, high school. My sister had to learn Java in a high school course. She had zero interest in it, and predictably, it was pretty disastrous.

I agree that the general level of quality seems to be going down, as programming skills are mass-marketed to people who don't really care or don't take ownership in their own work. It is also a matter of how well one is taught. Like driving, if they teach you good habits early, you'll be a better, more defensive driver. If you look at the quality of some of the instructors out there, I think this explains a lot :p

Learning to drive is easy: press here to go faster, press here to go slower, and aim with this wheel-thing. That's all you need to know. Learning to drive well, safely, defensively, thinking ahead, making snap decisions, anticipating, planning your route -- the habits, the discipline of driving -- that's what takes effort.

I think it's the same with programming. They need to teach more than syntax. One needs almost to learn "how to think like a computer", how to structure your thinking to help see how the problem will be solved.
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
40,077
8,340
Los Angeles
Perhaps we should ask ourselves what kind of programming experience is needed by an educated person who isn't going to work in a profession, but not as a programmer? If your major requires a programming class, and (we'll assume) it's for a good reason, then what's the reason? Do biologists need to know how to program, or at least have an understanding of what programmers do, in order to do their job? Sports psychologists? Linguists? Business managers?

If we're talking only about concepts (how to think like a computer), then a one-time-and-it's-over course in object-oriented high-level languages don't seem like the right choice to me. There's too much going on "under the hood" to make it transparent; it's more like magic tricks. Computers "think" in primitive steps, so learning how to write an algorithm in a simple language teachers that lesson more clearly. High-level languages and high-level organizational thinking help us program because they synthesize the process. They make us programmers more efficient, but mastering them requires higher levels of skill. And that's not worth the investment for a "casual learner."

So it's not unreasonable to ask WHY people with little interest in programming are in programming courses, and what they SHOULD get out it.
 
In my experience, there is too much focus in programming on doing things 'correctly'. Also, I will point out now, that this post is intentionally dogmatic - I know full well there is a balance to be struck.

Where I currently work, we have a web site (several domains) that, from a design point of view, are an unmaintable, buggy mess of largely unverified code (talking about backend and legacy interfaces and databases not just html and js here). But the thing is, they turn over several hundred million every year. Everyone with any experience with whom I have worked has similar stories of god awful programming that has been deployed in a commercial environment (and turned a profit). Code, in all these cases, has been begged, borrowed, probably stolen and certainly ripped from other projects - it doesn't matter where the source is. The first rule of programming is to write something that works. Everything else comes second. Time spent perfecting the design represents income and market position lost.

IMHO, I see far too many questions looking for answers to trivial problems that have already been solved a million times especially when someone really just needs to foucs on getting a job done. I see too many suggestions telling beginners that they need to learn programming from the command line and how things work 'under the hood' when clicking 'build and go' is all they really need to know. Knowing how things run behind the scenes in an IDE is a job for the IDE developers.

Programming is increasingly widespread and builds on top of existing code. I have seen too many interested geeks (and I include myself here) getting too involved in finding out things they simply don't need know. The people that ChrisA describes, are often bright but equally often have very low productivity, being far too interested in some unobtainable, ideal solution. I cannot tell you how often I see people getting caught up in premature optimisation, my own personal nemesis. The most productive people are often those who come from non-computing backgrounds - who focus on the problem domain and not the relative merits of one compiler or another, or even one OS or another.

Programming is a tool used to solve problems, not an end of its own. Programming is increasingly (and this will not change) abstracted from the machines on which it runs, but I feel that teaching has yet to address this.

When it comes to yet another trivial homework assignment - well, I just feel like answering the damn thing so that the poster can focus on what really interests them.
 

zimv20

macrumors 601
Original poster
Jul 18, 2002
4,402
11
toronto
Knowing how things run behind the scenes in an IDE is a job for the IDE developers.

taking that as a generic statement rather than specific to IDE's, that's not been my experience at all. it may work 80% of the time, but ime there's always a time when working at that higher level isn't sufficient.

when everything at that higher level "looks right" but still doesn't work, you need those developers who do have a thorough understanding of How Things Work.

agreed about too-early optimization and too-perfect designs, but i can't agree with the notion that design and architecture take a back seat to "getting it done the ugly way." again, that'll get you 80% of the way there, but that 20% is always a bitch. how often have we seen a project re-architected 80% of the way through? or just scrapped when people couldn't get it finished? that's a symptom that people were too eager to just Get It Done and paid too little attention to the factors that create maintainable and extensible systems.
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
In my experience, there is too much focus in programming on doing things 'correctly'. Also, I will point out now, that this post is intentionally dogmatic - I know full well there is a balance to be struck.

I agree that there's a balance. You certainly don't want people focused on premature optimizations. But there is such a thing as good style, and good design. Yes, it's faster and initially more productive to "just get it done" but that will eventually hit a wall and you'll be paying for it later. If it's a really small project, perhaps that may never happen.

I admit I don't have a lot of industry experience, but I can tell you that whenever someone takes a shortcut like that, someone ends up paying for it later. Perhaps not the same guy. I struggle every day with code that makes you go "WTF???" and whenever I ask why it's like that the answer is, "Yeah, that was written a few years ago by a programmer who just threw it together quickly", either due to inexperience or deadline crunch. (And you can tell which -- half the time, they also add "...that guy doesn't work here anymore.") This doesn't change the fact that today I have a job to do: fix bug X or add feature X. My job has just been made 10x worse because a few years ago someone cut a few corners.

I also have mixed feelings about your opinion on not needing to know what goes on "under the hood". You're right, today's well-abstracted programming models and IDE's make it easier to learn programming without ever understanding what goes on below. But I think this contributes to the problem that the OP brought up -- at some point you will hit a wall because you won't be able to wrap your head around some concept unless you drop down a level of abstraction.

I took a computer systems engineering course where we were exposed to all levels of software engineering, from the management and development cycles, to high-level design and OOP, design patterns, C++ and Java coding labs, 80x86 assembly language, operating systems, real-time concepts, digital logic (flip flops etc), down to how transistors work at the electron level. I can sit down at a computer and be pretty confident I know what's going on.

One day I was in a lab in the computer science wing, and two girls were beside me trying valiantly to understand why their program wasn't working. They'd run it from the IDE, the program would crash, and the IDE would bring up a dialog with an assembly backtrace and register dump. The girls would immediately dismiss the dialog and go back to eyeballing their code, looking for the error. I offered to give them a hand, and showed them how to read that assembly trace. We found a JMP instruction with a register value of 0. A null pointer. Problem solved.

A trivial example, but one which I face all the time at work. When there's something I can't figure out, there's one guy on my floor that we all turn to for help. He works his magic, examines hex dumps, greps and pipes and zeroes in on the problem. I try to learn from him whenever I can, because there's always something at the next level of abstraction that will help me understand how to get my work done.
 

zimv20

macrumors 601
Original poster
Jul 18, 2002
4,402
11
toronto
My job has just been made 10x worse because a few years ago someone cut a few corners.
there's a reason that 80% of the cost of a project over its lifetime is maintenance...

you bring up a good point about small projects, and it suddenly dawned on me that the advancement the field has made in the past, say, 20 years has contributed to the number of people who can get a project done w/o paying much attention to design, architecture, maintainability or extensibility.

meaning: there are practically countless technologies that enable one to complete a project themselves, whether that be a website, web app or desktop app. a number of them hide lots of details, so one can do a project w/o a great deal of understanding of what is actually happening.

in a lot of ways, this can be a good thing. but i think a side-effect is that people who aren't brought up in a large team environment, who don't have to work with others, is that Working is king. who cares if the database isn't normalized? who cares if architectural boundaries have been crossed? who cares if the modules are tightly coupled? since no one else will see the internals: who cares about good design and architecture?

perhaps it's only in a large team environment that things like contracts between layers, non-coupling, abstraction, documentation, test suites, QA, version control, release control, requirements, etc etc are recognized as necessary. so when a Get It Done However person is put into such an environment, there's a culture clash. further, perhaps that's what i'm seeing: semi-competent but undisciplined college kids becoming the proverbial rhino in a china shop once they're out in the real world.
 

pilotError

macrumors 68020
Apr 12, 2006
2,237
4
Long Island
there's a reason that 80% of the cost of a project over its lifetime is maintenance...

you bring up a good point about small projects, and it suddenly dawned on me that the advancement the field has made in the past, say, 20 years has contributed to the number of people who can get a project done w/o paying much attention to design, architecture, maintainability or extensibility.

meaning: there are practically countless technologies that enable one to complete a project themselves, whether that be a website, web app or desktop app. a number of them hide lots of details, so one can do a project w/o a great deal of understanding of what is actually happening.

in a lot of ways, this can be a good thing. but i think a side-effect is that people who aren't brought up in a large team environment, who don't have to work with others, is that Working is king. who cares if the database isn't normalized? who cares if architectural boundaries have been crossed? who cares if the modules are tightly coupled? since no one else will see the internals: who cares about good design and architecture?

perhaps it's only in a large team environment that things like contracts between layers, non-coupling, abstraction, documentation, test suites, QA, version control, release control, requirements, etc etc are recognized as necessary. so when a Get It Done However person is put into such an environment, there's a culture clash. further, perhaps that's what i'm seeing: semi-competent but undisciplined college kids becoming the proverbial rhino in a china shop once they're out in the real world.

Corporate America has given up on best practices and moved on to good enough software development. Software has become so large and complex, that its practically impossible to continue reinventing the wheel with the latest and greatest technologies that come along.

At some point, its about time to market and stability. I love when the fresh blood comes into the market and discovers the horrors that lie below the surface. They are absolutely astounded that anyone could do that. Well the reality is that in some shops, that horror show was touched by no less than 40 programmers and 20 consultants over a period of 10 years.

I more or less go by the philosophy "If it ain't broke don't fix it" I don't refactor code because some genius came up with a great new design pattern . Its always going to be a game of catch up and you can never win.

This is now so far off topic, I think I'll stop the rant now! LOL
 

zimv20

macrumors 601
Original poster
Jul 18, 2002
4,402
11
toronto
I more or less go by the philosophy "If it ain't broke don't fix it" I don't refactor code because some genius came up with a great new design pattern . Its always going to be a game of catch up and you can never win.

to be clear, i'm not talking about re-designing or re-architecting working code. the stuff i deal with on a daily basis is plain ol' broken, often because someone violated a design or architectural intent and took a short cut. yeah, maybe *that* bit of code works, but either something else broke or something based on it can't work.

this isn't a "purity of design" issue for me, it's shoddy workmanship resulting in more effort to get it working down the line. my philosophy is: do it right the first time.

i'm working on 2 project right now in their final 20% phases. i wasn't around for the initial 80% on either, and guess what: it's now my job to fix the stuff. (and one of them just went through a nearly complete rewrite, natch).

so in a way, i guess i owe my continued employment to those who messed it up in the first place :)
 

davidlt

macrumors member
May 22, 2007
56
0
Lithuania
Hm... I started to program since 5-6 grade when I saw such thing as Pascal. Right now I have tested most of popular and not programming languages, working with all king of operating systems and I could say that's very interesting and I love it. I still feel like I am lazy... But not as you describe...

I am studying Software Engineering, right now most of the time I am spending with Pascal (must) and ASM. Yup, I can write ASM code, I understand machine code and how CPU works and etc things. It's my first year in university, but I am already teaching second year students. Damn, I am even writing Base64, CRC32 encoding/decoding programs and even disassembler with ASM. And a lot of other things...
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
to be clear, i'm not talking about re-designing or re-architecting working code. the stuff i deal with on a daily basis is plain ol' broken, often because someone violated a design or architectural intent and took a short cut. yeah, maybe *that* bit of code works, but either something else broke or something based on it can't work.

this isn't a "purity of design" issue for me, it's shoddy workmanship resulting in more effort to get it working down the line. my philosophy is: do it right the first time.

This is how I work too. Like you, I'm not hung up on "No, no, the best way to do this is Design Pattern X as written by the authors of this textbook, just the way I learned in my High Level Software Architecture & Design course!" when it comes to the real world. I'm talking relatively little things, common sense things, that add up when you're working with a half-million lines of code.

Things like 10 classes that are almost identical and really, really should have inherited from a common base class. Maybe it started as two or three and the person didn't think it worth the bother to do an inheritance scheme, and found it quicker to hit Copy+Paste, and over the years they've just kept that up. Now I'm ready to add an 11th -- do I perpetuate the mess with another Copy+Paste, or do I take the extra time to go back and re-architect everything?

Or a bunch of classes that do inherit from a base class. The base class defines an Init() method, and most of the subclasses call the base class Init() before adding their own thing. Except for 3 classes which decided to be their own dog and copy/pasted the contents of the base class Init() into their own. Now I have to make changes in four places.

Or a magic number used in one place, a #define helpfully placed in another, and a totally different #define in yet another place, all referencing the same constant. That's THREE things to check now, in countless places, to change one value. Someone didn't do their homework and check to see if the value they wanted to define already existed elsewhere.

The rules I've (unofficially) adopted for doing my work:
- If I don't need to touch it, I won't.
- If I do need to touch it, and it meets the corporate coding standard, even if it's got a WTF? design element, I keep it as-is and follow the same "style" unless there's a good reason to go back and fix it all up. The rule of thumb is to be consistent, make it look like a single author wrote everything. Sometimes this perpetuates bad code, but we don't have time to refactor it or risk breaking the system with deadlines looming.
- If it is not up to the coding standard, I will bring the code I touch up to standard. (Sometimes this just means adding comments to describe functions, or removing a magic number.) This means you might have a class with 10 crappy-looking methods and 2 pretty ones, but over time little by little the code will start looking better.
- If I'm writing code from scratch, I will exceed the corporate coding standard: liberally commented, spaced, algorithms well described, architected as best I can from the way I learned in school. My goal is to make my peer code reviewers smile and say "Wow, that looks great and was easy to understand - I actually enjoy reviewing your code!" (Yeah, someone actually said that!)

We err on the side of simplicity, too. A trinary construct like:

return foo ? x : y;

is clever, but

if (foo)
return x;
else
return y;

Is a whole lot easier to read at a glance, and produces exactly the same code.
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
40,077
8,340
Los Angeles
We err on the side of simplicity, too. A trinary construct like:

return foo ? x : y;

is clever, but

if (foo)
return x;
else
return y;

Is a whole lot easier to read at a glance, and produces exactly the same code.
And this is the same too:

Code:
if (foo)
  return x;
return y;
But I think the extra (but unnecessary) "else" makes the code easier to read. I agree that learning to make code readable is one of the lessons programmers should get. Even a "quick and dirty" program can end up being used for years.
 

zimv20

macrumors 601
Original poster
Jul 18, 2002
4,402
11
toronto
I think the extra (but unnecessary) "else" makes the code easier to read.

but i hate seeing deeply nested if/then/else constructs for multiple exit conditions, instead of using multiple returns.

ugh:
Code:
if (foo)
{
	if (foo.bar)
	{
		if (foo.bar.length > 0)
		{
			// do something
		}
	}

}

better:
Code:
if (!foo)
	return;

if (!foo.bar)
	return;

if (foo.bar.length > 0)
{
	// do something
}

imho.
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
40,077
8,340
Los Angeles
My habit is to use early returns for error conditions, rather than enclosing the rest of the routine in a huge "else", but I prefer to minimize the number of returns for successful cases.

So I might use either of these:
Code:
result = foo ? x : y;
return result;
Code:
if (foo)
    result = x;
else
    result = y;
return result ;
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
Cramlington, UK
We err on the side of simplicity, too. A trinary construct like:

return foo ? x : y;

is clever, but

if (foo)
return x;
else
return y;

Is a whole lot easier to read at a glance, and produces exactly the same code.


A bit of topic I suppose… but if foo, x and y are simple then I think return foo ? x : y ; is neater and just as easy to read than an if … then … else . I don't know why people shy away from using it.

b e n
 

zimv20

macrumors 601
Original poster
Jul 18, 2002
4,402
11
toronto
My habit is to use early returns for error conditions, rather than enclosing the rest of the routine in a huge "else", but I prefer to minimize the number of returns for successful cases.

yep. i'm the same way.

I don't know why people shy away from using it.

readability issues aside, there's also ease of debugging. kind of stinks in a debugger when facing lines like:

Code:
return foo(a, b, new C(e, d, f));

that's not theoretical; i see stuff like this every day.
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
Cramlington, UK
yep. i'm the same way.



readability issues aside, there's also ease of debugging. kind of stinks in a debugger when facing lines like:

Code:
return foo(a, b, new C(e, d, f));

that's not theoretical; i see stuff like this every day.
\


Sorry, didn't mean to promote the use of a ternary operator in a return statement. Returning the value of a calculation or function/method call is going to make debuging more complicated.

I just wanted to comment on the ternary operator in general. I really don't see why people think something like this is difficult to read (with the proviso that foo, x and y are simple):-

Code:
result = foo ? x : y;
return result;

A professional programmer shouldn't even blink at something like that. Well that's just my opinion!

b e n
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
I just wanted to comment on the ternary operator in general. I really don't see why people think something like this is difficult to read (with the proviso that foo, x and y are simple):-

Well, if they're simple, I wouldn't mind, but it degenerates from there very quickly. The example I gave is trivial, granted.
 

zimv20

macrumors 601
Original poster
Jul 18, 2002
4,402
11
toronto
I just wanted to comment on the ternary operator in general. I really don't see why people think something like this is difficult to read (with the proviso that foo, x and y are simple)

i agree with you, actually, provided it's simple. i'll use it sometimes. i'll also do stuff like:
Code:
boolean done = (all_tasks == COMPLETE);
boolean happy = (last_result == SUCCESS);

if (done && happy)
...
... which i've had people say is confusing. i think it reads fine.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.