Jump to content
dsavi

Introduction to Programming & Programming Languages

Recommended Posts

Ruby maybe, but isn't LISP kind of dead?

 

LISP still has its practical uses. Admittedly, unless you're in academia, you won't see it very much if at all, but LISP is a great example of a functional programming languages.


Linux User/Enthusiast Full-Stack Software Engineer | Stack Overflow Member | GIMP User
s1L0U.jpg
...Alright, the Elf City update lured me back to RS over a year ago.

Share this post


Link to post
Share on other sites

Can you change my C# example so it's "class Example" rather than "class example"? By convention, class names in .NET use upper camel casing, so it will more accurately reflect the language's style.


  • Never trust anyone. You are always alone, and betrayal is inevitable.
  • Nothing is safe from the jaws of the decompiler.

Share this post


Link to post
Share on other sites

I suppose this is ready to sticky then. If you want to make those examples, Cloak, it's fine and I'm sure it would be interesting to have a more abnormal language like Lisp on the guide too.


C2b6gs7.png

Share this post


Link to post
Share on other sites

I don't know where you could add this but it may be beneficial to newcomers, as this topic is highly focused on the syntax and not the semantics as much as I would like to see.

 

 

If you want to get a strong handle on a new language, or even to gauge how well you know your current languages, it is best to tackle problem solving problems, instead of trying to design a program with a purpose. With problem solving you need to understand the syntax and the semantics. Not just copy and paste code and hope it all works out. Figuring out the following problems, or how to write programs that can solve the below programs will definitely increase your understanding of the language or even help you further in becoming a programmer. The following are the basic problem solving tasks I've been told to complete through-out the online tutorials and in-class conditions. This is a list of those problems that I think bring the best outcome in the understanding of the language.

Try to mentally figure out how to solve these problems first however:


[b][u]Loops:[/u][/b]

1. Write out 1 to 10 using a loop only.
2. Retrieve two numbers as input, and loop from the smaller number to the highest number, then stop.
3. Using only loops write out a multiplication table for the number entered by the user (If they enter 10, do the multiplication table up to 100 - this is a full 10x10 'grid' of numbers, if the number entered was 10, if it is 8, it would be an 8x8 'grid').


[b][u]Strings:[/u][/b]

1. Enter a string as input to the program, and have the program find any occurrences of any character entered by the user.
2. For each letter in a string, increase it so it changes to the next letter ahead of it in the alphabet. Do not increase punctuation symbols or spaces.
3. Read from a file, and for each LINE in the text file, write that line backwards (including punctuation symbols). Not the entire document backwards, but line by line backwards.
4. In a text file, find any 'scattered occurrences' of the word entered by the user. If the word was 'pie', then your program would go through the text file to find the straight scattered occurrences of the letters 'p', 'i', and 'e'. At the end it would output the number of occurrences found and where the occurrences are by line number.


[b][u]Arrays:[/u][/b]

1. Swap every two index values in an array, using a loop.
2. Create a multiplication table using an array.
3. Create a 4x4 Sudoku puzzle using an array, without any graphical support, all text based.

---

Doing these basic problem solving tasks, you should gain a higher understanding of whatever language you're trying to learn, or get a handle on. This is also very basic in terms of where problem solving can get to in computer programming. Most universities are or should be handing out this level of problem solving questions to first years.

Share this post


Link to post
Share on other sites

I put it at the end, I kind of felt that it should be earlier, but I wasn't sure that that would be the correct order in which to read the guide. You're right, my guide is almost completely theoretical.


C2b6gs7.png

Share this post


Link to post
Share on other sites

I put it at the end, I kind of felt that it should be earlier, but I wasn't sure that that would be the correct order in which to read the guide. You're right, my guide is almost completely theoretical.

 

It is still better than 80% of the guides you can find online for this type of thing.

 

I'm wondering if something about sorting algorithms should be included though. As that may be universal and common enough, or at least for people to realize what they are. Bubble Sort, Selection Sort, Insertion Sort, Quick Sort, Heap Sort, Merge Sort, and Shell Sort. Maybe just Bubble, Selection, Insertion & Quick would be good enough, with a reference to learn the other sorts.

 

I have all of these sorts coded in C#, just give me a few days to find them if you think it would be appropriate for this guide. They're also all methods, not functions...so. :/

Share this post


Link to post
Share on other sites

a tiny thing I want to add to C++, is that theres alternative ways of dynamic allocation besides using an array.

the programmer himself will have to decide which is a more efficient method and program accordingly.

so things like link lists and stacks should be included for people to think about and look up if they're interested?


Grandmasterh.png

Share this post


Link to post
Share on other sites

I guess this is the place to ask.

 

I'm wanting to learn another, more powerful and useful language. I'm thinking Java, and that's probably what I'll go with. What I've used before is Gamemaker, and future BASIC in Computer Math. Those two languages both have an editor for them that lets you visually see how your code will fit together, and it will do things like bold functions, or set colors for quotes, or indent loops. What I'm wondering is if there's something similar for Java? I'm not sure what to search for on google to find something like that, and Oracle's JDK doesn't seem to include that particular feature.


My skin is finally getting soft
I'll scrub until the damn thing comes off

Share this post


Link to post
Share on other sites

What you're looking for is a gui builder. Netbeans is a good option.


polvCwJ.gif
"It's not a rest for me, it's a rest for the weights." - Dom Mazzetti

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.