Placeholder Image

字幕表 動画を再生する

  • All right.

  • Hello, world.

  • This is CS 50 on Twitch.

  • My name is Colton Ogden.

  • On today, we're going to venture again into Web development.

  • So last dream, we implemented cookie clicker.

  • We had an amazing community created game that we also showcased at the end, eh?

  • So thanks again to all the folks involved in doing that as the Andre Bella, and it ain t That was awesome.

  • Today we're stepping away from games, and we're going to start talking about one of the most popular programming languages in the world today.

  • In that language is JavaScript Days stream is going to be a little on the basic sides.

  • We're only going to be covering the very basics.

  • The syntax will do some basic Dom manipulation, and then we'll load boot, strap up with JavaScript and take a look at how it changes once we actually start integrating that versus just the CSS part of bootstrap shots.

  • Everybody in the chat.

  • We have a bunch of people that are super excited, apparently to learn javascript today.

  • So they'll 099 a feast.

  • Rahul, Ron Jon Szymanowski.

  • Black beard 01 kinetic Kandra killer Om Whip Street 23 saying.

  • And that's Nate saying that they're very excited to learn JavaScript, Nate's been featured on stream before is showing his age team Oh, and CSS Project When we did our code review stream.

  • So stay tuned for some more of those in the near future on then as Leah's.

  • Well, thanks for tuning in everybody row asking.

  • How is your birthday?

  • Birthday was awesome.

  • Just kind of hung out.

  • Kept a kind of mellow Um, the folks that I just mentioned put together an awesome If you haven't watched the last dream that cookie clicker stream where they put together that game, that happy birthday game was super awesome.

  • So check out that last strain the last 20 minutes or so the cookie clique of shame.

  • It's here on twitch.

  • Still, at the time of this recording on if you're watching this on YouTube, it will be in the YouTube video.

  • Um and yeah, it was it was awesome.

  • I was kind of blown away a little bit speechless when I actually watched it.

  • Now we have lots of people.

  • We have folks from Yemen from turkey.

  • Um, got folks from, um India book from all over the world.

  • thanks so much everybody for tuning in.

  • Let's, uh, talk about I guess some folks someone's asking What's the agenda for today?

  • Stream Today stream.

  • We're going to be covering kind of the syntax of Java script and a few small examples to start off some basic prompts.

  • We're going to implement a to do list that to do this is going to be in just pure sort of consul Java script.

  • Gonna be using prompts and alerts while I'm not pure consul.

  • In that sense, we're gonna be using prompts on alerts.

  • We're going to implement a basic to do list.

  • We're gonna output that to do list so we can showcase things like a raise on dhe for each.

  • And then we're going to go into making a version of the to do list in the dom.

  • So actually using it with things like document create element, a pen child actually integrating JavaScript with the visuals of the HTML so that we can actually start looking at dynamic website content creation.

  • They want to create that to do list, will fire a bootstrap will take a look at some of the components.

  • Let's take a look at how they change once the actually see the post op job script integrated on that will probably be it for today.

  • Stream and then expect Maur streams in the sort of javascript ecosystem in the near future.

  • We may also cover things like No Js.

  • We'll have a sweet stream on Jake.

  • Weary in the near future, bootstrap also uses Jake very intimately.

  • So we have a long ways to go with.

  • This will lay a nice foundation, especially for folks who have not used JavaScript in the past.

  • Shadows thanks to blitz ale 099 Danowski.

  • Why, mm H cramps Lowell saw tm and Taha Ahmed Taha are honey.

  • Pronounce that Taha man 80.

  • Thank you very much for the follows.

  • So let's go ahead and transition over to my laptop here.

  • So if I press this key over here you see, I'm in Google and just let me move this on the screen just a little bit so that I can see what I'm doing as well with all of you.

  • Make sure Sandy checking my set up here.

  • So the nice thing about Google chrome that makes it super nice and easy to develop stuff is oh and I also should quit this as well.

  • That was the music that we were playing at the start of the stream.

  • Google actually lets you use the chrome developer tools to actually code in your browser, which is pretty cool.

  • So if you want to test Web pages that already are loaded, or maybe your own Web pages and actually manipulate the Java script, this is something that's super useful.

  • And to do this and I actually used to the short cuts off hand.

  • I'm not 100% what the menu said it is, But I can sort of guess that I want a view.

  • First of all, let's close it so we can start sort of with a clean palace.

  • Assume that you've opened up a new chrome window.

  • Good view.

  • It looks like developer and then developer tools.

  • If you're on a Mac, it's option command.

  • I and I believe it's control Shift I on a Windows machine.

  • I click developer tools here.

  • This we've looked at in the past, for example, the elements of you where you can see all the days you can see all of the H two elements than the classes and ideas and all that.

  • The console is where you can actually look at the Java script, not that's actively executing, but you can look at the Java script.

  • You can examine any of the Java script objects and variables that exist in that Web page.

  • So, for example, I could counsel dot log whatever I want.

  • If I let's see if I if Jake worries loaded in here, it looks like it is so Dollar Sign is typically Jake worries what Jake Worry is assigned to on dhe.

  • Most other libraries don't really mess with that.

  • It looks like if I'm not mistaken, that's this.

  • F means that that's a function in Java.

  • Script set of Objects are Functions It's kind of a weird thing, but Java script looks like has loaded Jake worry here in this context.

  • Um, and you could do a whole bunch of stuff, get counseled out, log my name if I wanted Thio cold, Tim like that and it does output.

  • Colton, I could, uh, I could do 1234 Each function council dot Log on this actually should take in an e confidante.

  • Luck either should work if I'm not mistaken.

  • Uh, might have missed that council dot le Oh, did I?

  • Oh, did I miss this up?

  • Maybe it's Travis.

  • Normally, this should work.

  • I might have screwed this up.

  • Oh, the, uh right this.

  • Let's try that.

  • Here we go.

  • You can see that I've done in federation over an array.

  • This is sort of a thing that you might have seen if you're coming from CS 50 and you looked at sea or other languages like Python, we have lists you can actually literate over a list using this function called for each.

  • We'll take a look at that in the near future.

  • But you can see that I have output in my Web browser and the ability to sort of create code, you know, using an i.

  • D.

  • That's not terribly great, a sort of text editor.

  • That's not particularly great, cause it's kind of this is more like a what's called a rebel.

  • So read, evaluate, print and loop where it's sort of allows you to one line at a time.

  • And this is what you get with Python sort of interpretive Lee program.

  • But generally this is not something that you would do for a large program.

  • This is only for testing.

  • Generally speaking, um, let me go ahead and, um, read the chat here, so I never got to understand someone.

  • Kins has never got to understand that Dom thing.

  • Can't wait to get the thing done.

  • Yes, so the dawn will take a look at that document.

  • Object model is just a way of representing.

  • It's the way the Web browser sort of represents your Web page in memory in a tree.

  • And so we'll see how that how that works, at least in terms of how we can manipulate it using some basic functions that are a part of most Web browsers, come with all these functions by default.

  • And so that is what Dom scripting is.

  • Just another anti anti player.

  • I just turn this dream.

  • What is your qualifications?

  • Do you have any reference?

  • I mean, sorry.

  • Let me read the rest of it.

  • Saying this is CS 50 is a bold statement.

  • Interesting.

  • Um, so I've been programming for maybe 11 12 years now.

  • A long time, A good amount of time I worked with CS 56.

  • 50 is Harvard's introduction to computer science, and it's taught by David Malin.

  • I work alongside David Malin.

  • We started this twitch stream, Mr Even Offshoot.

  • My specialty is more in game development, not necessarily as much into Web development, but as a sort of an exercise for myself and also just to sort of help, um, provide useful content for more of our audience who isn't necessarily into game development.

  • We've been doing more Web catered streams, so that's essentially our qualification.

  • Just lots of experience, lots of programming.

  • But I am not a Java script expert, not even nearly close.

  • But I completely understand your your question there.

  • Um, I just don't want other people to think they get a good education, but the guy does not know any interesting.

  • So it brings up the question of how do you define qualification, I suppose, in the domain in which you're necessarily looking to get tutelage.

  • So I would say if somebody were asking me to maybe teach them how to develop an enterprise level application in Java script, a friend and maybe something built in react that scaled to millions of end users.

  • I certainly probably wouldn't be qualified to do something like that because I haven't necessarily developed anything like that or have the insight and does something like that and all the design considerations.

  • But if you're looking for maybe something along the lines of just showing people how to get started, the basics, how to think in terms of basic programming and computation, I would say that's something that somebody with the right level of experience is certainly capable of doing, and that's pretty much the best that I at least personally can offer.

  • But many of the folks that I work with have, I would say academically, more qualifications tonight is certainly David at least has a PhD and, uh, on a sandal at this 0.20 years of teaching experience.

  • So it just depends on your perspective, I suppose if you're a software engineer, um, and are looking to get some value out of this dream, you probably won't because you yourself probably have the same level if not Maur level of experience than I do.

  • But, um, you know, it's all relative at the end of the day, as long as we can hopefully get some people boot strapped into the basics of Java script, interacting with Web pages, making some simple APS, then we'll consider a success currently taking a diploma in game development, says Tempus Station.

  • Do you know how easy it is to switch over to software and application development?

  • Um, game development is kind of a specialized beast, but I would say that for my experience, having general software and application development transfers over to game development games are sort of a very monstrous type of application that with a lot of complications, especially when you're dealing with real time feedback to your end users on day, reliable feedback you know not having stuttering frames.

  • There's a lot of design decisions that go into implementing engines, modern game engines, things like unity and un riel.

  • And it could be tough.

  • Two.

  • It could be tough designing games on making them feel good in a way that's not generally approached in other realms of software development.

  • So I don't know.

  • I would say that games are probably a special class of application development.

  • Um, but yeah, just another anti anti player.

  • Okay, that sounds good.

  • I like that honest answer.

  • I think setting up a short description for this dream about you and who you are would greatly benefit new viewers to know what to expect.

  • That's fair.

  • We could certainly, um, we could certainly introduce that.

  • We have a much larger following, so see us.

  • But he has a very large following across platforms like Facebook and YouTube.

  • If you go to youtube dot com slash CS 50 on, and I'm gonna assume that you might not be necessary familiar with our work, but go to youtube dot com slash CS 50.

  • Go to facebook dot com slash CS 50 and you'll see there.

  • We have established a larger audience in a larger sort of portfolio of projects and and videos.

  • David Malin has produced many years worth of full course content.

  • Seems fifties course content.

  • So take a look at that.

  • That's Maura, I guess where our pedigree is established on twitch it's nor platform for us.

  • We might not necessarily have that spread.

  • So I understand where you're coming from.

  • I think we could definitely benefit from that.

  • Um, Francis 37 45.

  • Not your qualifications have to be mentioned.

  • You're going through the basics, which is great for beginners.

  • Although from experience, the twitch community is really not suitable for developers.

  • Um, yeah.

  • I mean, I think Thio anti anti players point.

  • I think, definitely having a little bit more at least textual information here.

  • If it could be beneficial.

  • I do see where he's coming from.

  • He or she is coming from and definitely understand the twitch not being necessarily suitable for developers.

  • Um, I I'm disinclined to sort of impose that umm expectation or stereotype on the touch community.

  • I think maybe the church community has been more cater towards game development.

  • I'm sorry towards game playing and streaming and things like that, but sort of bucket izing it and saying, You know, those twitch isn't suitable for development is not suitable for thio programming tutorials.

  • I I'm I don't feel sort of pleased, you know, sort of furthering that kind of expectation.

  • I think we should definitely push expectations and trying new things experiment as much as we can on Bean.

  • There's plenty of channels which don't even do a lot of game development.

  • You know all of the just chatting channels in which, actually, so far the stream has followed that format, I think more strictly but but yet shows your browser histories is a black widow one Hey, this is a test account.

  • So there is nothing.

  • There is nothing shady hate.

  • Not that there's anything shady on my regular account, either.

  • You know, just for the record, as they say, 12 years, I'll never catch up.

  • No, absolutely.

  • You will definitely catch up and 12 years.

  • I say that.

  • And I mean some years are better than others.

  • You could be programming for 12 years and have a year where you're kind of just like, not really learning a lot.

  • And then you can have a year where you're just really focused on learning and getting new, getting comfortable through environments, new libraries, new languages, new tools.

  • New, uh, new mathematical frameworks.

  • So 12 years is kind of a relative thing is someone's two years spent well might be more valuable than someone's 12 years spent poorly and being surrounded by the incredibly smart people here at Harvard.

  • It's become very clear how true that is to me.

  • General question, says Raccoon.

  • Why would one use an I.

  • D.

  • E over a text editor and vice versa?

  • Ideas like Eclipse offer so much functionality, so I don't understand why someone would use a text editor instead, I think it comes down to personal taste.

  • Ultimately, it depends on where you could be most productive and where you can enjoy a programming the most.

  • I personally prefer developing in the S code.

  • And I'm gonna fire up the S code now, just so that we can at least sort of get one step in the direction of actually programming on.

  • And this is the code base that we're looking at last year, the cookie clicker code base.

  • I'm gonna create a brand new project here.

  • Um, actually, let's go ahead and create the actual project, which would be in here, Dev streams.

  • And this will be Java script.

  • And I'm actually gonna just drag this right on over to here so that it opens up.

  • I like the S code.

  • I like text Editor is generally speaking more than ideas personally, but I can't argue with the fact that ideas like Eclipse, like net beans like Intel Ajay, offer a ton of functionality to developers that are working especially in statically typed environments, the Java based R C sharp based environments.

  • Even when programming in unity and using something model developer visual studio, it's usually pretty beneficial.

  • Having code completion and Intel a sense and other sort of features like that profiling and debugging functionalities.

  • Super useful when your programming in a statically type language and you want to get the most performance machine game development.

  • That's where I've seen it the most.

  • But it's used all across the board.

  • Um, I used ideas for a long time, and then I ended up finding that I didn't like how heavy weight they were.

  • There's so much magic going on.

  • I like being close to my code and close to the process, the development process.

  • And so I personally enjoy programming in the night in a text editor and V s code and GS Code kind of has a hybrid sort of I d functionality.

  • It has debugging functionality.

  • It has a great plug in system.

  • Um, it hasn't tell a sense.

  • So you get code signature sort of stuff off the gate and variable completion and a lot of really cool stuff built into it that you don't get with something very simple.

  • A simple text editor, Um, but it's it's ultimately really up to you.

  • I would say.

  • Do what you feel better with if you get more productivity out of an I d.

  • Use an I d.

  • If you enjoy using something like Sublime or V S Code or Vim or E Max, then use those because ultimately you being more productive is what's most important.

  • But that's an excellent question.

  • Thanks I couldn't bury for the question.

  • The game zone says you should ignore the trolls in the chat, and I wouldn't recommend the chat be on the screen.

  • This is good stuff.

  • And even the young students can get something out of this, um, to veer to your point, I would say I would say a, uh, trolls can be poisonous, but I don't think the question asked about was a troll.

  • I think he actually was.

  • They actually were bringing up honest concern.

  • And so I actually don't mind questions like that, questions that sort of ask for accountability and for credentials and sort of that sort of thing.

  • I think people have every right to be concerned about this and are curious and really want to know.

  • Are they getting a good amount of value out of the people there watching?

  • Can they expect to be taught the correct information?

  • And certainly I might get things wrong, but hopefully, at least by teaching these streams well, get a sense of how you can go out.

  • At least figure things out on your own and get the sense of how to program and Google and stack overflow and all sorts of other resources, uh, to carry you into your training as a Web developer or any other developer game developer.

  • Perhaps if you paid attention to the game development streams, If I'm trained in C++, how easy is it to pick up other languages?

  • I've heard people say it's easy all the time, but I have my doubts.

  • C++ is a pretty crazy language.

  • It's very powerful and very flexible.

  • It's also extremely complicated relative to other programming.

  • Languages has a 1,000,000 different the syntactical things you can do with it.

  • It hasn't a tremendously expansive standard library.

  • It's a very easy language to screw up in because it does allow manual memory management, although with smart pointers, you can sort of circumvent that.

  • To a degree, I'm not a C plus plus expert.

  • So down the rabbit hole of C++, I can't necessarily vouch.

  • But if you're good at c++ than almost, I would say any other programming languages is probably pretty approachable, something like Java scripts and like iPhone.

  • If you're not used to dynamic programming languages, it might be a bit of a culture shock for you to go in from c++ or C toe environment, where you just have to save our equals bar.

  • Something equals something or let something evil something and not say Oh, this needs to be in This is belong to bite.

  • It seems to be a short This needs to be unsigned in 32.

  • There's a lot of sort of, um, different ways of thinking in dynamic versus statically type languages.

  • So I would say Probably dip your toe a little bit, try python, maybe first pythons a very approachable language, then learn JavaScript, then learned Ruby.

  • Maybe if that's something of interest to you.

  • Lots of languages, lots of paradigms.

  • What's the prerequisite?

  • Before learning, JavaScript asked to a car.

  • Not really much of a formal prerequisite.

  • I would say having some programming experience will be helpful, but we're going to sort of assume the very basics, and actually at the expense are to sort of prevent us from taking too long to actually getting into coding stuff.

  • Let's do the very first step into actually getting a job script, app, up and running jobs get program up and running, and that's having an index that HTML to hoist our job a script into and actually run it.

  • So we've done this before.

  • We've had HTML streams and CSS streams and bootstrap stream, so this should be pretty pretty standard if you're turning in for the very first time.

  • Maybe you're not familiar with the world of Web programming.

  • And you just heard of Java script and sure, what goes on basically need an HTML page to get you started.

  • The thing that I like about V s code in a lot of modern text editors and we've shown this on stream before is that you can use the simple html five starting point, for example, in the S Code or some analog and another text editor.

  • And if I hit tab, notice that now I sort of have this fully built out basic HTML template that I can then fill out as needed so we'll just say this is gonna be Java script test one right.

  • And it already added a script tag which we haven't really taken a look at before.

  • Notes that we have, for example, a style sheet tag, a link tag which is referencing a style.

  • She called me a Nazi SS.

  • We haven't made that, so it's just kind of assuming we're gonna add that it's already sort of added this main dot Js bit here in the script tag, I started to say, Oh, um, I'm assuming that there's gonna be a main that J.

  • S and the same folder, but I haven't created yet, so it's not gonna actually do anything.

  • And so all I need to do in order to sort of fulfill that is just right main dot CSS here new file main dot Js here.

  • And those were the files that that index dot html was expecting to exist.

  • And so now it can hoist them up.

  • If you watched the HTML stream, that should all be kind of new, are kind of old to you.

  • But if not, this is how you get a basic Web page up and running.

  • Html CSS and Java scriptures like the trifecta of Web technologies that work together.

  • Um, so here in index dot html, I have this link This reference to Main Js It's here in my head, although we'll see that this isn't necessarily great for Vanilla Java script.

  • If you're if you're not doing the right things to ensure that things get loaded in the right order, we'll sort of see that here in a second, um, in Maine that J s we can do a few interesting things.

  • So the very first thing that I'm going to do is I'm just gonna write alert Hello world, which is sort of like the analog of, I guess, saying hello world in python with print And we could do it with consul dot log as well.

  • But I'm going to just do a simple alert that says Hello world and load the page.

  • Let's go ahead and load this page up.

  • Once I do that, you can see that this isn't something that we really have the capability of doing before.

  • We really didn't have much dynamism, you know, that was possible before, and this is a brand new sort of thing.

  • It's not even part of the page.

  • It's kind of like an extra window in extra motile, so to speak.

  • And, um, this is just a very basic sort of old school way of saying.

  • Here's some information right and typically pages these days don't use alerts.

  • If they do, it's a very rare.

  • Sometimes you'll see an alert when you're trying to log into a device and network device, but the ask you for a user name and password, for example.

  • But this isn't something that you see in actual Web development much these days.

  • Pages like Facebook and most Google Pages and YouTube they don't use alerts is generally more.

  • They'll have dibs, that air dynamic that get inserted into the page, and often you could even move them around and shrink them down.

  • And you know, various things like that.

  • But that is the basic way of saying Hello World in Java script.

  • If you're using a Web browser, if you want a more traditional way of doing it, you can say instead council dot log Hello world.

  • And if I refresh the page and those that I don't get that alert anymore, and actually I don't get any output, nothing is visible.

  • Now.

  • I just see the white page, but if I open up my developer tools as we showed earlier on the stream.

  • And also thanks so much for the folks that followed.

  • Let me just show out all of those folks.

  • So we have still 45.

  • Well, car shake elbow graph E double cheese three and I.

  • M s M 26.

  • Thanks very much for the follows.

  • You can see that I got back in the developer tools in the little panel there.

  • And remember, on a Mac, it's option command I on a PC.

  • It's control shift I.

  • It might be different if you're using chrome on a Linux box, but now the output is in my console, and this is more akin to how you would do something with the terminal.

  • For example, if we were programming and Python or Lulu and we wanted just out.

  • But to this terminal here, just have debugging statements or whatnot.

  • There's some stuff that you might know invisible to your users in your Web page itself.

  • But maybe you want as feedback.

  • Maybe you want to analyze variables.

  • They want to do a calculation and display that in your console on page load or whenever you press a button, but not actually make it visible to end users.

  • And ideally, you'd probably take this out of your ship application, not make it visible to folks that are maybe inspecting your Web page once they've downloaded it.

  • Maybe make this just developer side on Lee.

  • But you will see often times that there are these kinds of messages still embedded in Web pages that ship that normally ship and a gray beard.

  • 1970.

  • Thanks very much for the follow.

  • Let me make sure I'm kind of with all the questions.

  • Just other anti anti player.

  • If the new language is an imperative one, then yes, you'll probably get started quick.

  • All you need is to learn new Syntex.

  • And not logic is that if the language is a functional one, you probably feel like a beginner again.

  • Absolutely.

  • Um, and actually, I myself am learning closure a little bit more in depth, which is a functional list, and it definitely does feel like you're starting from scratch.

  • In certain aspects, certain things are the same.

  • Strings are the same dictionaries of the same, but using just basically composing your applications is a fundamentally different process.

  • It's really cool, though I I honestly I'm really attracted to functional programming?

  • Quite a bit.

  • Um Alba Graphia.

  • What kind of code editor would you suggest to us GS code or sublime Adam et cetera.

  • Those three are altogether pretty functionally equivalent.

  • I like V s code a little bit better.

  • I like the way it's structured.

  • Like the fact that's very actively developed.

  • It's a little bit less memory intensive than Adam.

  • It's free and, like, sublime text and as intel a sense built into it.

  • Which is cool for being able to analyze all the variables and functions.

  • Why are actually programming has got excellent plug and support, But Adam has much of the same features and even some other cool fancy features that V s code doesn't have to my knowledge like collaborative editing, which I thought was really cool.

  • Um, but yeah, it's it's kind of up to you.

  • I would try all of them.

  • Honestly, try them all, see which one you like, the best, and then use that text editor.

  • It doesn't ultimately matter so much the specific.

  • When you're using, as long as you're being productive with it, you're enjoying the process.

  • Um, if you're good at C plus plus, you will learn anything alone.

  • This is Alex Gabriel Love.

  • It's almost kind of true.

  • Super Plus is a pretty crazy language is the language.

  • It's sort of like the defective language of game development, although that's changing because of unity.

  • Now it's sort of C sharp but unity itself.

  • It's written in C++.

  • So you know, ultimately, it's still for the defective language of game development.

  • What car asks why JavaScript named JavaScript?

  • Is it something related to Java?

  • Um, not related to Java at all.

  • So at the time that Java script was developed and this is my knowledge and I wouldn't maybe need to research this, 200% verify it.

  • But Java was popular at the time of jobs, scripts, inception in the nineties.

  • And so the folks developing JavaScript, I believe, was just one person.

  • But I think the name might have been standardized by a committee, decided that in order to sort of market it better, they would call it Java script.

  • But the two languages are completely different.

  • Java is an object oriented like pure, like a very object oriented, statically type programming language, and Java script is a sort of dynamically tight pseudo.

  • You can use it functionally, but it's not technically functionally prototype inheritance, dynamic scripting language.

  • It's kind of a weird programming language.

  • Actually, Java script and Lou are very similar in a lot of ways.

  • They both are have a prototype inheritance model.

  • They both have first class functions, which, if this doesn't mean anything to you, that's fine.

  • As a beginner, you're not expected to really know what this means.

  • But if you've been paying attention with Luis, dream the newest streams up to this point, then some of the jobs script stuff will actually look kind of familiar to you.

  • Syntax is a teachable skill, in my opinion.

  • Knowing how to write well designed, an efficient code is important than when learning a new language.

  • Knowing what the language can and can't do is something that comes with practice.

  • Yeah, exactly.

  • Syntax is fairly, I think, straightforward.

  • But being ableto take bits of syntax and compile them together to make functional things.

  • That work is the harder part.

  • Obviously, composing applications vs being able to read and understand basic syntax, those air.

  • In my opinion, two separate aspects of learning program, um, they want to learn one language once you've learned.

  • See, for example, languages like Java script actually very easy to at a glance parts like, for example, if I were to write here in my main dot Js code if I wanted to raid a function that some two integers if I said functions some that took an X and A y all I have to do is just say, return X plus y semi colon.

  • You'll notice that this kind of looks similar to see on also sort of to Lou as well, because of the function key word.

  • But notice that it has this function key word for defining a function.

  • It has what you want to call the function it takes in parameters in parentheses, which is the way that cdo's it, the way that python does it the way that most programming languages doesn't do it.

  • Lou as well, um, it the limits scope with these curly brackets.

  • So this is the sea style way The algal inspired way from way back in the day.

  • Um, where you have blocks and blocks definitions.

  • I believe algal did it with a key word.

  • And then you return.

  • Uh, just like in any other function.

  • I would return another.

  • Any other programming languages have a function?

  • Sorry that returns a value.

  • You could just return the sum of X and Y that were passed into this function.

  • And if I say council dot log the sum of 10 and 10 well, then we should get 20 output into our consul.

  • And if I refresh, we do indeed see that we have 20.

  • I'll put into our council.

  • The nice thing about this running these programs is that all you have to do to retest that your program works is this.

  • Refresh that browser.

  • Paige.

  • Everything's dynamically types.

  • You don't need to compile anything like you do in C.

  • You just write your Java script file attached to an index HTML files by here and then in your browser makes you load it and this.

  • Refresh it anytime you want to update it.

  • I can refresh as many times as I want to.

  • It's not gonna change, is just reevaluating the Java script.

  • So good questions?

  • Yep.

  • And at Alex's point, just marketing, um, doing small cattle's hacker rank.

  • Lead coated center is good.

  • Practice related languages is great, but 1970.

  • We ended up actually hosting some hacker rink, um, sort of programming contests.

  • I think back in the day Hacker rings pretty cool.

  • They have a lot of really good stuff on there.

  • I haven't checked out Lead cut myself, though.

  • Um, are there any downsides to learning JavaScript as your first programming language?

  • Asks Dex, 1987.

  • Um, I would say in certain senses, Yes, you'll be getting used to dynamically type programming languages right off the gate.

  • And this might be a challenge if you decide to work for a more structured programing language like C or C plus Plus or Job or C Sharp, where expected to know howto type you're variables.

  • How to statically LR.

  • How to define which type your variables should be and to use them in the right context.

  • Java script does not enforce this, and they're actually lot of really weird bugs that you get with Java script.

  • Sort of tight coercing your things for you.

  • Automatically adding strings and numbers together, for example, produces weird output.

  • Adding certain data structures together produces weird output.

  • Um, but learning how to program fundamentally, I think you can learn whether you're using a dynamic language or ecstatically type language, even the folks that might have learned.

  • See, for example, the folks learning assembly before them might have talked down on those folks for learning a language that, to them, was a higher level abstraction.

  • Right, because an assembly you're basically talking with your CPU, plus or minus a level of abstraction with the with C you're actually attracting on top of assembly.

  • So you're missing out on some of the things that you need to worry about in assembly that you don't need to worry about in C in python and in JavaScript and in some other dynamically type languages like Louis, you're missing out on some of the things that you need to worry about in See that you don't need to worry about in those languages.

  • So it's kind of this infinite sort of like How deep are you willing to go in order to consider yourself well versed at something?

  • Ultimately, I think get encompassing view of programming ghetto ghetto, learn how to program in a dynamic language, learn about a program and ecstatically type language.

  • Maybe look at assembly, maybe look at how si pues work, and then you can derive value as much as you want to, depending on how much you're willing to sort of go down that rabbit hole.

  • But it's almost a kn infinite rabbit hole.

  • It really you can get down until the really hard core weeds you can't even abstract below the CPU level and start getting into the circuitry.

  • Getting into the electrons.

  • It's pretty, you know it to be productive.

  • You kind of have to pick and choose the point at which you're willing to anchor yourself.

  • Um, Alex says Node.js is everywhere and great, and that's true.

  • Js is right now a really popular programming language.

  • If your programming any website, you need JavaScript.

  • If your programming servers these days it's very popular to use no J s, which is a server side version of Java script, and that's extremely popular.

  • Um, and JavaScript is getting used in more, more context on daily basis.

  • I think primarily just because the my theories, because the pool of developers is so large that a lot of people are just kind of getting tired of some of the setbacks of Java script Hence s six, which is the more modern version of Java script sort of refining the language on being broadcasting it out, refining it, using developing tools like the engine for node.

  • Um, it's just become a very incredible ecosystem.

  • Things like NPM for node being able to install so many libraries that so many developers have made freely available to you to bootstrap your application on the server or the client.

  • It's really incredible.

  • So it's not a bad ecosystem to get involved in.

  • I would say there are some weird eccentricities of Java script that you'll have to get used to.

  • I would say, probably it's I would advise maybe learning Python first.

  • If you're gonna learn a dynamic language, I personal like Python more.

  • I feel like it's more.

  • It's engineered a little bit better.

  • But, um, you know, it's up to you.

  • Really?

  • Just do whatever you feel like doing.

  • Um, okay, let me just make sure that I have come up here with the chat.

  • There's a lot of chat messages, which is awesome.

  • I don't want to take up too much time just because I I know.

  • Some folks were eager to dive in, but many some looks like some folks talking about their C and C plus plus knowledge South Africa asks, Will you ever do python Kivi in your stream?

  • It's very interesting.

  • Heavily documented, Hard to learn.

  • I built an apple Cannot implement garbage collection.

  • Python kitty.

  • I'm actually not sure what that is.

  • Python Kivi.

  • A cross platform python framework for a new eye development.

  • Innovative user interfaces such as multi touch applications.

  • Interesting.

  • Let's take a look at their page is just a minor aside.

  • So just kind of like a more modern version of T K.

  • Enter, I guess, Or two Kinter.

  • However you want to pronounce that it looks pretty nice.

  • I have no knowledge and expertise at all amusing Kivi.

  • So I would have to dive into it and really learn how to use it.

  • Well, But, you know, maybe in the future, especially, it's taking off.

  • I'm not sure I'm not sure how popular it actually is.

  • Alba Graff he asked, What are we creating?

  • We're gonna create a two versions of a to do list application.

  • Um, I think Andre is a troll constructors or nothing crazy.

  • They are standard material of object oriented programming languages.

  • What did Andre say?

  • If you really get people supposed to do in spite of all the crazy things that has, like constructors D structures, copy, move, constructors.

  • Or perhaps because of this, I think C++ is probably the language that made me think the most about how things run at both the lower level in about language syntax.

  • So just another anti anti player I think he's talking about, I think, Andre.

  • So we know Andres, not a troll or just a very active member of our community.

  • The difference with constructors and C plus plus for other programming languages that there are multiple versions of it, that you have to sort of hard code and specify in addition to things like D structures.

  • And I think that's where he was, sort of, um, sort of laying out the difference between maybe C plus plus another language.

  • Most programming languages don't specify D structures.

  • C++ is kind of unique in that context.

  • I haven't looked at languages like rust, ergo, um, to see if they do.

  • I know Go actually doesn't really have a traditional object model in and of itself on and rust I'm not too familiar with.

  • But most of the object oriented programming language, especially in the dynamically type landscape just have a one constructor, like in python.

  • Andi, it's up to you to sort of use that for all of your use cases.

  • But of course, there are differences across languages.

  • Um, and then, yeah, Andre elaborated on his point a little bit.

  • Um, C++ is awesome.

  • Not as messy as python, in my opinion, I don't know.

  • Tempus Station.

  • I think c++ can get pretty damn messy.

  • Um, I actually really like python for how clean it is, but if you want to elaborate on what you think is messy, definitely let me know if you're referring to maybe some of the syntax for some of this, like the like, meta classes.

  • I can get what you're saying.

  • It can be a little bit messy.

  • Would you consider javascript an object oriented programming language?

  • Um, yeah, I would say kind of falls into a gray area, but yeah, I would say it.

  • ISS, um use what are called prototypes, which is a way for an object to construct itself to reference a one object that you've already created, which is kind of acting as a class.

  • It's a very odd sort of way of doing it, but it I think it technically speaking is an object oriented programming language.

  • And with the S six, they added class syntax.

  • So you can actually specify a class instead of a prototype.

  • And they made it a little bit similar to how you more.

  • Some what?

  • I would do something in, for example, python or c++ versus how you would do it previously, where you have to define a prototype in all of the sort of functions thereafter.

  • Um, it could get a little bit odd.

  • Um, C++ is an extension of C.

  • Give me a garbage collection threat over having to allocate and d allocate memory.

  • Yeah, I agree.

  • Memory allocation is a real pain these days.

  • It's so fast relative to how it used to be that it's not as bad.

  • Um, just other anti anti player.

  • The biggest change you see at first is that c++ is object oriented.

  • Originally, it was called C with classes.

  • Everything you could do in C can be done in c++.

  • There are a few other things like are A II, which is, um, resource allocation.

  • Uh, something I forget what that stands for.

  • Our A I I, um, holding a resource is a class in variant and is tied to object.

  • Lifetime resource allocation or acquisition is done during object creation by the constructor, while resource allocation has done during object destruction by the destructor.

  • Yeah, so that's the sort of the c++ paradigm of things.

  • That thing, naturally, that gets converted into the garbage collection side of things in a more modern programming language.

  • More sorry, amore.

  • Dynamically typed, um, programming language.

  • Andi, even job a does this for you, which is kind of nice.

  • You have to specify a destructor it likes.

  • You get taken care of for you by the G.

  • C.

  • Um, but yes, to anti his point.

  • Everything you could do and see can't be done.

  • A c plus plus the two.

  • I mean, you can do anything with any programming language.

  • Roughly speaking, there are, you know, sort of ways to do it more easily, But you can do and see what you can do in c++.

  • It's really the goal of c++ is too abstract to make you think in terms of objects, not in terms of functions, right and functional programming actually is the opposite.

  • It's you think in terms of your data structures and applying operations to your data.

  • Take it to the same goal and I'm kind of falling more in love with that idea.

  • But I need to experiment a lot more with the low with the actually getting into the weeds with it.

  • So we'll see.

  • Just started CS 50 and I don't have any prior programming experience.

  • So what are your suggestions on making myself count and those of the more comfortable, clouded category?

  • How should I begin my process, and how much time will it take?

  • Um, being more comfortable is really a process of really just programming and doing it smart.

  • So programming something and expanding your skill set, you know, not doing the same same thing over and over and over again.

  • The same basic tutorial example actually implementing something that you find interesting right off.

  • For me, it was games.

  • I really enjoyed making games and programming games, and I apologize that work.

  • We have really done a whole lot of Java script yet we have a lot of people asking a lot of questions.

  • I want to make sure that the people tuning in our getting value out of the stream so we'll have this conversation, but, um, for me, it was games.

  • You have to find what you really enjoy programming which you really are passionate about.

  • Right?

  • If you want to be in a mobile app developer, if you want to be a web developer, if you wanna be a game developer if you want to be a systems developer, um, if you wantto program are green knows if you wanna be a microcontroller developer, you to find what you like and actually make stuff and make complicated things and they don't have necessarily needed this.

  • It would be complicated per se, but you need to you need to keep broadening your horizons, broadening your skill set and learning the things that make you capable of achieving that.

  • Right?

  • Um, I wanted to program games, so I bought books on games.

  • I read, Ah, how engines at the time and this is about 10 years ago were working.

  • Um, 10 or 11 years ago I got into unity.

  • I learned how unity works.

  • I got into love to d.

  • I read tutorials.

  • I tried to understand fundamentally what goes on layer by layer of abstraction, and eventually you sort of fill in all these gaps, especially things like Stack Overflow and Google and all of the great books that are out.

  • You do filling your gas, but you need to put in the time you need to really invest, and you really need to sort of get past the mental hurdles that you will have because it will hurt.

  • Your brain will hurt for a while because not easy.

  • It's not easy to sort of think computational e when you're not used to doing it and to program things that are large scale.

  • But by practicing and working your way up small things upto large things, you will get there eventually.

  • But you need to invest the time job or C sharp past Ebron IX.

  • Um, I like c sharp a little bit better, but I'm a little biased because job djdm was what closure is built on.

  • And I'm starting like closure a little bit more, so it's hard to say.

  • But C Sharp is what unity is programmed in.

  • So which takes saying what Python is not messy?

  • Excuse me, what's the difference?

  • Teen Javascript, Java and Js, Javascript and Js are the same thing.

  • Java is a statically typed, object oriented programming language that runs on the J V M completely different language.

  • I would suggest completing the CS 50 X course and its entirety first, then go back and complete the more experienced P sense.

  • It took me about a year to complete tux.

  • Manya.

  • Good suggestions he's 50 x will teach you how to think if you work through the whole thing and actually completed the peace, since he will get a lot of value out of it.

  • Yeah, I had to look up the R A I I acronym.

  • It's been a while since I've looked it up.

  • It would be a good way to learn c R.

  • C plus plus and how to get started.

  • Just Google, I would say c++ tutorials.

  • Watch YouTube videos If you're into visual learning, There are plenty of books and articles that you can find online that wil

All right.

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

B1 中級

JAVASCRIPT BASICS TUTORIAL!- CS50 on Twitch, EP.43 (JAVASCRIPT BASICS TUTORIAL! - CS50 on Twitch, EP. 43)

  • 0 0
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語