Exploring Source Codes: A Guide for Viewing & Writing

In summary, looking at source code from websites is OK, but it is illegal to look at the source code of websites that you do not own the rights to.
  • #1
Tenshou
153
1
Do any of you look at source codes from websites, do you write source codes?
 
Technology news on Phys.org
  • #2
Tenshou said:
Do any of you look at source codes from websites, do you write source codes?
That's a very silly question to ask in a forum section that is devoted to programming and computer science.

Speaking for myself, I spend a good part of my workdays looking at and writing source code (not source codes) in a number of languages, but primarily C#, JavaScript, and jQuery these days.

What's your point in asking?
 
  • #3
I am just wondering it is illegal to look at websites source codes, like is there some type of freedom of information law I am violating >.< . Although I do have a hard time reading it I think the ability in reading it is getting better the more I do it.
 
  • #4
Looking is definitely OK.
 
  • #5
Cool. :) I have just been so paranoid since all of these strange laws have been passed by the U.S congress.
 
  • #6
Do you mean the HTML/Javascript code? Your browser does this anyway.
PHP code? Normally, you should not have access to this (unless the site made it public or you manage that site in some way).
 
  • #7
I guess it is javascript code, I just open up the source code tablet and start trying to analyze the code .
 
  • #8
I look at source code all the time. That's how I know what parts of sites I want to block. I also find it interesting to see how clean code is from one site to another. Attention to detail says a lot about the programmers.
 
Last edited:
  • #9
Look for copyright or reverse-engineering restrictions if you intend to reuse somebody else's code.
 
  • #10
Borg said:
I look at source code all the time. That's how I know what parts of sites I want to block. I also find it interesting to see how clean code is from one site to another. Attention to detail says a lot about the programmers.

I do agree! Although I am still an amateur in coding I do wish to be come better can you guys give me some tips on becoming a better programmer?
 
  • #11
The fact is, Javascript source code cannot be hidden from end users. It can be obfuscated and compressed, but with patience, an end user could always decipher it in the end.

This is one reason why server-side languages may sometimes be used for computations instead of Javascript.
 
  • #12
so what good is it then if it can be deciphered?
 
  • #13
The purpose of JavaScript is not to do something in secret. JavaScript helps to create active elements in websites, it can calculate things for you and so on.
Database access and similar things must be done somewhere else (like php scripts, for example).

It can be an issue that you can steal code, and re-use it on other sites.
 
  • #14
The visibility of Javascript code to end users is why, these days, few games are developed and distributed using Javascript, although technically, it is a decent platform for games. Instead, web-based games (at least for some years) were developed using Java applets or flash or other technologies instead, because the code was harder for end users to get at.
 
  • #15
In many ways, the visibility of Javascript code is good, because, as noted above, people were able to see how others did things, like image rollovers, and then go and do them on their own sites. Nowadays, production environments will use a library such as jQuery instead of raw Javascript, because the library will take care of ensuring that browser differences are compensated for. jQuery is the most popular, and for anything other than very minor web page tweaking, a Javascript library should be used.
 
  • #16
Tenshou said:
so what good is it then if it can be deciphered?

Most of the web now is open source. People give their code away with some restrictions, as it allows others to build on top of it.

This forum is vbulletin (source code available) which is written in php (source code available) and hosted on Linux servers (source code available). I don't know what the license for vbulletin is (I think it's proprietary in that you get the code but can't redistribute it), but php and linux are both fully open source: you may modify the source code to use in your own projects and redistribute those projects.
 

1. What is the purpose of exploring source codes?

The purpose of exploring source codes is to gain a deeper understanding of how software and computer programs are created and how they function. By viewing and writing source codes, scientists can analyze and improve existing programs or develop new ones.

2. How can exploring source codes benefit scientists?

Exploring source codes can benefit scientists by allowing them to gain insights into the underlying algorithms and logic used in software development. This can help them to improve their own coding skills and develop more efficient and effective programs.

3. What are some common tools used for viewing and writing source codes?

Some common tools used for viewing and writing source codes include integrated development environments (IDEs) such as Visual Studio and Eclipse, text editors like Sublime Text and Atom, and version control systems like Git and SVN.

4. Are there any precautions to take when exploring source codes?

Yes, it is important to have a good understanding of the programming language used in the source code and to follow best practices to avoid introducing errors or bugs. It is also important to respect any licensing agreements and copyright laws when using and modifying source codes.

5. How can scientists improve their source code exploration skills?

To improve source code exploration skills, scientists can practice regularly, study and analyze well-written code, and participate in coding communities and forums. They can also attend workshops and training sessions to learn about new tools and techniques for exploring source codes.

Similar threads

  • Programming and Computer Science
Replies
7
Views
626
  • Programming and Computer Science
Replies
6
Views
685
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
1
Views
610
  • Programming and Computer Science
Replies
2
Views
757
Replies
3
Views
984
  • Programming and Computer Science
Replies
32
Views
2K
  • Programming and Computer Science
Replies
4
Views
1K
Back
Top