4 ms·
I would partially agree with this even though Java is a great language. I can firmly recall in my CS 101 class where they were teaching basic programming using
by lindgrenj6 10y ago
I would partially agree with this even though Java is a great language.
I can firmly recall in my CS 101 class where they were teaching basic programming using Java, and the teacher seriously told us "just put static in all of your method declarations, don't worry about why yet otherwise you won't be able to use them in your main".
...didn't fully learn what static meant until over a year in my programming career.
- joshuata 10y agoIt was even worse starting in C++. Almost half the code in any project was opaque black magic. What is char and why do I need it? Why do I need `using namespace std`? Why do I need to create a Pair in order to insert into a Map?
- x1798DE 10y agoI don't think it's worse in C++. You can make purely imperative C-like programs in C++ with essentially no boilerplate (with the exception of maybe needing io from the standard library), and build things up as they go.
- btschaegg 10y agoWhile I still am a big fan of C++, I'd attest to the fact that is a worse language to teach beginners. Funnily enough, that's not so much because of the language, but because of its legacy. I learned programming with Borland Turbo Pascal and later Delphi and have to admit I struggled with the OOP mindset at first. The according chapters of the book I used were filled with contrived examples that left me saying "I can also do this the old way!". Apart from this, I found the book to be very well written, though. Then, I tried learning C++ (using a Book frome the same series) with Borland C++ Builder. Boy, was that a mistake. I didn't get around to understand why I had to keep using -> instead of . everywhere (before, I almost never used a pointer anywhere), the whole delete-dance was a nightmare and the Borland tooling was so filled with magical clicks that generated event handlers that I never understood how the whole thing really worked (you never got to see the whole code). Headers vs. .cpps was a similar disaster, and compiler errors could only be met with comparing your code with the example on a symbol by symbol basis[1]. So, while C++ is a nice language (far better than Java IMO), starting in it was a nightmare. The problem here is that you have to explain way too many concepts at the beginning (which still holds true even with C++17), and since APIs like the Borland GUI libraries or win32 are based on so much cruft and ages old crap, you'll never get to the point where a beginner can say "Look, I've drawn a circle!". Honestly, if you ask me, programming courses should best just start with a modern version of Python. But even then you'll have trouble setting up on Windows and getting over the whole UI frameworks disaster. [1]: This kills experimentation. That's the absolutely last thing you want to do if you're trying to teach a motivated kid how to program. Edit: Also note: Often, the mindset seems to be that "beginner" means someone at a university. In my opinion, that's a fallacy too. I started out when I was 11 - I'd never even had any decent english course in school back then. Think of that, and you'll start to see the flaws in starting out with some way too complicated concepts. We should get rid of the notion that a learner has to "push through" things (especially at the start!). It will be to the benefit of society.
- flukus 10y agoThe problem there seems to be that you were learning an IDE/Gui builder and c++ at the same time. I still think I language that exposes pointers directly (c, c++, others?) are far better than something like python. Pointers force you to understand memory, allocations, the heap and stack, etc. There are way too many professional programmers that don't understand them.
- btschaegg 10y agoThe problem there seems to be that you were learning an IDE/Gui builder and c++ at the same time. Even from a modern persective, I'd disagree with that. Yes, the IDE was a pain point, but it existed because the alternative is much worse. You don't want to start out explaining Makefiles to anyone (even if you start with VS you'll be spending an hour setting up instead of programming). Pointers force you to understand memory, allocations, the heap and stack, etc. Yeah, and we'll both agree that this is crucial knowledge for any professional programmer. But if you're starting out (we're talking first language here), it's in the way. You don't even know what a loop is yet. You're at least years away from professional. Also, not everyone who programs wants to become a software developer. Sysadmins don't need pointers, but a readable alternative to shell scripts is nice (I know such people, they exist). A journalist who wants to make a flashy chart on the internet doesn't need to know pointers. A biologist also doesn't - but (s)he can certainly benefit from programming. Have you seen what Jupyter can be used for? Edit: As a side note, I also see much value in starting with a more functional language than C++. Lexical scope really affects your thinking. If you can get to that at the end of the first course, you'll have taught something tremendously useful. I've been working at a local university of applied sciences until last year, and you really don't want to know how many students there struggle with a C++ lambda expression. Again, to reiterate: I'm a fan of C++. I still cringe at most other imperative languages. But I see its weaknesses (especially in teaching).
- flukus 10y ago> Also, not everyone who programs wants to become a software developer. Sysadmins don't need pointers, but a readable alternative to shell scripts is nice (I know such people, they exist). A journalist who wants to make a flashy chart on the internet doesn't need to know pointers. A biologist also doesn't - but (s)he can certainly benefit from programming. Have you seen what Jupyter can be used for? In context, this is about CS classes, while the others might do some programming they shouldn't need to do computer science. Also, although being easier, is jupyter doing anything not being done in emacs years ago? >You don't want to start out explaining Makefiles to anyone (even if you start with VS you'll be spending an hour setting up instead of programming) To anyone on the path of becoming a professional programmer, yes, it's worth a few minutes to write a trivial makefile. It's worth teaching how to compile from the command line and how to batch those commands with a DSL is really simple. Again, there are way to many programmers who have no idea what their IDE is doing, which really isn't that much. > Yeah, and we'll both agree that this is crucial knowledge for any professional programmer. But if you're starting out, it's in the way. You don't even know what a loop is yet. You're at least years away from professional. c/c++ don't force this straight away though, you can easily do for loops before you begin managing memory. In any language memory should be understood before arrays are.
- hackits 10y agoIt would of been better to start you with C then transitioned to C++ later on or skip it all together and go directly to java/ocamel/haskell then come back to C++ at a later date.
- alexbanks 10y agoIn my CS101 class I asked what the "public static void main(String[] args)" meant at the beginning of the java code we kept getting and got the response: "It's some magic, don't worry about it."
- kevhito 10y agoWell then your instructor was doing it wrong, and that's a shame. I teach this course regularly, in Java (and previously in C++). Week 1: "it's just some magic, don't worry about it" Week 2: arrays are a thing, hey look, args is an array of strings! Week 3: functions are a thing, hey look, "void" is the return type, args is the parameter! Week 8: objects are a thing, hey look, static mean's it's not a member of an object Week 9: software engineering is a thing, hey look, public is an access modifier
- unexistance 10y agothanks for the much-needed perspective
- btschaegg 10y agoBut that's already the problem: You start by ignoring instead of explaining things. If you start with print("Hello world!") you can already start explaining your subjects everything they've just written and build from there. So, you'll get around faster to teaching the mindset of programming instead of explaining access modifiers. Those are not needed for that. Also, if you would start an explanation of anything new to me now with "oh, that's magic, just ignore it.", I still would walk away from your course if you can't explain that within a week.
- alexbanks 10y agoI think you're being a little bit aggressive about the when's and the how's. I think there's nothing wrong with saying "Don't worry about that until next week, we'll be discussing that in another lecture" as long as it does in fact get explained. I don't think the statement should be "it's magic, ignore it," ever. At most universities I've seen, CS101 assumes no programming experience, so if you want to show a real Java code block there's going to be a lot of stuff a student's never seen before. I also think this is why languages with REPLs and relatively few syntax modifiers (like Python) are good for intro courses. You can fire up a REPL and type `print "Hello World"` and it'll do just that. The students don't have to see any "don't worry about it" type stuff. edit We may have been agreeing about the "print Hello World" part and the Python part. The problem is that some universities (like my Alma Mater) had the hard requirement of all CS and IT students started with Java.