Jump to content

Can I code ANYTHING on Notepad++?

I'm new to coding, and after learning HTML basics I got really hyped to learn software language like C++ and Java. I have been learning HTML in Notepad++ and I like how it's a very basic program. The fact that it doesn't preview what you're coding is very good for me so I can focus more on what I'm coding instead of changing some of my code and see on the preview screen what I've been changing. Anyway, I was asking if I can litteraly code any program in Notepad++ only? At the languages tap I see Java and stuff. Does this mean I don't need any other program other than Notepad++ to code?

Link to comment
Share on other sites

Link to post
Share on other sites

Source code is just plaintext. You can do that with any text editor.

 

Running the code is different.

Compiled languages need a compiler, interpreted need an interpreter. Neither of those is in a text editor.

 

Html is interpreted. The interpreter is your web browser.

Java is compiled. The compiler is javac.exe found in java's JDK you can download from their site.

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, M.Yurizaki said:

All code is plaintext. You could literally code anything using the default Notepad program.

 

The only thing Notepad++ offers are things to help make coding easier, like syntax highlighting.

So theoratically you can code let's say GTA5 on notepad? How does notepad know what language it is? Do I change .TXT to .EXE or..?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Elerek said:

Source code is just plaintext. You can do that with any text editor.

Compiled languages need a compiler, interpreted need an interpreter. Neither of those is in a text editor.

 

Html is interpreted. The interpreter is your web browser.

Java is compiled. The compiler is javac.exe found in java's JDK you can download from their site.

The way you explained this got the spaghetti wires in my brain loose. Thanks! ;D

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, apaydinabdul said:

So theoratically you can code let's say GTA5 on notepad? How does notepad know what language it is? Do I change .TXT to .EXE or..?

You don't code an exe, you compile to an exe.

 

But yes, you COULD code gta5 in notepad, it would not be recommended. Something that complicated would greatly benefit from the extra tools available to you in a proper ide.

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, apaydinabdul said:

So theoratically you can code let's say GTA5 on notepad? How does notepad know what language it is? Do I change .TXT to .EXE or..?

You could code it, but then you'd have to compile it. You can't change the extension.

 

HTML is known as a markup language. Applications are written in programming languages. The difference is markup languages describe how to format a document for viewing. Programming languages describe what software is. There's two different, mutually exclusive methods to turn either or into the intended thing.

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, apaydinabdul said:

So theoratically you can code let's say GTA5 on notepad? How does notepad know what language it is? Do I change .TXT to .EXE or..?

You tell notepad++ which language you're coding in via the Language Tab on the top left of the software

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, Elerek said:

You don't code an exe, you compile to an exe.

 

But yes, you COULD code gta5 in notepad, it would not be recommended. Something that complicated would greatly benefit from the extra tools available to you in a proper ide.

So what type of program is a compiler. Do I download it, put my .txt file or code in it and it changes it to a executable? Or is it like a program you need to have on your computer to run certain programs.

11 minutes ago, M.Yurizaki said:

You could code it, but then you'd have to compile it. You can't change the extension.

 

HTML is known as a markup language. Applications are written in programming languages. The difference is markup languages describe how to format a document for viewing. Programming languages describe what software is. There's two different, mutually exclusive methods to turn either or into the intended thing.

Anybody who wants to run a program has to have the compiler then right?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, apaydinabdul said:

So what type of program is a compiler. Do I download it, put my .txt file or code in it and it changes it to a executable? Or is it like a program you need to have on your computer to run certain programs.

