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/

SELECT * FROM posts WHERE tid = 'PA PROGRAMMING THREAD'

16768707273100

Posts

  • Joe KJoe K Registered User regular
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    so you ARE that professor (ノಠ益ಠ)ノ彡┻━┻

    i'll take a look at your mats. should be fun. is this for ee's or for general sci?

  • KambingKambing Registered User regular
    Joe K wrote: »
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    so you ARE that professor (ノಠ益ಠ)ノ彡┻━┻

    i'll take a look at your mats. should be fun. is this for ee's or for general sci?

    Yup. General computer science. I assume you already know this stuff Joe, so you don't need to take a look at it. This is more for people that are interested in learning how to program and want some help.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • EvigilantEvigilant VARegistered User regular
    edited April 2012
    So I did what bowen suggested, got rid of two sockets and instead just using one and using that for my two streams, ObjectInputStream and ObjectOutputStream. Then in my service fetcher, I'm doing:
    	@Override
    	public void run(){
    		if(command == 2)
    			try {
    				SessionTest.sw.sendMessage("SF> Initialize New Account Module");
    			} catch (IOException e2) {
    				e2.printStackTrace();
    			}
    		else if(command == 3){
    			try{
                                    AdminManagement AM = new AdminManagement(connection);
    
    				String javaHome = System.getProperty("java.home");
    				String javaBin = javaHome + File.separator + "bin" + File.separator + "java";
    				String classpath = System.getProperty("java.class.path");
    				String className = AdminManagement.class.getCanonicalName();
    				
    				ProcessBuilder builder = new ProcessBuilder(javaBin, "-cp", classpath, className);
    				Process proc = builder.start();
    				//error messages
    				StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "%ERROR%");
    				//Output
    				StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT> ");
    				
    				//initiate
    				errorGobbler.start();
    				outputGobbler.start();
    				
    				//any errors
    				int exitVal = proc.waitFor();
    				System.out.println("ExitValue: "+exitVal);
    			}catch(Throwable t){
    				t.printStackTrace();
    			}
    		}		
    		else if(command == 4)
    			try {
    				SessionTest.sw.sendMessage("SF> Initializing request for Transaction Log");
    			} catch (IOException e) {
    				e.printStackTrace();
    			}
    	}
    	class StreamGobbler extends Thread{
    		InputStream is;
    		String type;
    		
    		StreamGobbler(InputStream is, String type){
    			this.is = is;
    			this.type = type;
    		}
    		
    		public void run(){
    			try{
    				InputStreamReader isr = new InputStreamReader(is);
    				BufferedReader br = new BufferedReader(isr);
    				String line = null;
    				while((line = br.readLine()) != null){
    					SessionTest.sw.sendMessage(line);
    				}
    			}catch(IOException ioe){
    				ioe.printStackTrace();
    			}
    		}
    	}//end StreamGobbler
    
    to go and execute the class the client is requesting for. At AdminManagement AM = new AdminManagement(connection), I'm passing the socket being used by the client -> server to this module. So far this setup is working for printing out to the client's screen.

    The flow of the program:
    Client -> Server -> Service Fetcher -> Service
    Client connects via socket to server. Client picks service to run, server takes client's request and sends to Service Fetcher to go fetch that service. Service loads and takes client input then closes, leaving Client back at Server choosing which service to run.

    But now I'm having trouble taking input from the client and using it in admin management. I had a Scanner object that would catch the input and do something with it, but when StreamGobbler comes to that line it passes me a null pointer object. I tried doing,
    ObjectInputStream input = new ObjectInputStream(connection.getInputStream());
    String temp = input.readUTF();
    command = Integer.parseInt(temp);
    

    where connection is that socket passed from the Service Fetcher, but that gives me a StreamCorruptedException: invalid stream header: 00017400 . Which looking up, means that the inputstream isn't accepting a new header but gets one. Anyone know how I might fix this?

    Evigilant on
    XBL\PSN\Steam\Origin: Evigilant
  • seabassseabass Doctor MassachusettsRegistered User regular
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    Why aren't you teaching your intro course in Scheme, seeing as you're a big fan of the functional programming. University mandating the language to you?

    Run you pigeons, it's Robert Frost!
  • urahonkyurahonky Registered User regular
    Anyone have a good example of a good "About" screen? My partner and I can't really come up with anything for our current project.

  • KambingKambing Registered User regular
    seabass wrote: »
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    Why aren't you teaching your intro course in Scheme, seeing as you're a big fan of the functional programming. University mandating the language to you?

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • seabassseabass Doctor MassachusettsRegistered User regular
    edited April 2012
    Kambing wrote: »
    seabass wrote: »
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    Why aren't you teaching your intro course in Scheme, seeing as you're a big fan of the functional programming. University mandating the language to you?

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    Almost all functional languages let you mix paradigms though, it seems like purely function is the exception, not the rule.

    The difficulty with python is that you're going to have students that already know some of it. That's always been the thing I found the hardest with intro courses, how do you keep from boring the people that know some of the material to tears without losing the ones for whom it is truly new material? Picking some esoteric language is a pretty easy way around it, if not a particularly satisfying one.
    urahonky wrote: »
    Anyone have a good example of a good "About" screen? My partner and I can't really come up with anything for our current project.

    I'd just look at some programs you like using, and go from that. You really just need a version number, some contact / help urls, and maybe a publish date.

    seabass on
    Run you pigeons, it's Robert Frost!
  • bowenbowen How you doin'? Registered User regular
    edited April 2012
    PublicVersionNumberHelpAboutScreenGoodSSW.JPG

    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
  • KambingKambing Registered User regular
    edited April 2012
    seabass wrote: »
    Kambing wrote: »
    seabass wrote: »
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    Why aren't you teaching your intro course in Scheme, seeing as you're a big fan of the functional programming. University mandating the language to you?

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    Almost all functional languages let you mix paradigms though, it seems like purely function is the exception, not the rule.

    The difficulty with python is that you're going to have students that already know some of it. That's always been the thing I found the hardest with intro courses, how do you keep from boring the people that know some of the material to tears without losing the ones for whom it is truly new material? Picking some esoteric language is a pretty easy way around it, if not a particularly satisfying one.

    Not sure what you're getting at with the "purely functional is the exception" comment. Virtually any functional language offers mutation directly via reference types or monads or indirectly via closure encodings. So in that sense, there's paradigm mixing. But there's a difference between what a language allows and what is expected of its programmers, and with most functional languages, the expectation is to only resort to mutation when necessary.

    What you described is currently a difficulty of any introductory CS course, regardless of the language taught, because CS education is not standardized at the HS-and-below level (which is another important movement all on its own). The critical thing that I've found doing this is that the "know-it-alls" at this level actually don't know much more their peers. The problem then becomes people management where you engage those students separately with level-appropriate content while ensuring that their attitude doesn't poison/scare off the rest of the class.

    Kambing on
    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • DrunkMcDrunkMc Registered User regular
    urahonky wrote: »
    Anyone have a good example of a good "About" screen? My partner and I can't really come up with anything for our current project.

    If you wanna get fancy open Eclipse and check out their About. Not only does it give you the about for the base program, all the major plugins have a button you can press to get their about.

  • seabassseabass Doctor MassachusettsRegistered User regular
    edited April 2012
    Kambing wrote: »
    seabass wrote: »
    Kambing wrote: »
    seabass wrote: »
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    Why aren't you teaching your intro course in Scheme, seeing as you're a big fan of the functional programming. University mandating the language to you?

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    Almost all functional languages let you mix paradigms though, it seems like purely function is the exception, not the rule.

    The difficulty with python is that you're going to have students that already know some of it. That's always been the thing I found the hardest with intro courses, how do you keep from boring the people that know some of the material to tears without losing the ones for whom it is truly new material? Picking some esoteric language is a pretty easy way around it, if not a particularly satisfying one.

    Not sure what you're getting at with the "purely functional is the exception" comment. Virtually any functional language offers mutation directly via reference types or monads or indirectly via closure encodings. So in that sense, there's paradigm mixing. But there's a difference between what a language allows and what is expected of its programmers, and with most functional languages, the expectation is to only resort to mutation when necessary.

    What you described is currently a difficulty of any introductory CS course, regardless of the language taught, because CS education is not standardized at the HS-and-below level (which is another important movement all on its own). The critical thing that I've found doing this is that the "know-it-alls" at this level actually don't know much more their peers. The problem then becomes people management where you engage those students separately with level-appropriate content while ensuring that their attitude doesn't poison/scare off the rest of the class.

    I thought your point was that python mixed imperative approaches and functional approaches better than most languages, but re-reading it, I don't think that was exactly your point. I do agree that it's as good an introductory language as any. We used to use C here, but we switched over to Java a couple of year ago. I'm not sure if it's the language or the courses, but the intro sequence is decidedly worse off for it.

    God, typos everywhere. Need more coffee.

    seabass on
    Run you pigeons, it's Robert Frost!
  • Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    seabass wrote: »
    Kambing wrote: »
    seabass wrote: »
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    Why aren't you teaching your intro course in Scheme, seeing as you're a big fan of the functional programming. University mandating the language to you?

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    Almost all functional languages let you mix paradigms though, it seems like purely function is the exception, not the rule.

    The difficulty with python is that you're going to have students that already know some of it. That's always been the thing I found the hardest with intro courses, how do you keep from boring the people that know some of the material to tears without losing the ones for whom it is truly new material? Picking some esoteric language is a pretty easy way around it, if not a particularly satisfying one.

    On the programming exercises you set you have stretch goals beyond the core marked assesment, that way the ones who know stuff get to show off their mad skills.

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
  • KambingKambing Registered User regular
    seabass wrote: »
    Kambing wrote: »
    seabass wrote: »
    Kambing wrote: »
    seabass wrote: »
    Kambing wrote: »
    Joe K wrote: »
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

    Every task can be done functionally though. ^_^

    (And for the record, my intro cs class this summer is using python. I'm still developing the class, but if people that are learning about programming/cs are interested in previewing materials, let me know.)

    Why aren't you teaching your intro course in Scheme, seeing as you're a big fan of the functional programming. University mandating the language to you?

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    Almost all functional languages let you mix paradigms though, it seems like purely function is the exception, not the rule.

    The difficulty with python is that you're going to have students that already know some of it. That's always been the thing I found the hardest with intro courses, how do you keep from boring the people that know some of the material to tears without losing the ones for whom it is truly new material? Picking some esoteric language is a pretty easy way around it, if not a particularly satisfying one.

    Not sure what you're getting at with the "purely functional is the exception" comment. Virtually any functional language offers mutation directly via reference types or monads or indirectly via closure encodings. So in that sense, there's paradigm mixing. But there's a difference between what a language allows and what is expected of its programmers, and with most functional languages, the expectation is to only resort to mutation when necessary.

    What you described is currently a difficulty of any introductory CS course, regardless of the language taught, because CS education is not standardized at the HS-and-below level (which is another important movement all on its own). The critical thing that I've found doing this is that the "know-it-alls" at this level actually don't know much more their peers. The problem then becomes people management where you engage those students separately with level-appropriate content while ensuring that their attitude doesn't poison/scare off the rest of the class.

    I thought your point was that python mixed imperative approaches and function approaches better than most languages, but re-reading it, I don't think that was exactly your point. I do agree that it's as good an introductory language as any. We used to use C here, but we switched over to Java a couple of year ago. I'm not sure if it's the language or the courses, but the intro sequence is decidedly worse off for it.

    Nah. Python mixes them to the same level that C# does with list comprehensions and map. So in that sense, I don't think there's really any interesting mixing that occurs. Really the difference is embracing immutability which neither of those languages does. Scala does a better job of it, but I ultimately don't like it because precisely because it offers two worlds without clear guidance on which to use and when.

    With respect to Java and C, it's partially the language and partially what comes out in the course as a result. Java is crufty as hell, but you can work around that, and I did in my Fall intro course. But in general there's a tendency with Java and an objects-first curriculum to shield the students away from problem solving and design in favor of producing "glitzy" programs where the student just fills in a small part of some program skeleton. The problem is that the problem solving and design are (1) precisely the interesting part of programming and (2) the core of computer science, so they fail in both aspects. When you start tuning your content towards that goal, you find the languages become less relevant as you can address these fundamental concerns in any of them.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • centraldogmacentraldogma Registered User regular
    I read an article recently about the way people learn how to program.
    Basically, there a subset of people who are simply incapable of learning to program regardless of languages or techniques used.
    Formal logical proofs, and therefore programs (formal logical proofs that particular computations are possible, expressed in a formal system called a programming language) are utterly meaningless. To write a computer program you have to come to terms with this, to accept that whatever you might want the program to mean, the machine will blindly follow its meaningless rules and come to some meaningless conclusion. In the test the consistent group showed a pre-acceptance of this fact: they are capable of seeing mathematical calculation problems in terms of rules, and can follow those rules wheresoever they may lead. The inconsistent group, on the other hand, looks for meaning where it is not. The blank group knows that it is looking at meaninglessness, and refuses to deal with it.

    When people unite together, they become stronger than the sum of their parts.
    Don't assume bad intentions over neglect and misunderstanding.
  • Joe KJoe K Registered User regular
    Kambing wrote: »

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    It's funny, MIT's Intro to CS Serious course is still done in LISP i think.

    It is nice that functional thinking has come to the forefront recently, personally, i think that it's due to JQuery of all things, but syntacitical sugar for anoymous functions in python, c#, scala and others exposed a lot of people to the style. it's a good thing, because shifting away from this obsessive compulsive disorder about OOP is way overdue.

  • urahonkyurahonky Registered User regular
    I read an article recently about the way people learn how to program.
    Basically, there a subset of people who are simply incapable of learning to program regardless of languages or techniques used.
    Formal logical proofs, and therefore programs (formal logical proofs that particular computations are possible, expressed in a formal system called a programming language) are utterly meaningless. To write a computer program you have to come to terms with this, to accept that whatever you might want the program to mean, the machine will blindly follow its meaningless rules and come to some meaningless conclusion. In the test the consistent group showed a pre-acceptance of this fact: they are capable of seeing mathematical calculation problems in terms of rules, and can follow those rules wheresoever they may lead. The inconsistent group, on the other hand, looks for meaning where it is not. The blank group knows that it is looking at meaninglessness, and refuses to deal with it.

    That's very, very interesting. My wife, who is a math person, cannot program to save her life. I wonder is that has something to do with it... She loves proofs.

  • Joe KJoe K Registered User regular
    urahonky wrote: »
    I read an article recently about the way people learn how to program.
    Basically, there a subset of people who are simply incapable of learning to program regardless of languages or techniques used.
    Formal logical proofs, and therefore programs (formal logical proofs that particular computations are possible, expressed in a formal system called a programming language) are utterly meaningless. To write a computer program you have to come to terms with this, to accept that whatever you might want the program to mean, the machine will blindly follow its meaningless rules and come to some meaningless conclusion. In the test the consistent group showed a pre-acceptance of this fact: they are capable of seeing mathematical calculation problems in terms of rules, and can follow those rules wheresoever they may lead. The inconsistent group, on the other hand, looks for meaning where it is not. The blank group knows that it is looking at meaninglessness, and refuses to deal with it.

    That's very, very interesting. My wife, who is a math person, cannot program to save her life. I wonder is that has something to do with it... She loves proofs.

    she's probably been scarred for life by FORTRAN...

    mang any language that lets you change the value of 4 that easily... (o_O)

  • KambingKambing Registered User regular
    I read an article recently about the way people learn how to program.
    Basically, there a subset of people who are simply incapable of learning to program regardless of languages or techniques used.
    Formal logical proofs, and therefore programs (formal logical proofs that particular computations are possible, expressed in a formal system called a programming language) are utterly meaningless. To write a computer program you have to come to terms with this, to accept that whatever you might want the program to mean, the machine will blindly follow its meaningless rules and come to some meaningless conclusion. In the test the consistent group showed a pre-acceptance of this fact: they are capable of seeing mathematical calculation problems in terms of rules, and can follow those rules wheresoever they may lead. The inconsistent group, on the other hand, looks for meaning where it is not. The blank group knows that it is looking at meaninglessness, and refuses to deal with it.

    I believe that's ultimately true in the same sense that some people never never truly grok calculus, music, english, or any other field. But I also believe that as a field, computer science has done a poor job of preparing students to study computer science seriously in college and then, once they're here, articulating what they need to learn to achieve mastery. And a good deal of it is because we've drifted away from focusing on algorithmic thinking as the core concept that we teach.

    In the next 10-20 years when we've fixed those problems, I think that we'll find that programming becomes as accessible as playing a musical instrument. Clearly not everyone will become world-class musicians, but we'll be able to teach someone the fundamentals in a compelling and rigorous way.

    (Also note that the study he cites along with other similar ones that have been performed are testing the students notion of a pre-condition and post-condition with respect to mutation. I've always viewed these studies as evidenced that imperative programming is difficult and should be treated as such.)

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • bowenbowen How you doin'? Registered User regular
    Yeah I've noticed there are people that just don't comprehend logic proofs. So much so that our 10th grade math class skipped it entirely and went to graph proofs. But logic proofs were an easy 25% of my final grade (state test so they included it regardless, you got to pick 4 out of 10 to do). Teacher scolded me because I was the only one who did it and she hated grading them.

    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
  • KambingKambing Registered User regular
    Joe K wrote: »
    Kambing wrote: »

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    It's funny, MIT's Intro to CS Serious course is still done in LISP i think.

    It is nice that functional thinking has come to the forefront recently, personally, i think that it's due to JQuery of all things, but syntacitical sugar for anoymous functions in python, c#, scala and others exposed a lot of people to the style. it's a good thing, because shifting away from this obsessive compulsive disorder about OOP is way overdue.

    MIT has moved from scheme to Python, actually. Northeastern still does everything in Racket. Here at Penn, we've moved from Java to Java+OCaml. Elsewhere people are considering transitions from Java to Python as well, but I think there's a lot of programs holding their breath for the final word from the Curricula task force before they start overhauling.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • urahonkyurahonky Registered User regular
    Oh God they used Scheme? That's evil!

  • urahonkyurahonky Registered User regular
    I'm sorry I meant:

    (((((Oh(((God(They)(Used Scheme)))(?)((That's(evil!)))))

  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    edited April 2012
    Don't you mean:
    (((? (used (oh god) (they)))(! (is (that evil)))

    jackal on
  • bowenbowen How you doin'? Registered User regular
    I hate you all.

    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
  • wildwoodwildwood Registered User regular
    Hmmm...

    (let ((x '(they)) (y '(oh god))) (if (used-scheme x) (do (apply #'exclaim y) (is-evil x))))

    Lisp :rotate:

  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Scheme is the best.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    jackal wrote: »
    GnomeTank wrote: »
    jackal wrote: »
    Avalon was the codename used for WPF. If the vector graphics were the problem Moonlight wouldn't exist.

    Uhhh, Moonlight is a Silverlight thing. Silverlight != WPF. While Silverlight is a subset of WPF, they are actually different internal code bases with completely different rendering backends.

    e: Here is the list of Moonlight dependencies:

    Gtk+ 2.0 development package
    XULRunner development package
    for example: mozilla-xulrunner190-devel for firefox 3, mozilla-xulrunner181-devel for firefox 2
    Alsa and/or PulseAudio development packages

    Nothing in there is vector or 3D. It doesn't implement a full vectored/scalar transform backend like WPF requires to function. It's a subset, just as it should be.

    You're pretty dedicated to this whole being wrong thing.

    Miguel de Icaza has at least never pointed to lack of vector or 3D support as a reason not to tackle WPF. He always points to the complexity of the entire stack. WPF is mostly managed. If the managed parts were opened source the only thing left would be to reimplement milcore.

    Ahh sleep, it does a body good.

    I'm not sure what to tell you man. You said it yourself, most of WPF is managed. A simple ILSpy run will get them exactly what they need. The issue is that finding a hardware accelerated back end to connect it to on Linux is a crapshoot. You could do it purely in software, but what the hell would the point be? It would be dog shit slow.

    They could implement the entire WPF stack, aside from milcore, without needing any help from MS. They would then need to write their own implementation of milcore, which would be fun to say the least. They've already basically done it with Moonlight. So I guess if you want to buy Miguel's comment that the WPF stack is "too complex", when they've already implemented the bulk of the managed core API in Moonlight, that's fine...but I'll choose to continue to believe that the reason WPF doesn't exist in Mono is because of rendering back end issues.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    A simple ILSpy will tell them you what they need, and if you look you will never be able to legally submit code to the Mono project. If MS open sourced that code it could be straight up added to mono (which iirc is what happened with System.Xaml) because it is all managed. What is left is milcore which is the only thing that sits between the managed code and the GPU. It exposes maybe 60 functions that control rendering. I can't say how much work would be involved in porting milcore for other OSes, and that's really the big question.

    Without getting a LOC count for the managed part and milcore it is hard to say how the work is split out, but based on exposed surface area we have many dozens of classes with thousands of functions on the managed side and 60 or so exposed functions on the milcore side.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Yet they've already implemented probably 50% of those dozens of classes with thousands of functions with Moonlight. How did they implement Moonlight without MS open sourcing it? So they can do Moonlight, but they can't do WPF?

    The entire backbone of the WPF architecture (DependencyObject -> Visual -> UIElement -> FrameworkElement) is already there in Moonlight.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • centraldogmacentraldogma Registered User regular
    WPF is being “implemented” in Olive, a Mono side project. I put “implemented” in quotes because it looks like the newest code changes are several years old.

    When people unite together, they become stronger than the sum of their parts.
    Don't assume bad intentions over neglect and misunderstanding.
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    The function count can be misleading, these three probably represent a vast majority of the code:

    MilChannel_BeginCommand
    MilChannel_CommitChannel
    MilChannel_EndCommand

    Those would handle all the actual rendering, most of the rest look like support for state manipulations

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Here is the entire API of the System.Media.Composition.UnsafeMethods wrapper:

    http://www.dotnet247.com/247reference/system/windows/media/composition/duce_z2bunsafenativemethods/__members.aspx

    It's not a ton, but the stuff dealing with channels and commands have sort of sub-apis built in to them that do different things.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Joe KJoe K Registered User regular
    Kambing wrote: »
    Joe K wrote: »
    Kambing wrote: »

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    It's funny, MIT's Intro to CS Serious course is still done in LISP i think.

    It is nice that functional thinking has come to the forefront recently, personally, i think that it's due to JQuery of all things, but syntacitical sugar for anoymous functions in python, c#, scala and others exposed a lot of people to the style. it's a good thing, because shifting away from this obsessive compulsive disorder about OOP is way overdue.

    MIT has moved from scheme to Python, actually. Northeastern still does everything in Racket. Here at Penn, we've moved from Java to Java+OCaml. Elsewhere people are considering transitions from Java to Python as well, but I think there's a lot of programs holding their breath for the final word from the Curricula task force before they start overhauling.

    i guess the question is python 2.x or 3.x ... there's a forking going on :-)

    Java is awful for a foundation class. At least with C you forced people to work close to the metal. With Python, you get away from template coding, and hide some of the uglier features of C and C++... Honestly, it seems like a clear choice for intro classes.

  • KambingKambing Registered User regular
    Joe K wrote: »
    Kambing wrote: »
    Joe K wrote: »
    Kambing wrote: »

    It would be Racket, technically. =)

    No, python is my choice. The class is a stipped-down version of my traditional intro course I taught last Fall except geared towards high school students and compressed into a 3-4 week chunk instead of 13 (it is for a Summer academy program that offers selected high school students a chance to try out college-caliber courses in technology). With those parameters, Python makes the most sense because it has little cruft when dealing with programming fundamentals and the language transfers well to whatever the student does next (programs on their own, goes to college and takes an actual undergraduate intro cs class).

    At the introductory level, both imperative and functional styles ought to be taught because they require distinct reasoning skills (invariants vs. abstraction) that a computer scientist needs to be able to exhibit. Currently, the majority of the field teaches almost exclusively the former but the tides are slowly changing both at the grassroots level (e.g., see CMU's principles of imperative and principles of functional programming courses) and at the policy level (e.g., see the Computer Science Curricula task force 2013 report).

    It's funny, MIT's Intro to CS Serious course is still done in LISP i think.

    It is nice that functional thinking has come to the forefront recently, personally, i think that it's due to JQuery of all things, but syntacitical sugar for anoymous functions in python, c#, scala and others exposed a lot of people to the style. it's a good thing, because shifting away from this obsessive compulsive disorder about OOP is way overdue.

    MIT has moved from scheme to Python, actually. Northeastern still does everything in Racket. Here at Penn, we've moved from Java to Java+OCaml. Elsewhere people are considering transitions from Java to Python as well, but I think there's a lot of programs holding their breath for the final word from the Curricula task force before they start overhauling.

    i guess the question is python 2.x or 3.x ... there's a forking going on :-)

    Java is awful for a foundation class. At least with C you forced people to work close to the metal. With Python, you get away from template coding, and hide some of the uglier features of C and C++... Honestly, it seems like a clear choice for intro classes.

    For most definitions of an intro class, the concepts that you are teaching don't require you to be anywhere near the metal. So what drives what programming language you use in the class comes from external factors as well as internal (e.g., expectations of other departments and courses downstream within the major).

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • an_altan_alt Registered User regular
    Java isn't terrible for an into class. It can be tricky to install and configure for Windows users and it's far too verbose for trivial tasks. That being said, the foundations of the language (assignments, comparisons, loops, functions, etc) are logical enough to follow. The "just ignore 90% of the code in the 'Hello World' example- I'll tell you about it later" is unfortunate.

    Pony wrote:
    I think that the internet has been for years on the path to creating what is essentially an electronic Necronomicon: A collection of blasphemous unrealities so perverse that to even glimpse at its contents, if but for a moment, is to irrevocably forfeit a portion of your sanity.
    Xbox - PearlBlueS0ul, Steam
    If you ever need to talk to someone, feel free to message me. Yes, that includes you.
  • Mike DangerMike Danger "Diane..." a place both wonderful and strangeRegistered User regular
    I'm having one of those stupid moments where everything made perfect sense last night, but now I am having trouble remembering my thinking.

    I have a page I can access at localhost:3000/majors that lists all of the majors, with nice buttons. This is implemented through /app/views/majors/index.html.erb

    I want to click on a link on that page and have it go to a new page for that major where the requirement scheme gets displayed. I put a static page in /app/views/requirement/index.html.erb, but when I try to go to it in the browser when I have the server running I get a wrong number of arguments error.

    rake routes sez:
    15:53: ~/rails_projects/specs $ rake routes
    majors  /majors(.:format) majors#index
      reqs  /reqs(.:format)   requirement#index
    

    Steam: Mike Danger | PSN/NNID: remadeking | 3DS: 2079-9204-4075
    oE0mva1.jpg
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited April 2012
    What error details do you get?

    I'm assuming you have a controller "requirement" with action "index."

    admanb on
  • Mike DangerMike Danger "Diane..." a place both wonderful and strangeRegistered User regular
    Derp, never mind. I need to think more before I post on here.

    Steam: Mike Danger | PSN/NNID: remadeking | 3DS: 2079-9204-4075
    oE0mva1.jpg
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Success.

  • SaerisSaeris Borb Enthusiast flapflapflapflapRegistered User regular
    Python seems like it'd be a great introductory language. It has that robust, clean syntax with very helpful error messages that new students really benefit from.

    Lua has this as well, but you sort of have to roll your own object-oriented framework. Not that it's difficult; it only requires about 10 lines to define a nice base Object prototype. But that's one more barrier to entry. Python has that support built right into the language.

    Either way, I'm glad I started with a language that has closures and first-class functions. Those concepts are way too important and useful to be left until later. My university, for instance, taught the entire curriculum in Java and C/C++; most of my graduating class never wrote a single closure. Even the idea behind Java's anonymous classes was barely covered.

    borb_sig.png
This discussion has been closed.