|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Not how to 'understand' source code ;-)
Just wondering what kind of little Windows app I could download to actually
*see* (take a look at) the source code for a program (well, one that has
publicly-available source code, anyway--like POV-Ray.) I've never thought of
doing so before now, and don't know what's involved. Not to EDIT the stuff, or
compile/recompile it; that's way beyond me.
From what I've read, some 'text' editors can do this. Or would it require a 'hex
editor'? Or perhaps something like Notepad++, which apparently can open and
display programs written in C, C++ etc?
What I would basically like to do is see the code the way the original developer
saw it, while writing it (in whatever programming language that happened to be.)
I might even learn a few things!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 06/02/2013 20:30, Kenneth nous fit lire :
> Not how to 'understand' source code ;-)
>
> Just wondering what kind of little Windows app I could download to actually
> *see* (take a look at) the source code for a program (well, one that has
> publicly-available source code, anyway--like POV-Ray.) I've never thought of
> doing so before now, and don't know what's involved. Not to EDIT the stuff, or
> compile/recompile it; that's way beyond me.
>
> From what I've read, some 'text' editors can do this. Or would it require a 'hex
> editor'? Or perhaps something like Notepad++, which apparently can open and
> display programs written in C, C++ etc?
>
Any text editor (not wordprocessor) should do.
You might enjoy an easy to use search function (just to spot all the
occurrence of a variable, or finding a function)
An optional line numbering might help too.
> What I would basically like to do is see the code the way the original developer
> saw it, while writing it (in whatever programming language that happened to be.)
> I might even learn a few things!
<start holy war>
* PFE (programmer's File Editor)
* use eclipse with C/C++ or Java setting
* use Microsoft Visual Studio (or whatever its name), if available as
free edition on your OS (IIRC, MSVC 2012 need something like Vista or 7
and won't install on XP)
Tag line: beware of expecting to learn a language by studying existing
code, you would be disappointed.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 06/02/2013 8:09 PM, Le_Forgeron wrote:
> <start holy war>
> * PFE (programmer's File Editor)
> * use eclipse with C/C++ or Java setting
> * use Microsoft Visual Studio (or whatever its name), if available as
> free edition on your OS (IIRC, MSVC 2012 need something like Vista or 7
> and won't install on XP)
Em! Why not mention PovRay's own editor? (Windoze version, anyway.)
From the manual:
1.2.6.6 Configuring the Internal Editor
The built-in editor is extensively customizable. It utilizes syntax
highlighting and understands .POV and .INC files as being in POV syntax.
You can change the color settings used from the properties dialog (Alt +
Enter).
It also has built-in syntax highlighting for C, C++, Java, Basic,
Pascal, SQL, HTML and XML.
--
Regards
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 06.02.2013 20:30, schrieb Kenneth:
> Not how to 'understand' source code ;-)
>
> Just wondering what kind of little Windows app I could download to actually
> *see* (take a look at) the source code for a program (well, one that has
> publicly-available source code, anyway--like POV-Ray.) I've never thought of
> doing so before now, and don't know what's involved. Not to EDIT the stuff, or
> compile/recompile it; that's way beyond me.
>
> From what I've read, some 'text' editors can do this. Or would it require a 'hex
> editor'? Or perhaps something like Notepad++, which apparently can open and
> display programs written in C, C++ etc?
Actually /any/ text editor will do, even the Windows Notepad, as
virtually all contemporary programming languages still use plain vanilla
ASCII files.
You'll probably want something with "syntax highlighting" though.
Notepad++ indeed sounds like a good idea.
That said, you'll soon find that "how to 'understand' source code" is a
question worthwhile asking, too :-)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 06.02.2013 22:01, schrieb Stephen:
> On 06/02/2013 8:09 PM, Le_Forgeron wrote:
>> <start holy war>
>> * PFE (programmer's File Editor)
>> * use eclipse with C/C++ or Java setting
>> * use Microsoft Visual Studio (or whatever its name), if available as
>> free edition on your OS (IIRC, MSVC 2012 need something like Vista or 7
>> and won't install on XP)
>
> Em! Why not mention PovRay's own editor? (Windoze version, anyway.)
That would be off-topic here :-P
But you're making a totally valid point. Never thought of it.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Kenneth <kdw### [at] gmailcom> wrote:
> From what I've read, some 'text' editors can do this. Or would it require a 'hex
> editor'? Or perhaps something like Notepad++, which apparently can open and
> display programs written in C, C++ etc?
I'm not sure you understand what program source code is. It's just ascii
text, like this very text I'm writing and posting here. It will look like
for example:
int someFunction(int parameter)
{
return parameter + 1;
}
Many programming languages are compiled to a binary file (usually containing
raw machine code, as well as slightly higher-level stuff like relocation
data and other kind of data for the dynamic linker.) Such compiled binary
files are not conversible back to the original source code.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hey, this is really fantastic! So I downloaded POV-Ray's 3.62 source code, and
it shows up in Windows Notepad, EditPadLite--even in POV-Ray itself! (I think
the latter is my favorite 'reading platform' so far.)
Thanks to everyone who posted about this. I didn't know it was so easy.
Hey, there are LOTS of separate source code files for POV-Ray! Where to begin...
I naively thought that *whatever makes POV run* would be just one big file. Am
I correct in thinking that the program's source code is actually split up into
lots of little (therefore manageable) chunks?
One other thing: Does POV-Ray (or any of the other text reader apps I mentioned)
need ...uh... built-in 'code libraries' or something, to show *correct*
C/C++/whatever syntax? In other words, does a particular app 'substitute' its
own syntax for the correct one, if it doesn't have certain code libraries? (I
hope I'm asking this in a meaningful way.) Am I *seeing* the code correctly?
These questions are based on something I read on a Wikipedia page:
"Notepad++ supports syntax highlighting and code folding for over 50
programming, scripting, and markup languages. It attempts to automatically
detect the language that a given file uses, using a modifiable list of file
extension bindings. Users may also manually set the current language, overriding
the extension's default language."
Or does that mean just what it says--only for "syntax highlighting and code
folding"? If so...no problem! (Clipka's response re: ASCII makes me think so
anyway.)
Off-off-topic: While I was doing my research into this stuff, I read about 'hex
editors.' Apparently they can open an executable (.exe) file for editing?? (Not
in a higher-level language, of course.)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 07.02.2013 00:19, schrieb Kenneth:
> Hey, there are LOTS of separate source code files for POV-Ray! Where to begin...
> I naively thought that *whatever makes POV run* would be just one big file. Am
> I correct in thinking that the program's source code is actually split up into
> lots of little (therefore manageable) chunks?
Absolutely.
> One other thing: Does POV-Ray (or any of the other text reader apps I mentioned)
> need ...uh... built-in 'code libraries' or something, to show *correct*
> C/C++/whatever syntax? In other words, does a particular app 'substitute' its
> own syntax for the correct one, if it doesn't have certain code libraries? (I
> hope I'm asking this in a meaningful way.) Am I *seeing* the code correctly?
Yes, you are. /All/ text editors show the code correctly. Some editors
can automatically identify certain syntactical elements to show them in
different colors (syntax highlighting), or provide you with ways of
hiding code sections (code folding), but that's just sugar, and as a
matter of fact it is /not/ part of the real .cpp and .h source code
files. They just contain the raw uncolored text.
> Off-off-topic: While I was doing my research into this stuff, I read about 'hex
> editors.' Apparently they can open an executable (.exe) file for editing?? (Not
> in a higher-level language, of course.)
Uh... yes, but such procedure is /not/ recommended in the least. With a
hex editor, you can visualize (and manipulate) the /true/ content of
/any/ file, byte by byte.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka <ano### [at] anonymousorg> wrote:
>
> > Off-off-topic: While I was doing my research into this stuff, I read about
> > 'hex editors.' Apparently they can open an executable (.exe) file for
> > editing?? (Not in a higher-level language, of course.)
>
> Uh... yes, but such procedure is /not/ recommended in the least. With a
> hex editor, you can visualize (and manipulate) the /true/ content of
> /any/ file, byte by byte.
Sounds dangerous (in MANY ways)...especially in my neophyte hands! ;-)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
>
> I'm not sure you understand what program source code is. It's just ascii
> text, like this very text I'm writing and posting here.
Yeah, *that* very thing was an unknown/mysterious concept to me, before now. I
had no idea it would turn out to be so. Kind of magical, actually. (I always
thought POV-Ray's SDL--and its built-in text editor--was a 'special case'!)
Duh!!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|