A compiler is a program that turns programming language code into an executable (though technically, it only turns it into the machine's assembly language, which then its assembled into something to become an executable). It is something you download, install, and run like any other application. And when you run it, you tell it what files you want to compile or give it a file that has a list of them and any other things you want the compiler to do, like optimize the hell out of the code for you.

 

1 minute ago, apaydinabdul said:

Anybody who wants to run a program has to have the compiler then right?

No. A compiled program can be run as is. You need a compiler to turn programming language code into a executable.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, apaydinabdul said:

So what type of program is a compiler. Do I download it, put my .txt file or code in it and it changes it to a executable? Or is it like a program you need to have on your computer to run certain programs.

Anybody who wants to run a program has to have the compiler then right?

A compiler takes your source code (human readable) and turns it into executable (machine readable) code.

You normally run the compiler with your source code files as input, and it generates new files with the desired extension (such as .exe).

 

 

Some language (such as java) do require specific things to be installed for people to be able to run your compiled code, but they do not require them to have the compiler. Java compiles with javac.exe into .class or .jar files which run with java.exe (which most computers have installed)

 

C or C++ code compiles to native code normally (so .exe on windows) which requires nothing extra to run.

 

You need to install the compilers for these. There are sometimes several for a given language (C++ has many available compilers).

 

 

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, M.Yurizaki said:

A compiler is a program that turns programming language code into an executable (though technically, it only turns it into the machine's assembly language, which then its assembled into something to become an executable). It is something you download, install, and run like any other application. And when you run it, you tell it what files you want to compile or give it a file that has a list of them and any other things you want the compiler to do, like optimize the hell out of the code for you.

 

No. A compiled program can be run as is. You need a compiler to turn programming language code into a executable.

Okay so an executable is a program that could've been coded in ANY language, but it has been turned into a program that can be run on windows. Why do you need Java on your computer to run certain programs? I don't see the point in that. Because Java is just another language right? Why can't I compile Java into an executable?

 

Also, are there like specific compilers for every language? Or are there many, many types of compilers. Let's say I coded something in C++, what compiler do I need to turn it into an executable?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Elerek said:

A compiler takes your source code (human readable) and turns it into executable (machine readable) code.

You normally run the compiler with your source code files as input, and it generates new files with the desired extension (such as .exe).

 

 

Some language (such as java) do require specific things to be installed for people to be able to run your compiled code, but they do not require them to have the compiler. Java compiles with javac.exe into .class or .jar files which run with java.exe (which most computers have installed)

 

C or C++ code compiles to native code normally (so .exe on windows) which requires nothing extra to run.

 

You need to install the compilers for these. There are sometimes several for a given language (C++ has many available compilers).

 

 

Was still typing my comment to @M.Yurizaki before you replied. Thanks. So what's the use of having Java run as well then? Is Java just easier to code or something?

Link to comment
Share on other sites

Link to post
Share on other sites

Basically think of a compiler as a translator.

If you tried to open a .exe in notepad++ it would just be a bunch of weird boxes and symbols, because it isn't in a human readable language.

In the same way, the computer can't understand your source code.

 

The compiler bridges that gap and translates your source code into something the computer can understand. 

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, apaydinabdul said:

Was still typing my comment to @M.Yurizaki before you replied. Thanks. So what's the use of having Java run as well then? Is Java just easier to code or something?

Java was originally marketed as cross system.

A .exe only works on a windows machine.

A java program runs on anything that has java installed. (in theory)

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, apaydinabdul said:

Okay so an executable is a program that could've been coded in ANY language, but it has been turned into a program that can be run on a windows program. Why do you need Java on your computer to run certain programs? I don't see the point in that. Because Java is just another language right? Why can't I compile Java into an executable?

 

Also, are there like specific compilers for every language? Or are there many, many types of compilers. Let's say I coded something in C++, what compiler do I need to turn it into an executable?

 

2 minutes ago, apaydinabdul said:

Was still typing my comment to @M.Yurizaki before you replied. Thanks. So what's the use of having Java run as well then? Is Java just easier to code or something?

There's three ways of executing code (and I'm just taking this from somewhere):

  • Ahead Of Time Compiling (AOT): This turns the source code into an executable that can be loaded into memory and ran without further processing. This has the fastest execution time, but can limit your software distribution if you need to have it run on other architectures.
  • Just-in-Time Compiling (JIT): Some of the source is compiled into executable code for the computer architecture when it's needed (hence, just-in-time). While it can be as fast as AOT and can run on more platforms (assuming the JIT system is available for it), it's usually more resource intensive.
  • Interpreting: This will turn the source code into executable code essentially line by line. While it's quite slow and resource hungry, it can be run as is.

Java is normally JIT compiled.

 

EDIT:

Most programming languages are AOT compiled. Java and .NET applications (which is C#, VB.NET, and whatever else Microsoft added .NET to) are JIT compiled. Scripting languages are designed to be interpreted, but are often AOT or JIT compiled for faster execution. Markup languages would fall into interpretation if you needed to put it somewhere.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Elerek said:

Java was originally marketed as cross system.

A .exe only works on a windows machine.

A java program runs on anything that has java installed. (in theory)

I see. What extensions do run on Mac? What is the ".exe" of Mac for instance? :/

1 minute ago, M.Yurizaki said:

 

There's three ways of executing code (and I'm just taking this from somewhere):

  • Ahead Of Time Compiling (AOT): This turns the source code into an executable that can be loaded into memory and ran without further processing. This has the fastest execution time, but can limit your software distribution if you need to have it run on other architectures.
  • Just-in-Time Compiling (JIT): Some of the source is compiled into executable code for the computer architecture when it's needed (hence, just-in-time). While it can be as fast as AOT and can run on more platforms (assuming the JIT system is available for it), it's usually more resource intensive.
  • Interpreting: This will turn the source code into executable code essentially line by line. While it's quite slow and resource hungry, it can be run as is.

Java is normally JIT compiled.

You're giving me a bunch of information while I was expecting you to confirm my comment so I knew I was on the right track. This confuses me. Not because I'm too stupid to understand, but just because I've been at school the whole day and my mind is full with anything right now. ;)

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, M.Yurizaki said:

 

There's three ways of executing code (and I'm just taking this from somewhere):

  • Ahead Of Time Compiling (AOT): This turns the source code into an executable that can be loaded into memory and ran without further processing. This has the fastest execution time, but can limit your software distribution if you need to have it run on other architectures.
  • Just-in-Time Compiling (JIT): Some of the source is compiled into executable code for the computer architecture when it's needed (hence, just-in-time). While it can be as fast as AOT and can run on more platforms (assuming the JIT system is available for it), it's usually more resource intensive.
  • Interpreting: This will turn the source code into executable code essentially line by line. While it's quite slow and resource hungry, it can be run as is.

