Page 6 of 6 FirstFirst ... 456
Results 126 to 142 of 142
Like Tree22Likes

Thread: The Code Marathon.

  1. #126
    Senior Member KingOfActing's Avatar
    Join Date
    Oct 2015
    HSC
    2016
    Gender
    Male
    Location
    Sydney
    Posts
    991
    Rep Power
    2

    Re: The Code Marathon.

    Quote Originally Posted by i1337 View Post
    hmm..I think I should have used a better word than app in my original post, lol maybe 'exercise'. I digress.

    anyway, what OOP is designed for and what programs fall under the category of OOP are two different things. I remember doing this while literally learning about OOP lol. I found it helpful.

    Sometimes you might write programs with no real world use, maybe just for the purpose of understanding specific concepts (hence why I said no methods in particular, should have clarified custom methods but thought it'd be obvious). There exists better ways to code a program for the above use I described (obviously).

    My original proposal does fall under the category of OOP. We instantiate objects from classes through specific constructors. This already tells us about object instantiation, class creation/behaviour, constructors and depending on the way you decide to approach this task, static variables (I coded mine with and without static variables).

    It's definitely not a primer of what OIP should be but it is a good exercise for the reader in how OOP works. Hope this clears things up.

    In retrospect I would have probably used a better anology, I just chose whatever came to my mind first lol. Keyboard --> keys.

    idk anything about hash tables yet but I don't doubt it's better at doing this then what the goal of my program is (although the purpose would be different). Looks exactly like python dictionaries.
    Big misconception actually. OOP isn't about object instantiation, nor classes, nor "static variables". It is programming paradigm that focuses on behavior, and attempts to group similar behaviours together for coherent code. This is contrasting to functional programming, where 'objects' are now functions, and things are thought of as "operators" or "parameters".

    Here's an OOP exercise:

    Create an Event, EventManager and EventListener classes. The EventManager class should follow the singleton pattern and utilise lazy initialisation. EventListener objects may register themselves as "listeners" to the EventManager through a method register(EventListener), and unregister themselves through unregister(EventListener). The Event class should be a stub. Upon calling EventManager#post(Event), all registered EventListener's should handle the event through a method handle(Event). You should have only one single static variable, and one static method. A smart implementation would utilise an interface instead of a class, somewhere.
    2015 HSC
    Mathematics 2U
    2016 HSC
    Advanced English, Drama, Maths 3U, Maths 4U, Music 2, Extension Music, Chemistry, Software Design & Development
    Currently studying
    Advanced Mathematics (Hons)/Computer Science @ UNSW (2017– )

  2. #127
    Senior Member KingOfActing's Avatar
    Join Date
    Oct 2015
    HSC
    2016
    Gender
    Male
    Location
    Sydney
    Posts
    991
    Rep Power
    2

    Re: The Code Marathon.

    Quote Originally Posted by i1337 View Post
    you cant seriously say that object instantion, classes creation and use & static member variables etc are not OOP by nature. The word paradigm and that is an interesting word choice. Paradigm (OED):



    This goes back to my previous post. I'm not trying to demonstrate the typical example of the way OOP is best used. Rather, simply show an exercise in which OOP is utilised a particular way. Whether this is effective -- be that as it may -- is another story.

    anyway I don't want to distract you from trials, so focus on that, lol.
    Object instantiation, class creation and members/variables are all implementation details of programming languages. All Object-Oriented means is that it has a focus on Objects, and those object's attributes and methods. Whilst instances of Objects are always core to OOP (is something the same "Type" of object as another?), the use of constructors is only due to standards, and is not part of the paradigm. I use that term, by the way, because that's what OOP is. It is one style of programming, just like Functional, Procedural or Symbolic Programming. I'm not saying the exercise is a bad example of OOP, I'm saying it's not an example of OOP at all. It's a pretty good exercise for data-management or data-structures, but the focus here is on the data and not the behaviour.

    Just to reinforce the point that OOP is just a style - Java itself is in way both functional and procedural. The JVM runs the main(String[] args) method, and once that method returns, the JVM exits.
    2015 HSC
    Mathematics 2U
    2016 HSC
    Advanced English, Drama, Maths 3U, Maths 4U, Music 2, Extension Music, Chemistry, Software Design & Development
    Currently studying
    Advanced Mathematics (Hons)/Computer Science @ UNSW (2017– )

  3. #128
    -insert title here- Paradoxica's Avatar
    Join Date
    Jun 2014
    HSC
    2016
    Gender
    Male
    Location
    Outside reality
    Posts
    2,423
    Rep Power
    4

    Re: The Code Marathon.

    Quote Originally Posted by KingOfActing View Post
    Object instantiation, class creation and members/variables are all implementation details of programming languages. All Object-Oriented means is that it has a focus on Objects, and those object's attributes and methods. Whilst instances of Objects are always core to OOP (is something the same "Type" of object as another?), the use of constructors is only due to standards, and is not part of the paradigm. I use that term, by the way, because that's what OOP is. It is one style of programming, just like Functional, Procedural or Symbolic Programming. I'm not saying the exercise is a bad example of OOP, I'm saying it's not an example of OOP at all. It's a pretty good exercise for data-management or data-structures, but the focus here is on the data and not the behaviour.

    Just to reinforce the point that OOP is just a style - Java itself is in way both functional and procedural. The JVM runs the main(String[] args) method, and once that method returns, the JVM exits.
    +1 for symbolic
    If I am a conic section, then my e = ∞

    Just so we don't have this discussion in the future, my definition of the natural numbers includes 0.

  4. #129
    Vexed?
    Join Date
    Sep 2016
    HSC
    N/A
    Gender
    Male
    Location
    Antartica
    Posts
    278
    Rep Power
    2

    Re: The Code Marathon.

    Bump. I want to learn how to code. Which language should I learn? I know R...

  5. #130
    Loquacious One Drsoccerball's Avatar
    Join Date
    May 2014
    HSC
    2015
    Gender
    Undisclosed
    Posts
    3,667
    Rep Power
    5

    Re: The Code Marathon.

    Quote Originally Posted by He-Mann View Post
    Bump. I want to learn how to code. Which language should I learn? I know R...
    Learn C it actually makes sense.
    He-Mann likes this.

  6. #131
    Vexed?
    Join Date
    Sep 2016
    HSC
    N/A
    Gender
    Male
    Location
    Antartica
    Posts
    278
    Rep Power
    2

    Re: The Code Marathon.

    Quote Originally Posted by Drsoccerball View Post
    Learn C it actually makes sense.
    Will look into it. Do you recommend any courses or resources?

  7. #132
    Loquacious One Drsoccerball's Avatar
    Join Date
    May 2014
    HSC
    2015
    Gender
    Undisclosed
    Posts
    3,667
    Rep Power
    5

    Re: The Code Marathon.

    Quote Originally Posted by He-Mann View Post
    Will look into it. Do you recommend any courses or resources?
    https://webcms3.cse.unsw.edu.au/COMP1911/16s1/

    They literally go soooooooooooo slow so its easy to learn by yourself... Best course I did because the lecturer was a savage
    He-Mann likes this.

  8. #133
    Vexed?
    Join Date
    Sep 2016
    HSC
    N/A
    Gender
    Male
    Location
    Antartica
    Posts
    278
    Rep Power
    2

    Re: The Code Marathon.

    Quote Originally Posted by Drsoccerball View Post
    https://webcms3.cse.unsw.edu.au/COMP1911/16s1/

    They literally go soooooooooooo slow so its easy to learn by yourself... Best course I did because the lecturer was a savage
    Thank you.

  9. #134
    Supreme Member Flop21's Avatar
    Join Date
    May 2013
    HSC
    2015
    Gender
    Female
    Posts
    2,857
    Rep Power
    5

    Re: The Code Marathon.

    Quote Originally Posted by He-Mann View Post
    Bump. I want to learn how to code. Which language should I learn? I know R...
    It kind of depends what sort of stuff you want to be doing.

    If you're at UNSW, why don't you do COMP1917? They teach you C from knowing nothing.

    Like if you just wanted to start off doing front end web work (which is fun), try javascript (of course learn HTML & CSS along with it).

    If you don't want to learn C, you could try Java.

    Maybe people recommend Python, apparently it's a great language. I'm going to learn python next hopefully.
    He-Mann likes this.
    2015 HSC: English Adv, Mathematics, Business Studies, Biology, Multimedia.

    HSC Biology Flashcards

  10. #135
    Vexed?
    Join Date
    Sep 2016
    HSC
    N/A
    Gender
    Male
    Location
    Antartica
    Posts
    278
    Rep Power
    2

    Re: The Code Marathon.

    Quote Originally Posted by Flop21 View Post
    It kind of depends what sort of stuff you want to be doing.

    If you're at UNSW, why don't you do COMP1917? They teach you C from knowing nothing.

    Like if you just wanted to start off doing front end web work (which is fun), try javascript (of course learn HTML & CSS along with it).

    If you don't want to learn C, you could try Java.

    Maybe people recommend Python, apparently it's a great language. I'm going to learn python next hopefully.
    Thanks for the advice.

    My degree requires me to take 6 UOC of computing which I haven't yet done so because of some irrational fear of computing. Many people say computing is easy and is fun but I hear that computing is hard and boring. I'm ok at logic but just not sure.

    Why Java?

    I heard that too, Python. I'm so indecisive and been delaying this [learning to code] for a year now.

  11. #136
    Senior Member KingOfActing's Avatar
    Join Date
    Oct 2015
    HSC
    2016
    Gender
    Male
    Location
    Sydney
    Posts
    991
    Rep Power
    2

    Re: The Code Marathon.

    The language you learn should be dependant on what you need to write.

    Applications for phones and games and stuff -> C based language
    Indie-esque games, server code, data transmission -> Java
    Short scripts -> Python, batch, etc.
    Dependency scripts -> Maven stuff, Ant, Gradle, etc.

    You can do any thing in any language, technically, but then you get performance and technical issues. As much as beginner courses likes to pretend otherwise, Python is not a good language to write a game, and you shouldn't be writing "hello world" length scripts in Java.
    He-Mann likes this.
    2015 HSC
    Mathematics 2U
    2016 HSC
    Advanced English, Drama, Maths 3U, Maths 4U, Music 2, Extension Music, Chemistry, Software Design & Development
    Currently studying
    Advanced Mathematics (Hons)/Computer Science @ UNSW (2017– )

  12. #137
    Vexed?
    Join Date
    Sep 2016
    HSC
    N/A
    Gender
    Male
    Location
    Antartica
    Posts
    278
    Rep Power
    2

    Re: The Code Marathon.

    Quote Originally Posted by KingOfActing View Post
    The language you learn should be dependant on what you need to write.

    Applications for phones and games and stuff -> C based language
    Indie-esque games, server code, data transmission -> Java
    Short scripts -> Python, batch, etc.
    Dependency scripts -> Maven stuff, Ant, Gradle, etc.

    You can do any thing in any language, technically, but then you get performance and technical issues. As much as beginner courses likes to pretend otherwise, Python is not a good language to write a game, and you shouldn't be writing "hello world" length scripts in Java.
    I'm considering learning Python now just because it's good for writing short scripts so I can automate some things!

  13. #138
    Supreme Member Flop21's Avatar
    Join Date
    May 2013
    HSC
    2015
    Gender
    Female
    Posts
    2,857
    Rep Power
    5

    Re: The Code Marathon.

    Quote Originally Posted by He-Mann View Post
    Thanks for the advice.

    My degree requires me to take 6 UOC of computing which I haven't yet done so because of some irrational fear of computing. Many people say computing is easy and is fun but I hear that computing is hard and boring. I'm ok at logic but just not sure.

    Why Java?

    I heard that too, Python. I'm so indecisive and been delaying this [learning to code] for a year now.
    1917 will force you to learn how to code. You go from knowing nothing to being able to solve coding problems. It's pretty cool. Of course that doesn't come without hard work. So you have to go in being enthusiastic, knowing it will be tough at times, but most people before you have gotten through it fine, so you should too.

    I say Java, because some unis teach Java first, I have no knowledge of Java so can't speak for it. We do that in second year in COMP2911 at UNSW (apparently the lecturer is crap, so should be fun...). Python is also taught along with some other stuff in COMP2041 at UNSW, it's known for being a beginners language. Go to CodeAcademy and do the course. Doing a course, or part of a course on there will help you get the basic knowledge of things.

    Now here's the fun thing about comp courses at UNSW. They're changing most of the first year courses. COMP1917 will be replaced by COMP1511 starting from next sem (Introduction to Programming), so you will get to do the revamped fresh course (it will be very similar, but obviously they've changed things for a reason).

    The course drsoccerball linked was COMP1911, which I've heard is like COMP1917 cut in half.

    -

    So TLDR, my recommendation is just to take COMP1511 (the new course that replaces COMP1917), which will force you to learn C and you can decide if you enjoy it or not and move onto other languages or continue mastering C.

    http://webapps.cse.unsw.edu.au/cse/n...s/COMP1511.php

    In the mean time if you're not going to take a comp course for a while but still want to program, learn Python. Start by taking the course on Codecademy. There's also lots of resources online that will help you to choose what language.
    Last edited by Flop21; 2 Nov 2016 at 6:26 PM.
    He-Mann likes this.
    2015 HSC: English Adv, Mathematics, Business Studies, Biology, Multimedia.

    HSC Biology Flashcards

  14. #139
    Vexed?
    Join Date
    Sep 2016
    HSC
    N/A
    Gender
    Male
    Location
    Antartica
    Posts
    278
    Rep Power
    2

    Re: The Code Marathon.

    Thanks for the advice everyone. I'll note it down and think about it.

  15. #140
    Loquacious One turntaker's Avatar
    Join Date
    May 2013
    HSC
    2015
    Gender
    Undisclosed
    Posts
    3,961
    Rep Power
    6

    Re: The Code Marathon.

    Learn HTML best coding language
    "I have crippling depression" -Mahatma Gandhi
    Quote Originally Posted by Katsumi View Post
    lol

  16. #141
    Vexed?
    Join Date
    Sep 2016
    HSC
    N/A
    Gender
    Male
    Location
    Antartica
    Posts
    278
    Rep Power
    2

    Re: The Code Marathon.

    Quote Originally Posted by turntaker View Post
    Learn HTML best coding language
    Reported.

  17. #142
    Loquacious One turntaker's Avatar
    Join Date
    May 2013
    HSC
    2015
    Gender
    Undisclosed
    Posts
    3,961
    Rep Power
    6

    Re: The Code Marathon.

    Quote Originally Posted by He-Mann View Post
    Reported.
    No but seriously as others have said, it depends on what kind of stuff you're into. Java is a pretty general purpose robust language. C isnt really used much but it's important in a sense that everything is C based. Python is an interpreted scripting language which can also be used on the web (e.g Django).

    Personally I would recommend JavaScript it's a really beginner friendly language and you can have lots of fun with it. The best thing is you write once and you can run it in any browser. You could also use Phaser IO to make web games with it which can also work on phones. It's really cool actually.
    He-Mann likes this.
    "I have crippling depression" -Mahatma Gandhi
    Quote Originally Posted by Katsumi View Post
    lol

Page 6 of 6 FirstFirst ... 456

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •