These are chat archives for FreeCodeCamp/HelpJavaScript

1st
Jun 2018
Richard
@rylew0925
Jun 01 2018 00:02
If I want to do both web development and computer programming, should I first start with web development or should I learn computer programming first?
Brad
@bradtaniguchi
Jun 01 2018 00:04
@rylew0925 Free Code Camp teaches full-stack Javascript as its primary programming language, and html/css (these are not programming languages ;D) so totally can start with just FCC, and thus Javascript first and maybe move onto python after a while.
Also FCC teaches you web development, which requires you to learn programming.
Richard
@rylew0925
Jun 01 2018 00:05
I'm willing to learn both fields but I was wondering which field would be better to start with before I can smoothly transit between them?
Richard
@rylew0925
Jun 01 2018 00:14
Ok. So you would recommend I start with web development before going into computer programming?
I'm not trying to sound indecisive but which field focuses more on coding?
Brad
@bradtaniguchi
Jun 01 2018 00:17
Programming is "universal" knowledge for being a developer/programmer/software engineer, web development is just one area you could go into
Richard
@rylew0925
Jun 01 2018 00:18
Isn't web development and software engineering pretty much the same thing?
Brad
@bradtaniguchi
Jun 01 2018 00:18
Programming more or less is just coding, knowing how to be a good programmer is more worthwild than just being a good web developer, but a web developer is more like a specialist if you know what I mean
What if your desigining software that runs a microwave (an example)?
Or if your designing a language/compiler?
lots of "engineering" goes into those sorts of projects, none of which has anything todo with web development
At the same time you can work at facebook and be a software engineer to handle some things, or be working there working on facebook's UI as a web developer.
Richard
@rylew0925
Jun 01 2018 00:20
Is Free Code Camp more oriented towards programming or web development?
Brad
@bradtaniguchi
Jun 01 2018 00:20
being a "software engineer" is pretty broad, but a web developer means, well you develop stuff for the web
FCC is definantly more focused on web development, like most coding bootcamps
main reason is there is a demand for web developers, the web is growing, and its "cheap". Compare to if your programming a microwave, you need some pretty specific knowledge to get going.
Richard
@rylew0925
Jun 01 2018 00:21
Are there any sites equivalent to FCC that focuses on programming you can recommend?
Brad
@bradtaniguchi
Jun 01 2018 00:23
@rylew0925 It depends, programming is very general. You can be a programmer and not even have electricity (ever heard of ada?) or a computer. You can easily start anywhere to get the idea of the concepts, and move onto more domain specific stuff
Richard
@rylew0925
Jun 01 2018 00:23
Have you tried Codecademy? Is it reliable?
Brad
@bradtaniguchi
Jun 01 2018 00:26
I think I went over some of codeacademy stuff, but not enough to provide much judgement
Richard
@rylew0925
Jun 01 2018 00:30
If I want to program a microwave, where do you recommend I start?
I meant what languages does it involve?
Brad
@bradtaniguchi
Jun 01 2018 00:34
@rylew0925 Probably some assembly level language, or maybe C depending on the microwave.
this is in comparison to something "high-level" like javascript
which doesn't know much about the machine its running on
Richard
@rylew0925
Jun 01 2018 00:37
If I was to master all of the skills from FCC, would I be able to apply them to many of the other programming languages?
Brad
@bradtaniguchi
Jun 01 2018 00:38
Probably 30% would be applicable to programming in general, mainly the javascript section and algorithms. Everything else is pretty much web development domain logic. Basically not very useful outside of web development
But Id argue that 30% is pretty damn important knowledge
Like you need that 30% regardless of what your doing and regardless of language
Richard
@rylew0925
Jun 01 2018 00:42
Ah, ok. I'll be sure to check them out
Thanks for clarifying!
Brad
@bradtaniguchi
Jun 01 2018 00:56
np goodluck :D
Norvin Burrus
@ndburrus
Jun 01 2018 04:03
@rylew0925 you may enjoy this: :sparkles:
Jefferson
@jeffersonnnn
Jun 01 2018 08:54

hi guys, i have a very rookie question to ask that i have already asked sigh, but here goes. So i am using jquery to take information (a list of contacts) from an api and present them in a format readable by the user but i can't get it to show. Now i know that i am already targeting an id, but i inherited this codebase and i am looking to tweak it. What can i do to get this to work. Here is the jQuery

$('#mnu_contact').on('click', function () {
    curSelPage = "contacts";
    $('#nav_title').text('Contacts');
    showMainMenu(false);
    $.get( SERVER_URL+'/contacts.json', function(r_data) {
        var contacts = r_data;
        for (i in contacts) {
           $('#ul_sub_menu').append('<li><a href="#" class="item-link" onclick="selContact('+contacts[i]['id']+')"><div class="item-content">'+contacts[i]['name']+'</div></a></li>');
        } 
    });

and herer is the html table i am trying to get my output on

<div class="page" data-page="page-contact">
    <div class="page-content">
        <div style="text-align: right;padding:20px;">
            <a href="#" onclick="onClickContactEdit({{contact['id']})">Edit</a>  &nbsp;
            <a href="#" onclick="onDeleteContact({{contact['id']})">Delete</a>                  
        </div>
        <div>
            <div class="row center"><h2>{{contact['name']}}</h2></div>
            <div class="center">{{contact['company']}}</div>
            <div class="">Phones</div>
            <div class="">{{contact['phones']}}</div>
            <div class="">Emails</div>
            <div class="">{{contact['emails']}}</div>
            <div class="">Addresses</div>
            <div class="">{{contact['physical_addresses']}}</div>
        </div>
Nate Mallison
@NJM8
Jun 01 2018 10:18
@jeffersonnnn have you logged r_data to make sure you are getting something back?
Dimitris Nik.
@dimitrissnk
Jun 01 2018 14:18
Hello there, I am getting an error "ReferenceError: $ is not defined", I did my little research and I see that I am calling JS before jquery, but how can I solve that problem? See my code here
The jquery is in the last few lines of code
Pieter Stokkink
@forkerino
Jun 01 2018 14:28
@Dimitrios51 on codepen, add jQuery in your pen settings, that way it will be loaded first.
Dimitris Nik.
@dimitrissnk
Jun 01 2018 14:41
@forkerino you mean the Settings->Javascript->Quick Add->jQuery? I have done that and still get the same error..
Pieter Stokkink
@forkerino
Jun 01 2018 14:52
I'm getting a different error when I add that, @Dimitrios51
Failed to load https://en.wikipedia.org/w/api.php?action=opensearch&search=ajax: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://s.codepen.io' is therefore not allowed access.
try adding &callback=? to the url
Jason Luboff
@JLuboff
Jun 01 2018 15:06
Morning
Pieter Stokkink
@forkerino
Jun 01 2018 15:14
@JLuboff :wave:
Jason Luboff
@JLuboff
Jun 01 2018 15:14
@forkerino Happy Friday!
Pieter Stokkink
@forkerino
Jun 01 2018 15:16
@JLuboff Learned any cool new things lately?
Jason Luboff
@JLuboff
Jun 01 2018 15:18
Hmmm... mainly just SQL stuff. Nothing terribly exciting though hah. Definitely starting to feel more comfortable with it but still would only put my SQL skills at novice to maybe intermediate.. Looking to start going through the FCC stuff which is exciting. How about yourself?
Pieter Stokkink
@forkerino
Jun 01 2018 15:24
I'm dipping my toes into the functional programming language Haskell after being inspired to do so on a local meetup. It's a completely different way to think about programming and to approach certain problems, which is inspiring. At this point I doubt I will ever use it for something, but it is mind-expanding to learn about it.
Jason Luboff
@JLuboff
Jun 01 2018 15:40
@forkerino Neat, what would you use Haskell for?
Kudzu
@czhower
Jun 01 2018 15:42
It is always good to learn other langs, even if only academically. You will learn a lot that can benefit you in your existing usage.
Pieter Stokkink
@forkerino
Jun 01 2018 15:44
@JLuboff You could use it for anything on the server side, or for standalone apps. I like how it forces you to think functionally, it is definitely the most strict language I've played around with so far.
@czhower I agree completely.
I would like to learn an OO language sometime as well. Any recommendations? I know python and a bit of java (which I don't like so much), was thinking about C++ / C#
Kudzu
@czhower
Jun 01 2018 15:47
Dont do C++ as your first OOP... C# or Java are good. I prefer C#, but it more of a personal than a technical preference.
Jason Luboff
@JLuboff
Jun 01 2018 15:47
@czhower Oh I definitely agree. I'd call myself proficient (but no where near an expert) at JS but learning even the basics of C# taught me a lot
Kudzu
@czhower
Jun 01 2018 15:47
C# IMO is a slightly better OOP platform. Java is decent, but a few small things in the OOP are area annoying.
Jason Luboff
@JLuboff
Jun 01 2018 15:48
My biggest issue is I can know how to do something, but I'm not very good at explaining or even always understanding the concept
Pieter Stokkink
@forkerino
Jun 01 2018 15:49
C# it is, then. First let me work through this Haskell book I'm working on and then I'll delve in.
Which would be the best resource for learning C# for a dev that already knows a couple languages? I prefer books to videos or raw docs.
Jason Luboff
@JLuboff
Jun 01 2018 15:53
I actually like C#. As I said even the basic's of it taught me a lot (like classes, inhertitence, polymorphism, private vs public properties (there's actually more than those two), etc)
The only book I've used so far for C# is The official Microsoft MTA course book which isn't going to probably be what you want
It's more of a general overview (beginner) as opposed to an intermediate level which I'd expect is what you'd wnat
Pieter Stokkink
@forkerino
Jun 01 2018 16:01
I'm googling a bit. Found 'C# for programmers', which seems to be exactly what I need.
Jason Luboff
@JLuboff
Jun 01 2018 16:03
Have a link?
Pieter Stokkink
@forkerino
Jun 01 2018 16:05
I googled best books C# and found a listicle in which it was linked. http://www.deitel.com/Books/C/C6forProgrammersSixthEdition/tabid/3682/Default.aspx
couldn't find anything like this for C# 7.0+
Jason Luboff
@JLuboff
Jun 01 2018 16:06
:+1: I had searched C# for programmers and found another book by the same authors but it was published in 2005 hah
Pieter Stokkink
@forkerino
Jun 01 2018 16:07
700 pages of fun! :rocket:
Dinner time. TTYL
Jason Luboff
@JLuboff
Jun 01 2018 16:07
Enjoy
Kudzu
@czhower
Jun 01 2018 16:54
Join a nice open source project - gives you something useful to do while learning... Might I suggest this one? :)
http://www.goCosmos.org
C# Open Source Managed Operating System. Lots of fun
Jason Luboff
@JLuboff
Jun 01 2018 17:03
Lots of fun created by you haha (thats actually pretty cool)
Pieter Stokkink
@forkerino
Jun 01 2018 17:46
If only a day had 32 hours. I would get so much done.
Looks like an interesting project. @czhower Thanks for the tip ;)
Kudzu
@czhower
Jun 01 2018 17:58
The project has many who are new to C# and even programming, and the team mentors them all using Cosmos along the way.
Henry
@GitHub-Henry
Jun 01 2018 19:53
@forkerino C# 7.0 in a Nutshell, only 1089 pages, a real page turner and favorite
Jason Luboff
@JLuboff
Jun 01 2018 20:10
~1100 pages? Christ.. Here I've been going through "Querying Data with Transact-SQL" which is only 320 pages and just barely about to finish it...like 4 months into it
Henry
@GitHub-Henry
Jun 01 2018 20:12
@JLuboff Dig deeper with Andrew Troelsen Pro C# 7, all 1410 pages
Jason Luboff
@JLuboff
Jun 01 2018 20:12
Damn
Henry
@GitHub-Henry
Jun 01 2018 20:13
an ocean of info
Jason Luboff
@JLuboff
Jun 01 2018 20:13
Given....I imagine those books read a lot better than the MSDN docs... they're horrible (IMO)
Kaz Baig
@kbaig
Jun 01 2018 20:13
MDN on the other hand :+1:
Jason Luboff
@JLuboff
Jun 01 2018 20:14
MDN is great
It's fairly straightforward and gives good examples, etc
MSDN reads like you need a Ph.D
Henry
@GitHub-Henry
Jun 01 2018 20:14
I started with MSDN, so I thought all documentation was horrible
Jason Luboff
@JLuboff
Jun 01 2018 20:16
I find MSDN to not be very clear or too many click arounds
Henry
@GitHub-Henry
Jun 01 2018 20:16
Unfortunately, I was also introduced to IBM documentation, just as bad
Jason Luboff
@JLuboff
Jun 01 2018 20:19
Haven't had to deal with those :)
Yossi Fisch
@yoizfefisch
Jun 01 2018 20:41
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function
The example codes seems to have a typo:
new spaceShuttle should be new SpaceShuttle capitalized.
Correct? Issue worthy?
Kaz Baig
@kbaig
Jun 01 2018 20:42
Agree that it's a typo fo sho
Brad
@bradtaniguchi
Jun 01 2018 20:45
@yoizfefisch If you don't report the issue the only way it gets fixed is someone noticies it haha
Yossi Fisch
@yoizfefisch
Jun 01 2018 20:51
Thanks for your confirm. Opened issue
Can anyone confirm or counter the 2 issues I mentioned in this forum post?
Gulsvi
@gulsvi
Jun 01 2018 23:04
Friday fun challenge :) add two numbers represented as strings without converting them to numbers.
function add(a, b) {
  // your code
}