Java is normally JIT compiled.

C and C++ are AOT

 

Java is JIT

 

HTML (not technically a programming language), Python, JavaScript, etc are Interpreted.

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Elerek said:

C and C++ are AOT

 

Java is JIT

 

HTML (not technically a programming language), Python, JavaScript, etc are Interpreted.

Oh I see now.

 

 

@M.Yurizaki Oh nevermind! I didn't fully understand what you were saying! I thought you were talking about different compilers and such, don't know where my mind was heading to lol. Thanks for giving that information. I get it now.

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, apaydinabdul said:

I see. What extensions do run on Mac? What is the ".exe" of Mac for instance? :/

It's normally .app. However since macOS is UNIX, the extension literally does not matter because it can attempted to be executed as long as the file permissions say you can execute it.

 

EDIT: See https://en.wikipedia.org/wiki/Modes_(Unix)

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, MimigaKing said:

You tell notepad++ which language you're coding in via the Language Tab on the top left of the software

I don't have Notepad++ (I use Programmers Notepad 2), but I would assume it also will automatically determine it based on the file extension if you open a file.

Make sure to quote or tag me (@JoostinOnline) or I won't see your response!

PSU Tier List  |  The Real Reason Delidding Improves Temperatures"2K" does not mean 2560×1440 

Link to comment
Share on other sites

Link to post
Share on other sites

17 hours ago, M.Yurizaki said:

All code is plaintext.

Not true.

http://esolangs.org/wiki/Piet

 

You can, however, write any code in any text editor - not all text editors support syntax highlighting for them though.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

Personally I'd recommend clion or intellij for c/c++ or Java respectively. As for simple text editors sublime or visual code are better than notepad++

Link to comment
Share on other sites

Link to post
Share on other sites

On 2017-6-23 at 3:36 PM, ElfFriend said:

As for simple text editors sublime or visual code are better than notepad++

I don't know about 'better' but Notepad++ certainly looks more dated; it doesn't follow the nice new Material Design paradigm and probably never will.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

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

×