Wikipedia:Reference desk/Archives/Computing/2019 July 11

From Wikipedia, the free encyclopedia
Computing desk
< July 10 << Jun | July | Aug >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


July 11[edit]

Linux on smartphones.[edit]

Are there any Linux distros for smartphones with 512MB of RAM? — Preceding unsigned comment added by 162.212.13.30 (talk) 01:49, 11 July 2019 (UTC)[reply]

The 512MB RAM is doable, but a problem with cell phones is the resolution you can get on the screen clicks, when using a finger. If you used Linux set to a low resolution, in the 320x200, 320x240, or 640x480 range, that might help, as would using a stylus. Most Linux distros are for a screen wider than it is tall, so you might want to use the cell phone sideways. They would need to add logic to make finger taps map to mouse clicks, but I'm not sure how you would allow for left and right mouse clicks, unless you wanted to hold a button down while tapping one, but that would be awkward to use. Linux also lacks support for zooming by stretching, rotating the screen based on position, etc. Then all the connectivity to the Internet, etc., would need tweeks to work over a mobile phone. But there are several distros available, so they must have figured this all out: [[1]]. Don't know which work with 512MB, though. SinisterLefty (talk) 12:35, 16 July 2019 (UTC)[reply]

JavaScript as a beginner language[edit]

I am new to programming having only taken a few courses on Khan Academy, and a few online HTML courses (which isn't really programming). I've been told by a computer programmer that the best language to start learning (based on usefulness of language compared to difficulty) is JavaScript. The idea is that it is the most useful language that a beginner can actually learn. Would you agree with this assessment? Secondly, is the usefulness of my first language really all that important, or is it better to learn something that I can do well, regardless of its practical applications? --Puzzledvegetable|💬|📧|📜 17:06, 11 July 2019 (UTC)[reply]

  • I wouldn't recommend JavaScript, or at least not without caveats.
There are two main factors to a first language. Will you learn skills that will help you in the future? and: Will it encourage you to actually learn something? (usually by allowing you to complete a particular project you're already interested in). The first of these is important: techniques picked up at the start tend to hang around for a long time. It's sometimes said that programmers only ever learn one language (their first or second) and then just keep writing other programs and languages in that. This is an effect which is very obvious in some people's work (and almost never in a good way!). So when you pick that first language to learn, make it a good one!
I prefer Python as a first teachning language. This is for two reasons: because (only if well taught) it teaches good techniques, secondly because it's a useful language for a wide range of tasks. But then there's plenty of bad Python being taught. As many people, especially youngsters, are learning to code on the Raspberry Pi at present, then Python's also a good fit to that platform.
If someone were to learn PHP first, or BASIC, they'd learn a pile of awful habits too which they'd have to break if they were to get anywhere further. PHP is the prime example of a language which can only be used to the full by someone who really understands how bad it is, and how better other languages would be (which is hardly a recipe for job satisfaction). So really, don't start there.
JavaScript has a couple of distinctive aspects: It's the only language usable for client-side web browser scripting, it's very poorly understood by those coding in it, and it's not only usable for client-side web browser scripting, but it's certainly not common in other tasks (at one time JavaScript was also used server-side scripting, but that's rare now).
So JavaScript can be a great choice: it meets the goal of "delivering my incentive project", provided that's hosted within a web browser (no bad thing). Its drawback is that so few people understand it. Most seriously misunderstand it. It looks like Java, but isn't. It looks like C++ and a squillion other languages too, but isn't. The object orientation model for JavaScript is significantly different and almost no-one bothers to read the manual to find out why, they just write bad code and complain when it goes wrong. I don't think I've seen anyone begin to get it right unless they've read this: Douglas Crockford (2008). JavaScript: The Good Parts. O'Reilly. ISBN 978-0-596-51774-8. (the Butterfly Book), not just any handy JavaScript tutorial off the web, and especially not the Rhino Book.
So go for JavaScript. You'll learn to write things inside browsers, and that's a good thing. But make sure you use a good enough tutorial to really understand what you're doing. Andy Dingley (talk) 17:47, 11 July 2019 (UTC)[reply]
  • I agree with pretty much everything Andy says here. Javascript has been a great starting point for lots of people via Khan Academy, in spite of its various badnesses compared to decent languages like Python. Javascript has the advantage that it's easily available everywhere, and easy to make it do things visual. Python takes a little more setting up to get to an environment that gives you as much quick reward. When you're ready, make the transition. Or get to be good at Javascript and transition to Typescript. Dicklyon (talk) 00:10, 12 July 2019 (UTC)[reply]
  • The basics of programming can be learned in any mainstream language. Later on though, each language has its quirks (or its "philosophy"); if you want to get serious, you need to learn a few to get a better understanding of the various patterns and conditions of use.
An example of such a pattern is checking for error conditions before doing a risky operation. If you learn Python, you are encouraged to instead let the error happen and pick up the pieces afterwards (see e.g. [2]); most languages have some version of exception catching, but few advertise it to beginners/intermediates. Regardless of what language you use, you should be aware that both options exist and have a rough idea of when one is preferred to the other depending on the language but also the problem to solve. TigraanClick here to contact me 08:51, 15 July 2019 (UTC)[reply]