Things college professors say

Pages: 12345
Coding conventions are not right or wrong. Conventions are just conventions.

However, I could argue:
 
int *p, r;


 
int* p, r;


The second one is misleading, because syntactically it is int (*p), not (int*) p. * binds to the right.

1
2
if ( condition ) {
}


There is nothing bad about it. It is just a convention. Some people don't like wasting a whole line for a brace.
Last edited on
You are arguing stylistic concerns.

The "attachment" of the asterisk can trip students up no matter which item you make them stick it to.

And braces mean nothing. Indentation means everything.


Either way, the students must come to understand the meaning behind the syntax before they can move on. There is no magical "this syntax style is better".



Though I personally find the exampled brace style to be difficult to read...

[edit] ...and I agree that it is possible to use syntax to confuse students.


Last edited on
LB wrote:
and people who use <= scare me even more.
1
2
3
for(T i = 0; i < end; ++i) process(i); //traditional
for(T i = 1; i < end+1; ++i) process(i-1); //error prone
for(T i = 1; i <= end; ++i) process(i-1); //error prone  


1
2
for(T i=N-1; i>=0; --i) process(i); //much easier to understand than:
for(T i=N-1; i>-1; --i) process(i); //or am I mistaken? 


My teacher told our whole class that without java you would not be able to use the internet (at all). Now I understand that many things might use java on the web, but you do not need java to access the web. And after about a 15 min argument and me uninstalling java from my pc and opening a browser and doing several other test in front of him: he still disagreed and I promptly sat down and told him I was wrong and apologised.
One of my engineering professors (with focus on computer science) admitted that he doesn't remember much of the math he learned in college. <_< >_>
So there is a chance one may never use math learned form school... *cough*
So there is a chance one may never use math learned form school... *cough*


IMHO 90% of the population do not use 95% of the maths they learnt in school.

My teacher told our whole class that without java you would not be able to use the internet (at all)


http://www.youtube.com/watch?v=E3418SeWZfQ


And after about a 15 min argument and me uninstalling java from my pc and opening a browser and doing several other test in front of him


And have you uninstalled Java from servers of Facebook, Google, Amazon, Apple, eBay or your bank website? Uninstalling it from your PC is not enough, IMHO. It's a virus. It's everywhere. ;)
Last edited on
@rapidcoder Firstly that video was hilarious :)
And have you uninstalled Java from servers of Facebook, Google, Amazon, Apple, eBay or your bank website?

Secondly, my point was not: "Java does nothing for the internet" it was "Java is not needed for the internet" i.e. if java was not invented (a sad thing) other languages could have done the same thing (yes, dev time, etc. would be altered). So do you agree or disagree with my point?
Script Coder wrote:
1
2
for(T i=N-1; i>=0; --i) process(i); //much easier to understand than:
for(T i=N-1; i>-1; --i) process(i); //or am I mistaken? 
T is an unsigned type. BAM! Your program explodes.
Last edited on
@Script Coder, of course I agree.
@LB: No, in theory it is allowed to explode, but in practice it never explodes. It tries to live forever.
Last edited on
That's what I meant by exploding...
My teacher told us Delphi would be the next C++. At that time Java was in its 0.xx state.
I was on a Turbo Pascal trip at that time and was glad to hear that Delphi is about to take over the world.
Then I started coding C/C++, now I'm glad he was wrong. Not that I don't like Delphi, but ... well ... it's not C.

I despise Java, but mainly for its library. To me it feels like it's made to give a lot of theoretical computer scientists a boner.

My two cents about the indexing thing: I never thought about starting with 1 until I had to work with ABAP (it's the language SAP uses for its "programs"). There you have "internal tables" that are like database views and start with index 1. But if you transfer data from an internal table to an array the first index is 0. It's an awful language.
The only reason I like Java is for it's library plexus, if it weren't for that I would never use Java except in rare cases when I needed JIT or the JVM for some strange reason.
T is an unsigned type. BAM! Your program explodes.

Did you not do the same thing?
http://www.cplusplus.com/forum/lounge/109472/#msg596397
I thought C++ was Bell Labs and Java was Sun Microsystems. Is you college charging you money?
closed account (jwkNwA7f)
@Manga I know Bell Labs was working on C++ at one time, at least, and Java is Sun Microsystems.
Script Coder wrote:
Did you not do the same thing?
http://www.cplusplus.com/forum/lounge/109472/#msg596397
I don't know what you mean, in my three examples it does not matter whether T is signed or unsigned. In your examples, if T is unsigned you have problems.
Last edited on
My point was that >= and <= have their place, or do you still disagree?
They have their place but it's definitely not when iterating every element of a container.
closed account (S6k9GNh0)
Bad programming professors are not uncommon. I took a C++ course and finished most of the assignments (using C++03 templates) and turned them in ahead of time. Well, I had to redo them because I was told it wasn't C++. Fine. Did them again, they were accepted, but some of them were lowly graded... looking back, the result, the math, the intended input were all correct... what happened? Well, I used functions where the lesson hadn't taught us that yet.

That and the test questions sometimes asked for a result of an equation that had undefined results, where undefined was not an answer. Some of the questions were actually WRONG (like really basic things too... like what int result = 0; would be after result = 3 + 4 * 2;. Answer is 11 (which was an option) but the correct answer on the test was 14.

This class single handedly demotivated me from continuing towards a career in computer science.

EDIT: And he wanted us to do assignments in Microsoft Word and turn in VC++ project files to him (which I couldn't do since I fucking used Linux but shouldn't matter anyways since C++ is a portable language).
Last edited on
I hope I don't have to deal with unreasonable professors.
Last edited on
Pages: 12345