Register to reply

The Source Code!

by Tenshou
Tags: code, source
Share this thread:
Tenshou
#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
Sapphire talk enlivens guesswork over iPhone 6
Geneticists offer clues to better rice, tomato crops
UConn makes 3-D copies of antique instrument parts
Mark44
#2
Feb14-13, 09:22 AM
Mentor
P: 21,216
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
#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
#4
Feb14-13, 01:11 PM
Admin
Borek's Avatar
P: 23,369
The Source Code!

Looking is definitely OK.
Tenshou
#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
#6
Feb14-13, 04:31 PM
Mentor
P: 11,589
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
#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
#8
Feb15-13, 06:26 PM
PF Gold
Borg's Avatar
P: 759
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
#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
#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
#11
Mar6-13, 07:12 PM
PF Gold
harborsparrow's Avatar
P: 347
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
#12
Mar7-13, 05:09 PM
P: 150
so what good is it then if it can be deciphered?
mfb
#13
Mar8-13, 04:22 AM
Mentor
P: 11,589
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
#14
Mar8-13, 06:13 AM
PF Gold
harborsparrow's Avatar
P: 347
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
#15
Mar8-13, 06:16 AM
PF Gold
harborsparrow's Avatar
P: 347
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
#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