The Source Code!


by Tenshou
Tags: code, source
Tenshou
Tenshou is offline
#1
Feb14-13, 01:57 AM
P: 150
Do any of you look at source codes from websites, do you write source codes?
Phys.Org News Partner Science news on Phys.org
Better thermal-imaging lens from waste sulfur
Hackathon team's GoogolPlex gives Siri extra powers
Bright points in Sun's atmosphere mark patterns deep in its interior
Mark44
Mark44 is offline
#2
Feb14-13, 09:22 AM
Mentor
P: 20,984
Quote Quote by Tenshou View Post
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?
Tenshou
Tenshou is offline
#3
Feb14-13, 12:50 PM
P: 150
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.

Borek
Borek is offline
#4
Feb14-13, 01:11 PM
Admin
Borek's Avatar
P: 22,670

The Source Code!


Looking is definitely OK.
Tenshou
Tenshou is offline
#5
Feb14-13, 03:33 PM
P: 150
Cool. :) I have just been so paranoid since all of these strange laws have been passed by the U.S congress.
mfb
mfb is offline
#6
Feb14-13, 04:31 PM
Mentor
P: 10,798
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).
Tenshou
Tenshou is offline
#7
Feb14-13, 10:05 PM
P: 150
I guess it is javascript code, I just open up the source code tablet and start trying to analyze the code .
Borg
Borg is offline
#8
Feb15-13, 06:26 PM
PF Gold
Borg's Avatar
P: 728
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.
NemoReally
NemoReally is offline
#9
Feb16-13, 10:00 AM
P: 194
Look for copyright or reverse-engineering restrictions if you intend to reuse somebody else's code.
Tenshou
Tenshou is offline
#10
Feb17-13, 02:47 AM
P: 150
Quote Quote by Borg View Post
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?
harborsparrow
harborsparrow is offline
#11
Mar6-13, 07:12 PM
harborsparrow's Avatar
P: 322
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.
Tenshou
Tenshou is offline
#12
Mar7-13, 05:09 PM
P: 150
so what good is it then if it can be deciphered?
mfb
mfb is offline
#13
Mar8-13, 04:22 AM
Mentor
P: 10,798
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.
harborsparrow
harborsparrow is offline
#14
Mar8-13, 06:13 AM
harborsparrow's Avatar
P: 322
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.
harborsparrow
harborsparrow is offline
#15
Mar8-13, 06:16 AM
harborsparrow's Avatar
P: 322
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.
d3mm
d3mm is offline
#16
Mar19-13, 03:43 PM
P: 139
Quote Quote by Tenshou View Post
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.


Register to reply

Related Discussions
What does the following lines of C source code mean? Engineering, Comp Sci, & Technology Homework 7
compiling source code Engineering, Comp Sci, & Technology Homework 5
Least Squares source code in C++? Linear & Abstract Algebra 5
Source code of Games!!! Programming & Computer Science 8
pac man source code wanted Computing & Technology 0