Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The Source Code!

  1. Feb 14, 2013 #1
    Do any of you look at source codes from websites, do you write source codes?
     
  2. jcsd
  3. Feb 14, 2013 #2

    Mark44

    Staff: Mentor

    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?
     
  4. Feb 14, 2013 #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.
     
  5. Feb 14, 2013 #4

    Borek

    User Avatar

    Staff: Mentor

    Looking is definitely OK.
     
  6. Feb 14, 2013 #5
    Cool. :) I have just been so paranoid since all of these strange laws have been passed by the U.S congress.
     
  7. Feb 14, 2013 #6

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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).
     
  8. Feb 14, 2013 #7
    I guess it is javascript code, I just open up the source code tablet and start trying to analyze the code .
     
  9. Feb 15, 2013 #8

    Borg

    User Avatar
    Science Advisor
    Gold Member

    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: Feb 15, 2013
  10. Feb 16, 2013 #9
    Look for copyright or reverse-engineering restrictions if you intend to reuse somebody else's code.
     
  11. Feb 17, 2013 #10
    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?
     
  12. Mar 6, 2013 #11

    harborsparrow

    User Avatar
    Gold Member

    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.
     
  13. Mar 7, 2013 #12
    so what good is it then if it can be deciphered?
     
  14. Mar 8, 2013 #13

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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.
     
  15. Mar 8, 2013 #14

    harborsparrow

    User Avatar
    Gold Member

    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.
     
  16. Mar 8, 2013 #15

    harborsparrow

    User Avatar
    Gold Member

    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.
     
  17. Mar 19, 2013 #16
    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: The Source Code!
  1. Source code of Games (Replies: 8)

Loading...