TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What language should I learn first?

22 点作者 mhorne27将近 11 年前
I want to learn to code. Which language should I start with, and why? Just signed up for Codeacademy...

44 条评论

tel将近 11 年前
There will be a thousand opinions. Ignore them.<p>The problem is that you&#x27;re asking the wrong question. If you want to &quot;get into&quot; programming you need to do roughly two things to start.<p><pre><code> 1. Find a reason to care. This can be a pet project, a particular question, an application domain, a partner or team you&#x27;d like to work with, the desire to understand someone&#x27;s work you admire, etc. 2. Learn how to think formally as a programmer. This is sort of like learning how to code, but it&#x27;s different from learning any one language. </code></pre> The point is that as you discover greater passion for something in (1) you&#x27;ll discover greater need for (2). Simultaneously, as you improve (2) you&#x27;ll become more sensitive to (1).<p>The other point is that languages are dumb. There are lots of reasons to learn one or another, but by and large becoming an &quot;X programmer&quot; is a non-goal unless it is somehow required for (1). For instance, joining a team of Ruby programmers may require becoming a Ruby programmer yourself.<p>So, discarding the philosophy, what do I recommend?<p>Learn whatever language you can the most quickly. Then learn another. Python may already be installed on your computer, so you can get started quickly. The story is probably the same for C, Ruby, Java, and Perl. If you know how to launch web pages online then PHP is probably available.<p>Recognize that programming has a large comparative linguistics component. No single language will teach you (2) above, but solving many diverse problems in a single language might get you a lot of it. Studying many languages expands your familiarity with <i>how to represent things</i> and that can be a big boon to (2). Later on in your career, it&#x27;s often very valuable to explore languages with vastly different background models and assumptions. Early on, I&#x27;m not convinced it&#x27;s such a huge deal... so long as you don&#x27;t get stuck with a single choice for too long.<p>And above all, have fun. CS&#x2F;Programming&#x2F;Software is a fascinating world for all kinds of reasons.
joemccall86将近 11 年前
Whatever you choose, learn git along with it. It helps to answer the question, &quot;This used to work, what did I do to break it?&quot;<p>Also, call me sentimental but I learned C&#x2F;C++ as my first language and would recommend it. I don&#x27;t see a codeacademy class for that though, and it&#x27;s not really perfect for web development.<p>If you find that codeacademy isn&#x27;t working out, I&#x27;ve also personally used codeschool.com and had great experiences there.
评论 #8182666 未加载
chrismaeda将近 11 年前
Here&#x27;s my path (~30 years worth).<p>high school:<p><pre><code> basic 6502 assembly a little FORTRAN a little pascal, but didn&#x27;t understand it </code></pre> mit:<p><pre><code> scheme (sicp omfg) symbolics lisp common lisp clu pdp-10 assembly connection machine a little C a little more FORTRAN </code></pre> grad school &#x2F; 90&#x27;s:<p><pre><code> a lot of C (system programming &#x2F; unix kernel hacking) Obj-C &#x2F; NeXTStep (reappears later as OSX &#x2F; iOS platform) MIPS assembly (branch delay slots ftw) x86 assembly (segment registers wtf) ALPHA assembly a little C++, but hated every minute of it Visual Basic </code></pre> dotcom years to present:<p><pre><code> Java C# SQL (Oracle, Sybase, MSSQL, DB2, MySQL, etc) Python (scheme without parens!) ETL platforms (visual programming environments for data manipulation) PHP Obj-C &#x2F; iOS (oh hi, you&#x27;re back) Groovy &#x2F; Grails a little Ruby &#x2F; Rails </code></pre> I&#x27;m a little weird because I did a lot of Lisp early, and then became an OS hacker. Once you can find single-line errors in assembly code, everything else is easy.<p>I learned a lot doing C and assembly; especially the importance of working clean, checking results, and being careful with pointers. Lisp teaches you how good the world can be; C and assembly teach you how to cope with how bad it really gets. However, I&#x27;m not sure I would recommend a new person to spend as much time on this since the world has moved to languages with garbage-collected heap storage.<p>I never cared for the functional languages (ML, etc), mostly because I found the functional programming zealots to be such insufferable bores.<p>If I were starting today, I would start with Java or Ruby, since they are modern OO languages with good deployment options. Once you know these, it&#x27;s easier to &quot;downgrade&quot; to simpler languages like Python, PHP, and JS.<p>But the real takeaway is that you should learn them all.
评论 #8182444 未加载
iamwithnail将近 11 年前
Slightly against the flow here: I chose Python (and Django) when I learned to code (and built our MVP for www.gmbl.io, still a few rough edges - plug, plug) Python&#x27;s GREAT, no doubt, and Django is also very good.<p>But I&#x27;ve repeatedly found myself wishing I&#x27;d gone with Ruby&#x2F;Rails (it was basically a coin toss.) because I&#x27;ve ended up in an environment where everyone else is working in Ruby for their pet projects - and it would be great to be able to tap their knowledge.<p>So, have a look around, what are people you know using? It&#x27;s probably really useful to choose something that your friends know (if any of them code), or that you know there&#x27;s a decent support for in your area - but beyond that, it doesn&#x27;t really matter. And Python&#x27;s really nice.
评论 #8182112 未加载
azdle将近 11 年前
Call me old fashioned, but I&#x27;m going to suggest learning C. It&#x27;s one of the smaller languages around so you&#x27;ll be quickly able to get past the &quot;learning the language syntax&quot; stage and into the &quot;learning to program&quot; stage. It&#x27;s also still one of the most widely used and supported languages out there. It&#x27;s also closer to how computers actually work so you&#x27;ll learn more of what is actually happening when the computer runs your code.<p>Pick up a copy of K&amp;R [1], read enough to do a hello world and start playing.<p>[1] <a href="https://en.wikipedia.org/wiki/The_C_Programming_Language" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_C_Programming_Language</a>
评论 #8182231 未加载
评论 #8182430 未加载
valarauca1将近 11 年前
Python is a good pick.<p>The goal of learning to program shouldn&#x27;t so much be about one language, but learn about the concepts of what variables, control structures, operators, and data structures. So that you can apply them in different languages, and be more flexible.
Argorak将近 11 年前
All languages present on codeacademy are worth learning.<p>But: if you have something in mind you want to build, pick a language and environment that fits it. If you want to code on microcontrollers, python and ruby are not a good idea. Want to build a website? python or ruby + javascript are a great idea! Use something that people commonly use to solve such a problem.<p>Your first implementation will be bad in any case, regardless of language. You will laugh at it in a few years. Rebuild it after a whilse. But thats no problem: everyone of us went through this process.
PeterWhittaker将近 11 年前
What are your short, medium, and long term goals? How much do you understand about how computers and networks work?<p>If you want to start by creating web pages but eventually move to programming, learn HTML. Get really, really good at it - but without CSS. Then learn CSS, and learn how they work together, how they complement each other. Then add Javacript and DOM manipulation. You can do some very cool stuff, you&#x27;ll learn a lot of logic along the way, make interesting mistakes, etc.<p>If you want to control a computer, get something that speaks Bourne shell (OSX, Linux, etc.) and get really, really good at defensive-minded shell scripting (by defensive-minded I mean always being alert for errors, always quoting variables, always checking return codes, etc.). You will learn a lot about how computers work, how they are structured, etc.<p>In both cases, you will also begin to feel the frustrations of working with these tools: Why doesn&#x27;t this work, why is this so hard, etc., etc.<p>You could start with something more modern, more powerful, like Python or PHP or Ruby, but will you appreciate their power if you don&#x27;t have a good understanding of the problems they were created to solve?<p>But that may not matter, if you want to build web apps using powerful modern frameworks. Where are coming from, where do you want to go?<p>There are many, many other ways to answer the question, depending on what it is you actually want to accomplish and how much you understand about how computers work.
fnordsensei将近 11 年前
It depends what your goal is. Do you want to learn to be a good programmer, or are you looking to, for example, make a website as soon as possible? Is your vision to eventually make apps? Do you want to learn the &quot;art&quot; of programming or the &quot;craft&quot; of programming? You&#x27;ll end up learning both if you pursue it, but this may impact where you start out.<p>Some people argue that starting with a functional language will make you a better object oriented programmer later on, while the reverse is less often true. If you believe in this, I would recommend Clojure from personal experience.<p>In my first programming courses at university, we used Lisp and ML. This was for learning the &quot;art&quot; of programming, i.e., learning to think like a programmer. Once you picked a course that was arguably more about the &quot;craft&quot;, you were exposed to a language more native to the domain. As I choose to go towards front end related stuff, I was exposed to JavaScript and (at the time) ActionScript.<p>I ended up not working as a programmer; I&#x27;m UX designer. When I need to, I program most of my interactive prototypes in ClojureScript. Two years ago, that would have been JS, but I found that Clojure conforms to my thoughts rather than the other way around.<p>So, depending on where you are and where you are going, you might benefit from different advice, I think.
dennybritz将近 11 年前
It doesn&#x27;t really matter, but Python is a good choice. It&#x27;s intuitive, has a great ecosystem, and lots of different practical applications.
pavlov将近 11 年前
How about learning BASIC first?<p>You&#x27;ll hear people say that exposure to BASIC will rot your mind... But most of today&#x27;s best programmers started out with BASIC simply because that&#x27;s what you got when you started up a 1976-86 vintage microcomputer or played with MS-DOS. Clearly they were not permanently damaged by it.<p>The good thing about learning BASIC is that you won&#x27;t be accidentally comparing your work to that of professional programmers. If you start with JavaScript, you&#x27;ll be exposed to amazing JS tricks anywhere you look. Any Google search or &quot;View Source&quot; will show you stuff that you&#x27;ll be struggling to understand. That can be very discouraging.<p>Here&#x27;s a totally retro web-based BASIC environment:<p><a href="http://www.quitebasic.com/" rel="nofollow">http:&#x2F;&#x2F;www.quitebasic.com&#x2F;</a><p>There are of course much better modern BASICs around, e.g. Microsoft&#x27;s Small Basic (<a href="http://en.wikipedia.org/wiki/Microsoft_Small_Basic" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Microsoft_Small_Basic</a>).
projectramo将近 11 年前
I am sure others are going say, or have said, something similar:<p>If you had to learn a <i>second</i> language, the question has many great candidates for answers. Python, Ruby, Scala, or a more functional language. Maybe a rapid prototyping language. If you believe in mobile first, then Swift, or Objective-C, or Java. If you need to manipulate data then Python, R or Julia. If you believe that you should learn the &quot;foundations&quot; first (read: legacy language) you could go back to C. If you like the Microsoft ecosystem, C#. If you work with Excel (what a beautiful product) then VBA and so forth.<p>But if you want the first language, then I think the answer is simple: Javascript.<p>I think it is an ugly language, and I wish another language had become to dominant, but history is what it is. Its in the browser, and so it is everywhere. You have to work with it for the most interfaces anyway.<p>A little sooner, and I am sure this would start a mini flame war, but as it is, this comment is safely tucked down the chain.
spot将近 11 年前
javascript because<p>1) you can program anywhere, 2) it has incredible libraries for multimedia and interaction which makes it fun, 3) you can share the results with one click to anyone 4) it is a highly marketable skill<p>a lot of other people are recommending python which is fine if you are into the command line and file IO. if you prefer the web, then JS is the way to go.
porter将近 11 年前
Python. Just pick it and move on.
yk将近 11 年前
Does not matter, you will pick the wrong one. Thing is you will always regret not coding in X because of feature Y, when you actually have a project. On the other hand, you will not notice all the times that features A, B and C of your language of choice are helpful. So at least subjectively, another language would have been better.<p>As actual advice, it depends on your goals. If you want to build websites, then you should start with Java Script and perhaps another language for the backend. If you want to understand computer systems on a fundamental level or hack the Linux kernel, then you should pick C. And if you want to see progress, pick Python. But it is not too important, since a large part of programming is language agnostic. So just pick one, and learn another when the pain becomes unbearable. ( Then return to the first one, once you realize your mistake.)
rafaelm将近 11 年前
What do you want to achieve when you learn how to program? Mobile dev, web dev?<p>I&#x27;m on a similar path. I&#x27;ve been learning to code now for like 3 years, never really having the time. Now that I&#x27;m out of a job, I&#x27;ve got some free time and I&#x27;ve always had some web projects I wanted to work on. So even though I&#x27;ve been trying to learn python for the past 3 years, I&#x27;ve recently started following the reddit learnjavascript course that started last week [1]<p>I figured that with JS, I can learn Node.js and have some frontend and backend knowledge as well. Maybe someone much more knowledgeable than me can chime in on my approach?<p>[1]-<a href="http://www.reddit.com/r/learnjavascript/comments/2c5aue/learn_javascript_august_2014_session_omnibus/" rel="nofollow">http:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;learnjavascript&#x2F;comments&#x2F;2c5aue&#x2F;lear...</a>
dragonwriter将近 11 年前
I&#x27;d lean slightly toward recommending Python to beginners, but don&#x27;t get stuck on whatever you learn first. Try to learn at least one new language a year till you have several under your belt -- and even then, its not a bad idea to continue to do that.<p>And try to mix families -- each provides different insights. The first few might be something like:<p>1. One of Python or Ruby 2. JavaScript 3. One of Java or C# 4. Erlang 5. C&#x2F;C++ 6. One of Haskell, Scala, F#, or OCaml (but I&#x27;d lean heavily toward Haskell)<p>(Also, if you are going to use relational databases, learn SQL -- yes, there are frameworks that abstract it largely away for you, but you <i>really</i> want to understand what&#x27;s going on behind the scenes. But that doesn&#x27;t need to be in among the first things, unless heavily RDBMS-dependent stuff is going to be an initial focus...)
评论 #8182439 未加载
orclev将近 11 年前
For serious work, starting with something like Python is probably a good idea (as many people have suggested), but if your goal is to learn about programming, I&#x27;d actually suggest you start with assembly. Assembly is really tedious to do anything practical with, but as a way to understand some of the most fundamental concepts in programming it really can&#x27;t be beat. Doing the equivalent of hello world, in assembly and really understanding exactly what each line of the program is doing will pretty much make you better than most newbie programmers right from the start. If you jump to C next, do a little bit more there, and then finally jump to something like Python (bonus credit for calling C code from Python and vice versa) you&#x27;ll be well on your way to being a fairly well rounded programmer.
评论 #8182180 未加载
facorreia将近 11 年前
I believe that you can&#x27;t go really wrong with any of the languages offered at Codecademy. If you have to pick one I would suggest JavaScript. It&#x27;s not uncommon for projects to involve another language + JavaScript, so the syntax knowledge should be useful for years.
评论 #8182130 未加载
评论 #8181974 未加载
agxbr将近 11 年前
Doesn&#x27;t matter, pick one and move your focus to algorithms and data structures.
评论 #8182134 未加载
lsiebert将近 11 年前
Why do you want to learn to code is a detail you left out, that&#x27;s very important.<p>It&#x27;s like saying, I want to learn to drive: If you are going to be a trucker, that&#x27;s going to mean something different from being a biker.<p>I&#x27;d recommend Python as a first language. It wasn&#x27;t my first language, but it&#x27;s general purpose enough that you can do a lot with it, and popular enough that you can interview&#x2F;get work&#x2F;meet other people who use it. Oh and it runs from the command line straight off, and you are going to want to learn a bit about the command line.
aaachilless将近 11 年前
When you don&#x27;t have a Jeep, don&#x27;t take the shortcut that runs through the jungle. You&#x27;re goal should be to keep moving and not get discouraged when you get stuck on something. I would learn a language that lets you take the highway instead of the shorter but trickier jungle road. Ruby, Python, Basic, and Javascript could be considered &quot;highway&quot; languages while C, C++, Java, and most other languages could be considered &quot;jungle shortcut&quot; languages.
jameskilton将近 11 年前
If you want to jump in and go, I highly recommend Ruby, though I will warn that Rails can be very imposing if you aren&#x27;t familiar with web development already.<p>If you want to understand more low level concepts, you can never go wrong with C, and these days Rust is a good choice for that as well (though steep learning curve if you have no previous experience).
vkjv将近 11 年前
C. It&#x27;s low enough that you don&#x27;t get to skip out on core concepts. I notice a lot of younger programmers who have only used high level languages use inappropriate data types because they do not understand the implications of their choices.<p>It&#x27;s also high level enough that you won&#x27;t waste time in minutia of just making something work.
moron4hire将近 11 年前
JavaScript. Why?<p>Extremely low barrier to entry: you already have everything you need.<p>Results are immediate: you don&#x27;t have to wait around for an app approval process to share your stuff.<p>It sucks: teaching a healthy respect for learning a language <i>well</i> and finding all of the pitfalls. Every language has them. Best not to start out assuming they don&#x27;t.
kp25将近 11 年前
Python + Django, Ruby + Rails, Javascript + Nodejs..<p>Most people are in love with Python, Not everyone. You may or may not love it, So try experimenting and choose the one.<p>Codecademy is good place to learn syntax and language basics, but books are the best choice to improve your skills.<p>Never stop learning, Try some Open Source Project, You&#x27;ll learn much more..<p>Have Fun, Good Luck
fdik将近 11 年前
<a href="https://docs.python.org/3/tutorial/index.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;tutorial&#x2F;index.html</a><p>It&#x27;s very easy to learn, at the same time a very good language to be capable of writing code. It&#x27;s multi paradigm, so you can learn a lot of different things.
jimktrains2将近 11 年前
Whichever language you choose, pick a project you want to do with it. I find that having a goal, even a silly or small one, presses me through some of the more frustrating parts of learning a language and the time commitment it brings.
aioprisan将近 11 年前
Pick JavaScript or Ruby. JS because you can go full stack and can move on from some client-side work to full stack pretty easily with node.js. Ruby because it had beautiful data structures and I&#x27;m not a fan of forced whitespacing.
dyeje将近 11 年前
Whichever one looks interesting. Once you get one down, picking others ones up isn&#x27;t as challenging. The important thing is keeping your motivation up, so pick one that excites or intrigues you if possible.
davewiner将近 11 年前
Why JavaScript is the language to learn.<p><a href="http://scripting.com/2014/08/15/whatLanguageToLearn.html" rel="nofollow">http:&#x2F;&#x2F;scripting.com&#x2F;2014&#x2F;08&#x2F;15&#x2F;whatLanguageToLearn.html</a>
cratermoon将近 11 年前
LISP, using Peter Seibel&#x27;s book &quot;Practical Common LISP&quot;: <a href="https://cmdev.com/isbn/1430242906" rel="nofollow">https:&#x2F;&#x2F;cmdev.com&#x2F;isbn&#x2F;1430242906</a>
kasperset将近 11 年前
I guess this will also help- <a href="http://www.charlespetzold.com/code/" rel="nofollow">http:&#x2F;&#x2F;www.charlespetzold.com&#x2F;code&#x2F;</a>
评论 #8182417 未加载
ingend88将近 11 年前
I started learning with Python and then HTML, CSS, JS with Angular+Firebase! This allows you to start building stuff right away.
cafard将近 11 年前
What is your preferred computer? If Windows, then I must agree with myddle&#x27;s recommendation of Python.
评论 #8182108 未加载
评论 #8182093 未加载
nyddle将近 11 年前
Python seems like a good choice as it is simple and can be used in a wide variety of applications.
Artemis2将近 11 年前
Python would be a good choice since it&#x27;s easy to learn but very powerful.
davewiner将近 11 年前
JavaScript. Everyone has the runtime already installed.
osconfused将近 11 年前
Learn Swift. Mobile is the future.
评论 #8182121 未加载
评论 #8182142 未加载
评论 #8182247 未加载
评论 #8182117 未加载
tvirelli将近 11 年前
Why is everyone hating on PHP?
Pururim将近 11 年前
Pascal.
obeid将近 11 年前
Python
gb2312将近 11 年前
c#是我第一个学的语言。
renang将近 11 年前
Pseudocode is a good start unless you already have a project in mind?<p>Remember there is no one-language-solves-all-problems, you gotta pick the right tool for the job and you shouldn&#x27;t be afraid to hop between those tools.
评论 #8182777 未加载
评论 #8182778 未加载