As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
We're funding a new Acquisitions Incorporated series on Kickstarter right now! Check it out at https://www.kickstarter.com/projects/pennyarcade/acquisitions-incorporated-the-series-2

[Programming] Thread: Turning off the LAMP stack for mood lighting

17677798182100

Posts

  • KambingKambing Registered User regular
    bowen wrote: »
    How can you teach Java but not objects?

    Like wut.

    In the context of an introductory computer science class, "objects late" refers to the focus on procedural programming (i.e., programming in the small with functions). Because Java is an object-oriented language, you can't escape objects entirely. The compromise is that you introduce the use of objects, e.g., instantiating objects, calling methods on them, to be able to get real work done, and you defer the design of classes and the underlying mechanics of object-oriented programming, dynamic dispatch and inheritance, until later.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • bowenbowen How you doin'? Registered User regular
    GnomeTank wrote: »
    Infidel wrote: »
    GnomeTank wrote: »
    admanb wrote: »
    Jimmy King wrote: »
    Wheee! We will suffer together writing stupid Java nonsense!

    My CS class this semster is all Java. At least it should be easy.
    Introduces algorithm and problem-solving methods. Emphasizes structured programming concepts, elementary data structures, and the study and use of a high-level programming language.

    I don't even understand why Java is used here... it doesn't touch OO. OO is introduced in the next class. Using Java without teaching OO seems rather silly and adds a lot of complexity that you have to just tell students "Uh, just type this. Trust me. It's what you type.".

    It's used because they're terrified that trying to teach students a second language will cause half the class to drop.

    Good, it should. If you can't handle multiple languages, you shouldn't get a CS degree.

    Yeah, except a class with low enrollment gets cancelled, and an even more dumbed down course takes its place, and the dunces still go through their degree coming out even worse.

    No, you wash those people out. A degree is not a right, it's a privilege. If you can't hang with the curriculum, what makes you think you're going to hang in the real world where performance is demanded? If something as simple as the syntax changing completely throws you out of your comfort zone and you forget your basics, this is probably not the career for you to begin with.

    We have too many people coming out of school completely coddled and unprepared to handle real development jobs. Holding their hand and only teach Java because you might cause some wash out is not helping.

    And plus, all our wages go up because we're basically powerful sorcerors instead of Wizards.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    Kambing wrote: »
    bowen wrote: »
    How can you teach Java but not objects?

    Like wut.

    In the context of an introductory computer science class, "objects late" refers to the focus on procedural programming (i.e., programming in the small with functions). Because Java is an object-oriented language, you can't escape objects entirely. The compromise is that you introduce the use of objects, e.g., instantiating objects, calling methods on them, to be able to get real work done, and you defer the design of classes and the underlying mechanics of object-oriented programming, dynamic dispatch and inheritance, until later.

    You'd be WAY better off introducing C\C++ and never introducing malloc&free/new&delete.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
    Nightslyr
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    I don't think you could write heapless C++ that did anything useful

    The Anonymous
  • KambingKambing Registered User regular
    bowen wrote: »
    Kambing wrote: »
    bowen wrote: »
    How can you teach Java but not objects?

    Like wut.

    In the context of an introductory computer science class, "objects late" refers to the focus on procedural programming (i.e., programming in the small with functions). Because Java is an object-oriented language, you can't escape objects entirely. The compromise is that you introduce the use of objects, e.g., instantiating objects, calling methods on them, to be able to get real work done, and you defer the design of classes and the underlying mechanics of object-oriented programming, dynamic dispatch and inheritance, until later.

    You'd be WAY better off introducing C\C++ and never introducing malloc&free/new&delete.

    Not really for a few reasons:

    (1) C/C++ have relatively limited library support compared to Java. To do interesting assignments, you (the instructor) will need to put in substantially more effort to build up libraries, in particular, graphics and GUI libraries, to support later assignments.
    (2) Pedagogically, it is very difficult to avoid the discussion of heap allocation and pointer manipulation for the entire course. When you do eventually need to discuss it, you will need to spend a substantial amount of time discussing it in detail. Likely, your goals for the course will not include these low-level details.
    (3) C++ in particular is a bad choice. You can't really write "good" C++ code (object-oriented, memory safe) without a mature understanding of OOP and the underlying runtime. I've seen it time and time again where universities teach "C+" that leaves students with a very incorrect understanding of how to effectively work with C++ and why they would use it in the first place over C.

    That being said, every introductory course has intrinsic learning goals as well as extrinsic goals that motivate what language you choose. For example, if your curriculum is heavily C-based, then it might make sense to suffer through the bumps associated with C to get people acclimated to the language.

    This does touch upon a critical idea of being true to the language that you are teaching, and frankly, there are no languages that are scaled appropriately to an introductory student of computer science at a university/college. My personal opinion is that object-oriented programming is a difficult design-focused concept that requires intellectual maturity to grok fully. Objects late is a compromise that allows us to use mainstream languages but still crack the programming egg in a way that is digestible to more people.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
    Jasconius
  • DelmainDelmain Registered User regular
    For the record, the very first programming class you have to take in my university's programming track is Intro to Programming with C, where you go over basic control structures as well as memory management with malloc and free.

    It's literally the first class you have to take.

    mightyjongyo
  • DehumanizedDehumanized Registered User regular
    Python works pretty good at an introductory level

    Lt Muffin360DisruptedCapitalist
  • KambingKambing Registered User regular
    edited August 2013
    Delmain wrote: »
    For the record, the very first programming class you have to take in my university's programming track is Intro to Programming with C, where you go over basic control structures as well as memory management with malloc and free.

    It's literally the first class you have to take.

    Yeah. I know several universities that do it, and it is fine. It entirely depends on the goals of the class, the context the class is being taught in, and what is done to address the shortcomings of the language. In contrast, an intro course that must service a large number of non-majors in computer science may not be served as well by using C as they would with a higher-level language like Python.
    Python works pretty good at an introductory level

    It does. The last intro course I taught was done in Python. Python works well with an objects-late approach because thanks to Python's expansive library and higher-level programming abstractions, you can do a lot without needing to talk about object-oriented design. The downside (in my view) is that Python's class model coupled with its dynamic type system does not lend itself to easily talk about things you want to with object-oriented design, namely reasoning about objects via the interfaces they present.

    I would have preferred it if Python employed the prototype model of OOP that Javascript embraces as it is a more natural fit for a dynamically-typed language. But alas, no language gets it right. >_<

    Kambing on
    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • Jimmy KingJimmy King Registered User regular
    I think Java is pretty terrible for a first language where just basic programming stuff is being taught. There is so much boilerplate, unintuitive, verbose crap that you just can't get around and have to just tell students "just type this because I said so." I suspect it adds to the issues (although is not a sole reason or likely even major reason) with people getting too focused on language and syntax rather than understanding the concepts. They're dropped right into a situation where the only way to succeed is to just memorize a bunch of syntax that they don't actually understand as their first experience with CS and programming.

    Ideally, based on my own learning style and no research at all other than just talking to/working with people, I'd like to see school's start off their first CS class using something that can be used mostly procedurally. Ideally a 100% procedural (as in not OO and not functional), strongly typed, language which students might actually see in the wild being used on notable projects. Realistically I don't know that such a language exists other than C, but that has so much difficult/confusing stuff for beginners that while many of us did have it has one of our first languages, I wouldn't say it's a good choice anymore. I think Python or Ruby or even maybe Groovy or Scala are good realistic choices since they can hide most of the OO from you so that you don't have to worry about what a class is and why you're defining a class and a method and public and privates and blah blah. Basically something simple, with minimal boilerplate that a student has to just memorize as magic, which allows them to make a program that does "something" to pique their interest as early as possible and can be seen being used on serious, popular projects so that the students feel like they are learning a useful language/set of libraries while they're at it.

    Then after that, if there are particular languages that suit what is being taught in the class, use one of those. Again, don't use Java for a class teaching about linked lists and whatnot because a reference to an object is "close enough" as we have previously discussed some schools currently doing. Use something that makes sense, like C, so that they actually have to think about and learn about the memory allocation. Have a class where some assembly is written so that students understand what is going on down lower level than their C code.

    I also think every CS program should have 1 or 2 required classes which are purely about introducing students to different programming languages and styles.

    bowen
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    I find myself agreeing with Kambing here

    Though I did not personally learn Java in school, I learned a languages that were very similar early in my career that, in the context of beginner-ism, were similar enough, C# and ActionScript 3

    C++ has no business in introductory programming courses

    C is fine but Java is just plain easier, and as he said you can get farther with less effort which is important if you are dealing with true novices

    cranking on C files to make a command line tool is boring with a capital B. at least with Java you can put something in a window


    I've been programming for over almost ten years and I still don't feel like I know enough about C++ to comprehensively write an object oriented program with breaking major rules, because C++ is as much about understanding C++ as it is about understanding program design, where as in Java the runtime basically takes care of you soup to nuts

    C++ is a war crime of a language to be used only in the hands of they who are knowledgeable

    one must walk before they can learn to run

  • bowenbowen How you doin'? Registered User regular
    edited August 2013
    Jasconius wrote: »
    I find myself agreeing with Kambing here

    Though I did not personally learn Java in school, I learned a languages that were very similar early in my career that, in the context of beginner-ism, were similar enough, C# and ActionScript 3

    C++ has no business in introductory programming courses

    C is fine but Java is just plain easier, and as he said you can get farther with less effort which is important if you are dealing with true novices

    cranking on C files to make a command line tool is boring with a capital B. at least with Java you can put something in a window


    I've been programming for over almost ten years and I still don't feel like I know enough about C++ to comprehensively write an object oriented program with breaking major rules, because C++ is as much about understanding C++ as it is about understanding program design, where as in Java the runtime basically takes care of you soup to nuts

    C++ is a war crime of a language to be used only in the hands of they who are knowledgeable

    one must walk before they can learn to run

    I can't take anything you ever say seriously anymore.

    You don't need UI programming to do show what's in a text file. You're confusing what I'm saying though. Also, "put something in a window." :rotate: ever used Java? That's harder than it is in C++ with fucking MFC sometimes.

    When I say you should have a focus in C++ before switching to objectless java for teaching, it means, "Teach how to program and then, once they know how to program, teach Java"

    Because in order to teach Java, you really have to understand objects, classes, and references from the get go. There's no getting around it because you're lazy. People will get ultramegafucking confusing because there's objects everywhere and you'll have to unlearn shit before you relearn it because they'll go, "Oh don't worry about that, it's not important"

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    You know what I wish they taught in college?

    How to use source control. The number of new hires I've worked with that saw svn and git as some sort of magic tool that they never used before was astounding.

    At a minimum being able to set up a repo, branch, merge and do mergebacks should be required knowledge.

    EchobowenSporkAndrewDelmainDisruptedCapitalistDiannaoChongThe Anonymousan_alt
  • bowenbowen How you doin'? Registered User regular
    I wish they taught source control and network code, and touched on how to transfer data between programs a bit better than "lolstaticfileisallyouneed!"

    Ultimately I think problem is people are biased because "fuck C++"

    Anyone who choses C is crazy as fuck though. I expect someone who's in touch with their inner Torvalds.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • EtheaEthea Registered User regular
    I was never taught source control explicitly in class.

    I can see how git / hg would be easier to teach compared to cvs / svn since you wouldn't need a lab + svn / cvs internal server. Hg / Git would actually be great things to use as a way to submit your submissions for projects.

    bowenJimmy Kingmightyjongyo
  • bowenbowen How you doin'? Registered User regular
    Agree, no reason they can't teach Hg/Git now. The overhead is tinnnnnnnnny.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • EchoEcho ski-bap ba-dapModerator mod
    Yeah, just the basics of commits/branches/pushing/pulling/rollbacks should be really quick.

    DiannaoChong
  • SageinaRageSageinaRage Registered User regular
    Java's much easier for a novice than C, there's some OO concepts you have to get in java and learn some of the keywords before you can get started, but that's just a couple days work, especially if you only actually work with one object at a time. Once you're past that hump, java is a much smoother ride. I think the time getting over that hump is smaller than all the time a novice will spend hunting malloc errors in C and being confused by the error messages.

    My first couple CS classes went scheme (smalltalk variant) -> java -> C (compiler design class)

    sig.gif
  • bowenbowen How you doin'? Registered User regular
    Java's much easier for a novice than C, there's some OO concepts you have to get in java and learn some of the keywords before you can get started, but that's just a couple days work, especially if you only actually work with one object at a time. Once you're past that hump, java is a much smoother ride. I think the time getting over that hump is smaller than all the time a novice will spend hunting malloc errors in C and being confused by the error messages.

    My first couple CS classes went scheme (smalltalk variant) -> java -> C (compiler design class)

    Yeah C is a terrible choice unless you're teaching memory. New beats malloc any day.

    Introduction to objects really works better with C++ than Java. Java only really makes sense once you understand what OOP is all about.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    I dunno, I think if you have a good teacher then C is fine. I started with C in middle school over a 6 week summer course and I don't think we really touched on malloc etc - just static arrays all the time. I still feel like I came out with a good foundation of core concepts and didn't have too many problems.

    Then again that is very different from a college level course so the expectation is different as well. But I think as an intro C can work fine; that said today there are better options than ten years ago.

  • urahonkyurahonky Registered User regular
    Yeah I learned a lot about C++ before even delving into other languages... But that was because my High School offered a Computer Programming class and the instructor only knew C++.

  • bowenbowen How you doin'? Registered User regular
    I dunno, I think if you have a good teacher then C is fine. I started with C in middle school over a 6 week summer course and I don't think we really touched on malloc etc - just static arrays all the time. I still feel like I came out with a good foundation of core concepts and didn't have too many problems.

    Then again that is very different from a college level course so the expectation is different as well. But I think as an intro C can work fine; that said today there are better options than ten years ago.

    Like I said, you could do the same thing with C++ without new/delete as you can with C without malloc/free.

    C++ gives you the ability to introduce OOP (even still without needing the heap), and then expand it with something like Java.

    I agree with phyphor, you can't really do much useful without the heap, but it's great for teaching concepts.

    Then with java, you can get into using libraries and reading files and all that.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • urahonkyurahonky Registered User regular
    At that point, though, why even show them C++? Go into Java without talking about heap space and stuff like that and ease them into File IO and stuff. To me: Java is a lot easier to understand than C++.

  • gjaustingjaustin Registered User regular
    Since I asked really nicely, they let me take both the Intro to Java and the Advanced Programming class (which was in Java) at the same time. That actually worked fairly well for me, since it meant I was getting theory and syntax simultaneously.

    I saw a lot of people in my Intro to Java class struggling though. That said, I'm pretty sure that's more about when I went to college than the class itself. This was in 2000, so the dotcom boom was in full swing. So EVERYONE was in Computer Science. I think only EE came close to our size in the Engineering college.

  • urahonkyurahonky Registered User regular
    And I don't believe that colleges are scared to scare away programmers. If that were the case the Math department at my university wouldn't be absolute, 100% dog shit on a hot brick. Calc 1 was used to filter out all the people, and then the rest were there to punish you every moment of your miserable existence.

  • RendRend Registered User regular
    There is a theory which is gaining a pretty good amount of traction in education which basically states that you should start with something pretty hard, and work your way down from that. For instance, when learning arithmetic, you might start with division, then learn multiplication, subtraction, and addition. It's counter-intuitive, not only because you think "you should ease into stuff" but also because you think "you need this first thing to understand this second thing"

    However, when appropriately executed, it has pretty good results.

    Learning C++ first is a little bit like starting to learn arithmetic with division. Yes, it's the hardest. Yes, it's the most dangerous. Yes, there are some really arcane parts of the language due to C. However, not only is it an incredibly useful language to learn from a skillset point of view, but it also has within it almost every capability you'll need to know for other modern languages.

  • urahonkyurahonky Registered User regular
    Yeah I can buy that.

  • bowenbowen How you doin'? Registered User regular
    urahonky wrote: »
    At that point, though, why even show them C++? Go into Java without talking about heap space and stuff like that and ease them into File IO and stuff. To me: Java is a lot easier to understand than C++.

    lol.

    Write me a hello world in Java vs C++ and tell me why Java is easier to understand. You're going to make tradeoffs, but Java relies heavily on an understanding of scope and OOP almost from the get go, since everything's an object.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • gjaustingjaustin Registered User regular
    Rend wrote: »
    There is a theory which is gaining a pretty good amount of traction in education which basically states that you should start with something pretty hard, and work your way down from that. For instance, when learning arithmetic, you might start with division, then learn multiplication, subtraction, and addition. It's counter-intuitive, not only because you think "you should ease into stuff" but also because you think "you need this first thing to understand this second thing"

    However, when appropriately executed, it has pretty good results.

    Learning C++ first is a little bit like starting to learn arithmetic with division. Yes, it's the hardest. Yes, it's the most dangerous. Yes, there are some really arcane parts of the language due to C. However, not only is it an incredibly useful language to learn from a skillset point of view, but it also has within it almost every capability you'll need to know for other modern languages.

    Hmm, I don't think I buy that. At least not in that arithmetic example. Addition is pretty fundamental to understanding multiplication. I will agree that avoiding negative numbers and fractions is likely counter-productive.

    I remember a conversation like this on the bus in elementary school. With dramatic license :)
    I like math! Multiplication is fun!
    Older kid wrote:
    You're dumb, I bet you don't even know what 3 divided by 2 is
    one and a half
    Older kid wrote:
    Haha, dummy! It's 1 remainder 1!
    O_o

  • RendRend Registered User regular
    gjaustin wrote: »
    Hmm, I don't think I buy that. At least not in that arithmetic example. Addition is pretty fundamental to understanding multiplication. I will agree that avoiding negative numbers and fractions is likely counter-productive.

    The example I stated was directly from the study, so, it was not my paraphrased example. Take from that what you will.

    Remember that the whole point of this idea is that when you encounter an idea more simple than the one you have already learned, you intuitively think to yourself "oh, so it's kind of like this but easier then?"

  • DelmainDelmain Registered User regular
    gjaustin wrote: »
    Rend wrote: »
    There is a theory which is gaining a pretty good amount of traction in education which basically states that you should start with something pretty hard, and work your way down from that. For instance, when learning arithmetic, you might start with division, then learn multiplication, subtraction, and addition. It's counter-intuitive, not only because you think "you should ease into stuff" but also because you think "you need this first thing to understand this second thing"

    However, when appropriately executed, it has pretty good results.

    Learning C++ first is a little bit like starting to learn arithmetic with division. Yes, it's the hardest. Yes, it's the most dangerous. Yes, there are some really arcane parts of the language due to C. However, not only is it an incredibly useful language to learn from a skillset point of view, but it also has within it almost every capability you'll need to know for other modern languages.

    Hmm, I don't think I buy that. At least not in that arithmetic example. Addition is pretty fundamental to understanding multiplication. I will agree that avoiding negative numbers and fractions is likely counter-productive.

    I remember a conversation like this on the bus in elementary school. With dramatic license :)
    I like math! Multiplication is fun!
    Older kid wrote:
    You're dumb, I bet you don't even know what 3 divided by 2 is
    one and a half
    Older kid wrote:
    Haha, dummy! It's 1 remainder 1!
    O_o

    O_o was basically me until I got to high school. I went to a math magnet for high school and that's what it took for teachers to stop acting dumb about things you learn in the next year up.

  • urahonkyurahonky Registered User regular
    bowen wrote: »
    urahonky wrote: »
    At that point, though, why even show them C++? Go into Java without talking about heap space and stuff like that and ease them into File IO and stuff. To me: Java is a lot easier to understand than C++.

    lol.

    Write me a hello world in Java vs C++ and tell me why Java is easier to understand. You're going to make tradeoffs, but Java relies heavily on an understanding of scope and OOP almost from the get go, since everything's an object.

    You mean by making a simple public static void main(String args[]) class with a System.out.println()?

  • urahonkyurahonky Registered User regular
    prints in C++ were very confusing to me (now, granted, there are probably updates since I've used it) because you had to do %s, and stuff to print out what you needed to do.

    Java is just "System.out.println("Hello, world!");" and then you can tell that it prints a line in the console that says "Hello, world!"

  • RendRend Registered User regular
    urahonky wrote: »
    prints in C++ were very confusing to me (now, granted, there are probably updates since I've used it) because you had to do %s, and stuff to print out what you needed to do.

    Java is just "System.out.println("Hello, world!");" and then you can tell that it prints a line in the console that says "Hello, world!"

    so, your C++ hello world was not

    cout << "Hello World!";

    ...?

    urahonkyDelmainbowenmightyjongyoTofystedethThe Anonymous
  • urahonkyurahonky Registered User regular
    I'm not claiming Java is superior to C++ in any way, other than readability. And if you're going to be a programmer you'll have to used to things being different and not simple. I'm just saying that to me it was much easier to understand WHAT was going on in sample Java code over C++ code.

    an_alt
  • DehumanizedDehumanized Registered User regular
    There's so many good, freely available, easy to setup source control providers right now that it's be just fantastic if colleges took the time to incorporate a few of them into a day or two of lectures. Spend a little bit of time discussing the philosophical differences between centralized vs. distributed, show them the basics of a couple different systems using the better implementations as examples (Git, TFService, etc.) and finally tell them that if their source for future assignments is not version controlled that's a knifin'.

  • urahonkyurahonky Registered User regular
    Yeah... Oh man nostalgia... couts and cins... God I miss that stuff.

  • urahonkyurahonky Registered User regular
    C++ was infinitely easier at taking user input though. Why is it so easy in C++ and not in Java?

  • RendRend Registered User regular
    urahonky wrote: »
    C++ was infinitely easier at taking user input though. Why is it so easy in C++ and not in Java?

    Probably because of the JVM abstraction layer, if I had to guess. I have lamented the very same thing though.

  • urahonkyurahonky Registered User regular
    I seem to remember skipping the Java class on "user input" because I figured it would be a joke.

    Holy shit was I wrong.

  • DelmainDelmain Registered User regular
    It is a joke. You use Scanner.

    Assuming you mean like, accepting simple input at a command line.

    Anything else is fuck awful.

This discussion has been closed.