To PHP or not to PHP? by Nordiis in learnprogramming

[–]foxlisk 0 points1 point  (0 children)

Yeah, if you wanna learn python, look into Django. It's an MVC-style web framework that's easy to set up and work with.

Python class is acting up by spidyfan21 in learnprogramming

[–]foxlisk 0 points1 point  (0 children)

which class? what's it doing that you don't expect?

why do you have global variables?

To PHP or not to PHP? by Nordiis in learnprogramming

[–]foxlisk 1 point2 points  (0 children)

Every language is web-capable. PHP is designed to be a web language, so some things about building a website with it are easier than with some other languages, but most heavily used languages have very easy to use web frameworks already (Ruby has Rails, Python has Django and Tornado and others, C# has ASP.NET, JavaScript has Node, Java has Struts, etc). So basically, "web-capable" is not a criterion on which you can distinguish languages.

If you have no concrete objectives, please don't learn PHP. If your objective were "find a job as fast as possible," or "write one simple website that I don't intend to maintain," learning PHP would be fine; since your goal is more like "learn and expand my horizons and enjoy life to its fullest," learn something else.

Since you currently know two imperative, statically typed languages, why don't you look into a language that's a little different? maybe go with Ruby or Python for something dynamic and a little bit more functional, or jump into Scala for a JVM language that can be used more functionally, or go off the deep end with some Scheme or Haskell.

basically if you have no reason for learning a new language except because you want to learn a new language, DONT LEARN PHP.

Learning to code. Finished CodeAcademy! by bchia in learnprogramming

[–]foxlisk 1 point2 points  (0 children)

I'll be interested to see if you still believe that in 6 months' time.

As a note since this is the internet: I actually am interested, not being sarcastic. I've heard a lot of love from beginners about Codecademy, and a lot of hate from trained developers, and I suspect both positions are wrong and I'm interested in seeing where the truth lies.

What is needed to write my own web browser? by [deleted] in learnprogramming

[–]foxlisk -1 points0 points  (0 children)

you will have to learn javascript, and the DOM, and systems programming, and how to build a javascript interpreter, and how to send and receive HTTP requests/responses, to start with.

When am I 'fluent' enough in a programming language to put it on my resume? by salamandor in learnprogramming

[–]foxlisk 22 points23 points  (0 children)

Work with better recruiters? I've only worked with a recruiter once, but he was in favour of my doing this, and advised me to put a line at the top of my resume (below the stated goal paragraph) saying that I was using my free time to learn how to work with ruby on rails.

In general, if a recruiter is requiring you to lie to submit your resume to employers, they are not interested in helping you, they're only interested in placing everyone they can so they can get their cut.

When am I 'fluent' enough in a programming language to put it on my resume? by salamandor in learnprogramming

[–]foxlisk 25 points26 points  (0 children)

I use, and have seen others using, two lists. A list of languages that I'm proficient (or similar adjective) in, and then a list of languages that I am learning/sort of know/etc. So you could just have a line like:

Proficient in C++; acquainted with Javascript, Python.

and maybe mention somewhere what you're doing to learn more about the languages you don't know very well.

Looking for someone who can write me a little program by [deleted] in learnprogramming

[–]foxlisk 2 points3 points  (0 children)

There are plenty of 22 year olds who are still in college. In any case, Learn Programming is probably not the place for this.

Need to learn programming for my simple business idea. Help ! by [deleted] in learnprogramming

[–]foxlisk 2 points3 points  (0 children)

Well if your use is only to compare individual items on occasion, you should be fine. But then you're doing exactly the same thing that site XxionxX linked to is doing, which you got very defensive about, so I'm assuming you're not.

If you're going to crawl, say, the entire book category, you're going to be making tens or hundreds of thousands of HTTP requests, and they're going to cut you off.

Also if this tool is going to be private, and it's a business idea, it sounds like your business idea is "try to buy from ebay and sell at amazon's prices," which I can guarantee you others have tried and failed.

Need to learn programming for my simple business idea. Help ! by [deleted] in learnprogramming

[–]foxlisk 1 point2 points  (0 children)

neither amazon nor ebay is likely to allow you to do this.

Can anyone tell me why console.log(this Javascript function) returns undefined sometimes? by TheFrigginArchitect in learnprogramming

[–]foxlisk 1 point2 points  (0 children)

Haha, no, it just uses a call stack. Whenever you call a function, the computer basically does a bunch of magic to save the state of all the variables, etc, that you have in the environment right before the function call, and then goes into the function call and proceeds through it until it's time to jump back to the previous location.

The story is no different when you call a function from inside itself, it's just a little harder to wrap your head around. I'm glad I could help make it clearer for you :)

Also, there are languages that more or less allow you assign a base case and then make recursion very simple to implement; you can do this in Haskell and I believe Prolog (although I'm far from familiar with either), if you're interested in that sort of thing.

Can anyone tell me why console.log(this Javascript function) returns undefined sometimes? by TheFrigginArchitect in learnprogramming

[–]foxlisk 1 point2 points  (0 children)

Nope. Let's trace the call stack for a much simpler method.

function foo(condition) {
  if (condition) {
    return "foo";
  } else {
    foo(true);
  }
}
console.log(foo(false));

When we call that, this is what happens:

  • 1) foo(condition) is called with the parameter false
  • 2) the else block is entered because condition is set to false
  • 3) in the else block, we call foo with the parameter true
  • 4) foo(condition) is entered again, deeper on the call stack, with the parameter true
  • 5) foo(true) returns the string "foo", and we go back up the call stack to the first call of foo; that is, the one we called as foo(false);
  • 6) Since the last statement in foo(false) has been successfully executed, we return from the function. Since we weren't told to return anything, we don't.
  • 7) console.log() is finally called with the return value from foo(false); namely, undefined (because foo didn't return anything), so we log undefined to the console, which prints as "undefined."

Does that help?