add("999", "1002") // "2001"
input is guaranteed to be a string of digits (0-9), output should be a string representing their sum
No need to account for negative numbers
Jason Luboff
@JLuboff
Jun 01 2018 23:08
@gulsvi
function add(a, b) {
  return (+a+(+b)).toString();
}

add("999", "1002") // "2001"
Brad
@bradtaniguchi
Jun 01 2018 23:08
I think I have an idea of how todoit without numbers....ascii codes :trollface:
Gulsvi
@gulsvi
Jun 01 2018 23:08
@JLuboff The unary operator converts them to numbers :)
Jason Luboff
@JLuboff
Jun 01 2018 23:08
I mean..sort of..
Brad
@bradtaniguchi
Jun 01 2018 23:09
sort of? how does it not XD
Jason Luboff
@JLuboff
Jun 01 2018 23:10
:smile:
Gulsvi
@gulsvi
Jun 01 2018 23:10
It's probably slightly different than Number() and parseInt() which are also both different from each other for some weird reason
Jason Luboff
@JLuboff
Jun 01 2018 23:14
Well..you got me stumped
Gulsvi
@gulsvi
Jun 01 2018 23:16
It took me a while to diagram and figure out
Basically, outline how we'd do it manually (add two numbers, carry the one, repeat) and convert that to code. Should be doable in one for loop or while loop
Jason Luboff
@JLuboff
Jun 01 2018 23:18
but you said we can't use numbers :trollface:
Gulsvi
@gulsvi
Jun 01 2018 23:18
LOL :)
Good clarification - we can't convert the entire string to a number
Because, then it wouldn't work for strings longer than 15 digits
Brad
@bradtaniguchi
Jun 01 2018 23:19
convert each number string to a number
then use bitInt :P
Gulsvi
@gulsvi
Jun 01 2018 23:20
or write it in C with long doubles :) (is that the right data type?)
Brad
@bradtaniguchi
Jun 01 2018 23:42
Yas I figured my problem, holy cow this stuff is complicated, its like going through 5 levels of possibly nested arrays, and propagating their changes "up" to a single point ug
Jason Luboff
@JLuboff
Jun 01 2018 23:49
what problem was that?
Brad
@bradtaniguchi
Jun 01 2018 23:49
Its all my business logic I'm wrapping my head around
Jason Luboff
@JLuboff
Jun 01 2018 23:50
Aint no business like monkey business!
Brad
@bradtaniguchi
Jun 01 2018 23:51
The general thing is im watching for changes in a form, so I can update other fields depending on what changes. But its all dynamic, (the fields listening, the fields being listened to, whats being listened, the number of fields that are being listened to) my heads spinning
Jason Luboff
@JLuboff
Jun 01 2018 23:52
That sounds like a pain
My damn SQL logic keeps getting messed up.
Brad
@bradtaniguchi
Jun 01 2018 23:54
I can see how if I used promises/callbacks my life would be over, but this observable pattern stuff fits pretty nicely in this use case
Jason Luboff
@JLuboff
Jun 01 2018 23:59
Cool.. think I got one query of the potentially two working.. and now its time to go home so even better