How to code?
(14 posts, started )
How to code?
Hi, recently I've been looking into tutorials on how to code in Javascript. Ive tried some online sites, yes they are good but the information does not really stick in my head as well as I want it to.

I would like to know the basics of coding and how to create simple .exe applications and vbscrips, html documents and java script apps.

If anyone knows any websites that give clear and simple instructions or is willing to give me a few key facts relating to coding and to what I will need (since I am only using notepad right now for the coding), then I would appreciate that.



Thanks,
Edward.
You are mixing few things together, let me help clear it up a little.

HTML is not a programming language, it's a markup language. You cannot write programs in HTML code.

VBScript and JavaScript in particular were originally designed to be used on the Web. It's not like you cannot use them for something else but it's probably not the best way to learn how to code.

There are MUCH better alternatives if you seriously want to learn to program. Python for instance is a great language to start with. You might want to replace bare notepad with something a bit more advanced such as Notepad++ or PSPad.

BTW, learning to code requires much more than copy-pasting code from various tutorials on the web. Unless you take it seriously, start from the very basics and make sure that you fully understand the subject before you move one step ahead you won't get anywhere no matter kind of language or tools you use. I don't mean to discourage you, I just want to point out that programming is not the easiest thing to learn.
If I understand correctly you have already found some sites about Javascript and played around a bit. Just continue with that and try to slowly make more complex things. The basic things one learns at beginning are the same with any language, it does not really matter which one.
JS is mainly for web-stuff but has the advantage that you do no need to install anything or configure compilers and annoying stuff like that: all one needs is webbrowser.

Really helpful is imo to use a textediteditor better than windows notepad.
When you get a message like "error in line 253" then you must be able to find line 253 - in notepad that is impossible. So editors have line numbers like this:

There is also some other helpful stuff, like the colors which makes it easier to see if you forgot an } or " or similiar. (That screenshot is from http://notepad-plus-plus.org/ )

This might also be interessting:
http://en.wikipedia.org/wiki/List_of_Hello_world_program_examples
Those programs all do the same thing, they print "hello world" to the screen.

When you scroll to the BASIC example it looks like:
PRINT "Hello, world!"

Nice and simple?

Compare to C++ :

#include <iostream>
int main()
{
std::cout << "Hello, world!\n";
return 0;
}

So there is still that one line that supposedly does the "Hello, world"-printing.
But there are also other lines that do WHATEVER and many more strange symbols like ;:-::<#()

Those strange things make perfect sense, but when starting it is impossible to understand the concepts behind them. And more important:
For start it is not nessecary to understand every little detail.
For example it is not strictly nessecarily to understand why std::cout has those funny :: in the middle.
You can spend days trying to figure out what those dots mean, or you could spend that time to actually program and learn something. All one needs to know that this thing can be used to to display text.
(Just like in a car you do not need to understand how the engine works, or why it makes different sounds sometimes, just need to know which pedal makes you go faster.)
So it is very important to understand the basics but also important not to let that stop you from experimenting.
Thanks for the replies, I have downloaded Notepad ++ and have managed to make this code, it's very basic but it's as far as I've managed to get for now.



a=msgbox ("Message Test",2+48+vbSystemModal, "gadget:")
if a= vbAbort then msgbox "quit" , vbCritical


This makes a box appear which says "Message Test", it has 3 options, if I click on Abort then another box appears which says "quit".

I would like to know how I can create simple .exe files or my own programmes. For example, I know I probably shouldn't mention it on this forum but lfstweak, that has many options and buttons that affect lfs, I would like to create a very basic program with buttons that do things which is like lfstweak, not for hacking purposes of course though, just for fun.

Would microsoft visual c++ be the best program to do this?
You would be better of with something like Java or C#. I think the learning curve for languages like those are less steep.
For simple scripting languages Notepad++ is just fine. It's super light-weight and starts instantly, and you can customize it any way you like.

If you're going for C# or languages like that Visual Studio is your best option. I think it's one of the nicest IDE's around.
C# is probably one of the best you can start off with, and JAVA is also a good option. I was learning those 2 when I got into programming, and they teach you the basics quite well, and as Bose said, the learning curve is brilliant.

