Page 1 of 5 123 ... LastLast
Results 1 to 10 of 49

Thread: Software Projects for Beginners

  1. Top | #1
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    16,144
    Archived
    16,829
    Total Posts
    32,973
    Rep Power
    97

    Software Projects for Beginners

    Beginner Programming Projects for New Software Engineers - YouTube by blondiebytes

    She recommends starting with something simple with some well-defined goal of what one wants to do in it. Like play a guessing game or tic-tac-toe. She also recommends doing a text-interface one, like a command-line one.

    Me: Like a number guessing game. Either guess the computer's number or the computer guesses your number. The number knower then provides hints to the number guesser: too large, too small, or the right answer.

    No fancy GUI, she says. Me: if one wants a GUI, one can keep it plain and simple, with buttons, text fields, and menus, all with text in them. Once one gets that working, one can then add artwork.

    Also, some well-known algorithm. Like a random-number generator. Me: Or sorting algorithms. I once did that with Delaunay triangulation, drawing triangles between points with certain nice properties. There are several algorithms for doing so, and I implemented most of them.

    Or using data from some other software using some API. Like accessing some database. That's a common sort of task. One may also be supplying data to some other programmers in a company.

    Or create a software library. Though one should also look at what's available in a language's standard library. One may learn how to use a package manager, so one can get additional libraries, like NumPy (Numerical Python) and MatPlotLib (does graphs) for Python.

    Most of the time in one's programming career, one is working with code that already exists, fixing bugs, adding features, and updating it.

    Look in some open-source repository like GitHub and look for what one might want to do in it. It can be good for finding out how others like to program.

  2. Top | #2
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    16,144
    Archived
    16,829
    Total Posts
    32,973
    Rep Power
    97
    How to Learn a Programming Language - YouTube also by blondiebytes

    If you've never programmed before, you need to take some course in programming. But if you have, then you've learned a lot of things that will carry over, like variables, flow of control, functions, etc.

    How might one start? Looking at a syntax reference to see how the language does things.

    Me: like define variables. Does one have to explicitly define them? (static typing) or does one define them as one goes? (dynamic typing). That can make a big difference.

    For more fancy things, one ought to look at what others have done with the language. Or else libraries like pandas for data handling, numpy for number crunching and matplotlib for plotting. These are for Python, though one can find similar things for other programming languages.

    She then got into machine learning, and from there, into online instruction sites like Udemy and CodeAcademy. Some Udemy courses are very bad, she concludes, and CodeAcademy has the problem of having its own interface.


    She also has Learn Data Structures by Exploring Java Source Code - YouTube

    Recommends using an IDE and looking at the Java standard-library source code. She uses the Java "stack" class as an example. It's a last-in-first-out list that inherits from "vector", a list class with a behind-the-scenes array that gets extended if necessary.

  3. Top | #3
    Veteran Member excreationist's Avatar
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    1,454
    Archived
    4,886
    Total Posts
    6,340
    Rep Power
    78
    https://www.tomdalling.com/blog/soft...o-much-detail/

    This is used in software developer job interviews
    Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

    A solution by an experienced software developer: (probably a joke)

    Code:
    module FizzBuzz
      DEFAULT_RANGE = 1..100
      DEFAULT_TRIGGERS = [
        ['Fizz', ->(i){ i % 3 == 0 }],
        ['Buzz', ->(i){ i % 5 == 0 }],
      ]
    
      ##
      # Makes an array of FizzBuzz values for the given range and triggers.
      #
      # @param range [Range<Integer>] FizzBuzz integer range
      # @param triggers [Array<Array(String, Integer)>] An array of [text, predicate]
      # @return [Array<String>] FizzBuzz results
      #
      def self.range(range=DEFAULT_RANGE, triggers=DEFAULT_TRIGGERS)
        enumerator(range.first, triggers).take(range.size)
      end
    
      ##
      # Makes a FizzBuzz value enumerator, starting at the given integer, for the
      # given triggers.
      #
      # @param start [Integer] The first integer to FizzBuzz
      # @param triggers [Array<Array(String, Integer)>] An array of [text, predicate]
      # @return [Enumerable] Infinite sequence of FizzBuzz results, starting with `start`
      #
      def self.enumerator(start=DEFAULT_RANGE.first, triggers=DEFAULT_TRIGGERS)
        Enumerator.new do |yielder|
          i = start
          loop do
            parts = triggers.select{ |(_, predicate)| predicate.call(i) }
            i_result = parts.size > 0 ? parts.map(&:first).join : i.to_s
            yielder.yield(i_result)
            i += 1
          end
        end
      end
     end

  4. Top | #4
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    16,144
    Archived
    16,829
    Total Posts
    32,973
    Rep Power
    97
    It's easy (Python version):
    Code:
    for k in range(1,100+1):
      dv3 = "Fizz" if (k % 3) == 0 else ""
      dv5 = "Buzz" if (k % 5) == 0 else ""
      # Makes "FizzBuzz" for both
      dv35 = dv3 + dv5
    
      if len(dv35) > 0:
        print(dv35)
      else:
        print(k)

    Related to this is which programming language to learn first.

    Ideally, one would want a language where one can do simple things without having to learn a lot, but one which can be used for professional-quality work. That is, not a toy language.

    I recommend Python. It satisfies both criteria.

    The main problem with Python, however, is its suboptimal performance. That is due to its dynamic typing, finding the data type of each variable before working with it. One gets much better performance with a static-typing language like Java or especially C++.

    For high-performance code, I recommend C++. It is backward-compatible with plain C, but it has *lots* of convenience and safety features. Both C and C++ have static typing, for instance, meaning that one must specify the types of most variables at compile time. Some supporters of C point out that it is a small language, with not many features. But one of them is its preprocessor. That feature works by simple substitution, and that makes it VERY bug-prone. In addition to the bugs that pointers can have, that makes C very vulnerable.

  5. Top | #5
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    16,144
    Archived
    16,829
    Total Posts
    32,973
    Rep Power
    97
    C++ has numerous features, but some of them are designed to provide alternatives to the more bug-prone features of plain C.

    call by reference, with & - one can avoid pointers in function args.

    inline - one can make some functions compiled inside the code that calls them rather than accessed by jumping outside that code and then returning. But that is essentially a hint, and the compiler can ignore it.

    const - state that some variable is not to be modified after it is declared, something also available in plain C. In C++, one can do "const" for a variable whose value is set at runtime when it is cleared, and one can also state that an object method is not to modify its object by putting "const" after its definition.

    #define PI 3.14159265...
    vs.
    const double PI = 3.14159265...;

    template - this abolishes a *lot* of preprocessor use. Thus, for minimum and maximum,
    #define MIN(x,y) ((x) <= (y) ? (x) : (y))
    #define MAX(x,y) ((x) >= (y) ? (x) : (y))
    template <class T> T &min(const T &x, const T &y) {return (x <= y) ? x : y;}
    template <class T> T &max(const T &x, const T &y) {return (x >= y) ? x : y;}

    The Standard Template Library - has containers and algorithms for working with them. STL containers clean up after themselves, deallocating whichever memory that they allocated.

    auto - this type keyword is for type inference, thus getting round a major nuisance of static typing.

    anonymous functions that can capture variables from the surrounding scope - just like what one can get in Java, Python, etc.

  6. Top | #6
    Administrator lpetrich's Avatar
    Join Date
    Jul 2000
    Location
    Eugene, OR
    Posts
    16,144
    Archived
    16,829
    Total Posts
    32,973
    Rep Power
    97
    There is more in the works for C++

    concepts - these are constraints on template arguments, like only accepting integer-like variables.

    ranges - these are alternative ways of specifying iteration over containers, much like what one can do in Python and the like.

    C++ recently got foreach:
    for (variable: container) {}
    much like what Java recently got and which Python has had for some time.


    But with complexity like that, I don't recommend C++ for the novice programmer. Like someone who stumbles over what a variable is.

  7. Top | #7
    Veteran Member excreationist's Avatar
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    1,454
    Archived
    4,886
    Total Posts
    6,340
    Rep Power
    78
    Quote Originally Posted by lpetrich View Post
    It's easy
    Yes though it is interesting how many different approaches there are....
    BTW I like an approach that is as straight forward as possible like this:
    Code:
    1.upto(100) do |i| 
      if i % 3 == 0 && i % 5 == 0
        puts 'FizzBuzz'
      elsif i % 3 == 0 
        puts 'Fizz'
      elsif i % 5 == 0 
        puts 'Buzz'
      else
        puts i
      end
    end
    Related to this is which programming language to learn first.
    Sometimes primary school kids learn Scratch which involves moving around coloured shapes and blocks (and a little typing). I used it for my game design prototype. Though that is a toy language.

    I agree that Python is a good language for beginners.

    At the moment I'm learning C# for the Unity game engine and like it better than Unreal 4's C++. It is a lot better for beginners...

    I like to use IDEs that have coloured syntax, autocompletion, and automatic suggestions about possible issues.

    BTW do you think there is any language harder to master than C++?

  8. Top | #8
    Contributor
    Join Date
    Apr 2002
    Location
    Finland
    Posts
    5,229
    Archived
    6,261
    Total Posts
    11,490
    Rep Power
    78
    Quote Originally Posted by excreationist View Post
    Quote Originally Posted by lpetrich View Post
    It's easy
    Yes though it is interesting how many different approaches there are....
    BTW I like an approach that is as straight forward as possible like this:
    Code:
    1.upto(100) do |i| 
      if i % 3 == 0 && i % 5 == 0
        puts 'FizzBuzz'
      elsif i % 3 == 0 
        puts 'Fizz'
      elsif i % 5 == 0 
        puts 'Buzz'
      else
        puts i
      end
    end
    Related to this is which programming language to learn first.
    Sometimes primary school kids learn Scratch which involves moving around coloured shapes and blocks (and a little typing). I used it for my game design prototype. Though that is a toy language.

    I agree that Python is a good language for beginners.

    At the moment I'm learning C# for the Unity game engine and like it better than Unreal 4's C++. It is a lot better for beginners...

    I like to use IDEs that have coloured syntax, autocompletion, and automatic suggestions about possible issues.

    BTW do you think there is any language harder to master than C++?
    I think that's a moot question. For one thing, there are always harder languages, either due to poor design or deliberate obfuscation. But that doesn't make them more powerful or better in any way.

    Secondly, you don't have to master a language to be able to use it. C++ is a multi-paradigm language that you can use however you please. In reality you'll probably only use a very small subset of what the language has to offer. I personally just learned about C++ priority queues last week, even though I've been using the language for over a decade. Never just stumbled into it before. It's a tool box that has many tools, but you don't have to be a wizard at every tool to be a good plumber or a carpenter or a mechanic.

  9. Top | #9
    Veteran Member excreationist's Avatar
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    1,454
    Archived
    4,886
    Total Posts
    6,340
    Rep Power
    78
    Quote Originally Posted by Jayjay View Post
    Quote Originally Posted by excreationist
    BTW do you think there is any language harder to master than C++?
    I think that's a moot question. For one thing, there are always harder languages, either due to poor design or deliberate obfuscation. But that doesn't make them more powerful or better in any way.
    I meant out of typical languages, not deliberate obfuscation (like Brainf*ck).

    Secondly, you don't have to master a language to be able to use it.
    Ok I mean enough to get an entry-level or average-level job. Not just hobbyist programming.

  10. Top | #10
    the baby-eater
    Join Date
    May 2011
    Location
    Straya
    Posts
    4,402
    Archived
    1,750
    Total Posts
    6,152
    Rep Power
    45
    C++ seems like a really difficult language. I've written a little bit of C and C++ and even that was hard work.

    Is C++ just popular because it's the standard, go-to low-level programming language, the everyone learns, every big tech company hires for, and has a huge ecosystem?

    There must be better choices for writing high-performance code that is also nice to write and nice to look at.

Posting Permissions

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