Although, I also suggest that you should learning PROGRAMMING first and then start coding. You will be a one legged horse, if you jump into coding without learning the basic thinking behind programs, and the basic algorhythms that most tasks can be reversed to.

About sublime text:
I personally have astigmatism and have no freaking way to read light text on dark background for more than 5 minutes, which is certainly not a plus for coding.
Java and C# in particular have the disadvantage that they pretty much require a complex IDE (such as NetBeans or Visual Studio respectively) to build even the simplest projects. I'm not saying that IDE is a bad thing but from an absolute beginner's perspective it might be an obstacle. Instead of having just your code to deal with you'll have to learn how to use the IDE before you can start coding. It also hides the details of how your code is translated into something the computer understands.

For this reason I'd suggest you start with a language that doesn't need any of this. With Python or PHP you can write your code in anything and then do something like "php.exe mycode.php" and your code will run. Writing code without an advanced IDE checking your syntax will force you to actually learn the language instead of blindly following the autocorrection suggestions.

And ultimately, follow Kristi's advice about learning the algorithmization basics first. Unless you do that, you'll NEVER be able to write anything even remotely useful. Don't start with GUI and stuff, text input and output will be more than fine for a long while.
I learnt JAVA without a proper GUI, only a compiler installed and using Geany, which is kinda like Notepad++. You can easily learn to code, with no help or syntax clues, the compiler is kinda communicative anyway. C# on the other hand is really all about Visual Studio.

I don't agree with the PHP thing. That language is garbage and moreover, you have to install a php server on your PC to test your stuff, cause it just won't run by itself. Python is a weird one. Has weird syntax to begin with. I'd rather recommend something C related at least. Our university starts with C++ even for beginners, which I have no idea why, but it's not that bad of a choice.
It all depends on what type of applications you're wanting to develop.

If you're wanting to go down the web development route, starting with learning HTML5 (HTML, CSS & JS) with a PHP & MySQL backend is a perfectly logical way to start.

Once you become a little more knowledgeable about how everything fits together I would drop PHP and replace it with something like NodeJS.
Quote from Kristi :I learnt JAVA without a proper GUI, only a compiler installed and using Geany, which is kinda like Notepad++.

I sense that the OP might loose interest if there were too many obstacles between the code he writes and a running program. It's true that pretty much anything can be done "manually" from the command line, but it can be quite obnoxious, especially on Windows.

Quote from Kristi :
I don't agree with the PHP thing. That language is garbage and moreover, you have to install a php server on your PC to test your stuff, cause it just won't run by itself.

Actually you don't. PHP has a standalone interpreter that can be run from a command line. Opinions about the language will obviously vary. I'm not particularly fond of it myself but it has a C-like syntax and the interpreter provides very concrete error outputs in case something goes wrong.
[/quote]

Quote from Kristi :
Our university starts with C++ even for beginners, which I have no idea why, but it's not that bad of a choice.

This might have something to do with "inertia", I suppose it's not difficult to find university professors that are proficient in C because for a long time there wasn't a good alternative (maybe except for Pascal). C is still a brilliant language with simple syntax, but it doesn't abstract away the low-level stuff. Great for someone who wants to seriously learn how to code but too hardcore a - for the lack of better term - "casual" programmer.
Yeah, the trouble with c++ is the amount of dicking about and extra bits and peices you need to just to get a simple 'hello world' running.

I still have trouble getting a new project started in VS2010.


Java's not too bad a beginning, especially with something like Netbeans which will add all your #includes for you as you go so you don't need to mess about having to import libraries just to get something to show on the screen. It's advanced enough to teach quite complex things, will show you OOP, and yet you can get it outputting some text in three or four lines.
So, how is PHP garbage? It has all of the same features of most common languages. Namespacing, classes, reflection, late static binding, inheritance, traits, etc...

The most commonly used PHP things are trash (Wordpress, Drupal, etc), but PHP as a language is perfectly fine.

How to code?
(14 posts, started )
FGED GREDG RDFGDR GSFDG