Programming languages

Discussion in 'Tech Discussion' started by Fallen Hero, Apr 27, 2017.

  1. yuzuki

    yuzuki [sweet night] [plum blossoms]

    Joined:
    Nov 24, 2015
    Messages:
    662
    Likes Received:
    4,875
    Reading List:
    Link
    Python is the language to go if you're a beginner and programming as a hobby. It's easy to learn (compared to a lot of the other languages) and very flexible for all-purpose things whether for general programming or web development. You can definitely live off python as an amateur.

    If you want to do web development, you'll eventually need to learn JavaScript but I don't recommend JavaScript as your first language. Learn JS after you've learned using one of the python/ruby/php/java web frameworks. Of these, I think still think python is the best to learn because virtually everyone "hacks" in python and it has lots of value even if you eventually need to code for something that isn't web-based.

    If you want to do game development, you're essentially in the Unity/C# world.

    Mobile app development I can't say anything about because I don't do it.

    If you want to learn for a career, take a course. You'll probably do an introductory course in Java, and eventually learn C/C++ and lower level stuff. You won't need to learn these unless you're serious about pursuing computer science as a career or planning to make a serious game that is resource-heavy. C++ is too slow to code in for it to be worthwhile for anyone else.
     
  2. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    I disagree with you. Python is an ok language to start with don't get me wrong. But end of the day you are still pretty stuck with Python. At best you can mostly just develop desktop apps. If you want to learn web you need to then learn javascript, if you want to go mobile you need to go learn javascript, or java/objective C.

    In comparison, you are better off just learning javascript. The key is not learning the old fashion javascript but jump into using libraries like JQuery and/or frameworks.

    This fixes a lot of the complexity of javascript and makes it much easier for beginners (and even users who are used to javascript).

    With NODE JS, you can now do desktop apps and server apps with no issue as well.
     
  3. waca

    waca New Member

    Joined:
    Apr 11, 2017
    Messages:
    21
    Likes Received:
    4
    Reading List:
    Link
    I think you better start with C then C++.
    You can see the tutorial at hackerrank.
    Start from Input/Output, pointer, some algorithm, Object, software design pattern
     
  4. yuzuki

    yuzuki [sweet night] [plum blossoms]

    Joined:
    Nov 24, 2015
    Messages:
    662
    Likes Received:
    4,875
    Reading List:
    Link
    I mean, I made my comment because I guess I'm more traditionally minded. XD

    I'm assuming OP doesn't know OOP, and jumping directly into JQuery is... to a large extent very different from most other programming languages out there due to the async and callbacks. So learning JS as a first language to me seems like a bad choice, because picking up later languages (which will inevitably happen) will be kind of odd with a JS starting point.

    So to me, I'd feel like it's better for an amateur newbie to get grounded in solid programming basics (e.g. really understand what a class is), rather than run the risk of having them run around google like a javascript script junkie when they know absolutely nothing to start.

    The JavaScript web frameworks are especially dangerous for newbies because they're changing every year or dozens of new immature ones pop up. Read a tutorial from 2015 and try applying it to your project and there's s good chance it won't work. XD Node is good though; almost everything else like React or Angular or any of the full stack JavaScript solutions, you'll have to be prepared to spend a lot of time trying pulling hairs to teach yourself because the learning curve is really steep, especially for a first-timer new to programming with no help.

    As for Python on web, it's equivalent to Ruby (the older generation MVC frameworks) -- django is the rails equivalent. I like these better for beginners because they're much more stable as frameworks compared to the JS frameworks, and the help community/documentation/books available is larger and more mature, making them much more approachable. Sure, you'll need to learn JQuery eventually to do something fancy with UI/UX, but that doesn't need to be learned immediately for a web developing amateur. Anything above static HTML/CSS/JS is already a step up.
     
  5. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    The thing is that modern programming is just that, callbacks and async (Though new thing is Promises). Part of the issue why performance of apps has not improved much is because people continue to program the old way. Thus you have poor multithreading performance and lots of blocking.

    We are reaching the limit to how powerful computers can become in terms of single thread. And most apps are limited to using 2 threads only. Where as processors can easily scale to 16 threads on the cheap. We are literally giving up a ton of performance. It is much better that people code to avoid blocks and use multiple threads properly by spreading workload.
    (Yes I know JS is single thread in itself, but it makes it easy to convert to logic of using workers to offload processing)

    Oh and by the way, I am a Perl Programmer, so I am probably the last person to talk about old way. But I think if you are going to learn from scratch it is better to learn to program things with new technology.

    And by the way, even python programmers have pretty much given up and even on desktop apps end up using JS/HTML/CSS for UI/UX by embedding in webkit. If you are going to do it anyways might as well do it.

    Javascript is the #1 programming language on earth, while the frameworks are not as mature, they are mature enough. And due to the large user base of javascript it is easy to find help.
     
    Last edited: May 27, 2017
  6. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    Desktop apps?

    The only desktop app I have ever used that's written with Python was Google's AppEngine GUI client. You talk as if Python's only viable use is for desktop. Nope. It's the other way around. Python was never popular for desktop. Instead, it's a popular choice for three things:
    1. Data science, where it competes directly with R.
    2. Server-side automation.
    3. Web development! Yes, web development.
    Granted, in web development, it's not as popular as some other languages, but it's still very popular. Look at this Wikipedia article, and see how many times Python comes up. Also, they don't mention it there, but Quora is built on Python.

    Now, you mentioned JS. Yes, it's true that if you want to build a website or web app, you'd need to know JS, because you have no other choice but JS for the frontend. But the thing is, web dev isn't just limited to websites/apps. You can build web APIs. You can build bots. You can build the backend service for a desktop client. EVE Online is partly written in Python.
     
  7. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    I'm not going to enter in the discussion of which language would be the "best" starting language, because it doesn't matter unless you have a very specific objective in mind.

    But...

    No. This is the very reason there are shit JavaScript developers everywhere, because they don't know JavaScript or the DOM APIs. They bundle 4MB of dependencies when they could write 3 lines of vanilla JS.

    Especially jQuery; for some reason people believe you absolutely need it. That's just FUD.

    If you want to make a large-ish SPA, sure, go ahead and pick the latest fancy and hyped MVC framework; but, as a rule of thumb, if you don't need client-side routing for what you want to do, then you probably don't need third-party libraries.
     
    Truerror likes this.
  8. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    The point is that in the past, you were forced into using languages like python. Nowadays you can just learn JS and do things from backend services to automation all in javascript via NODE JS.

    That is not as much a big deal as you make it out to be. Browsers have a thing called gzip and cache. Common libraries like jquery are cached into the browser.

    Just an fyi, minified and gzip jquery is only around 30kb though, so don't make up nonsense. The reason why you get 4mb of loading is for a totally different reason. And even then, considering broadband is 25mbps, even that is not a big deal
     
  9. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    And likewise, you're not forced to use JS either (unless you work frontend).

    See, you think Node is better because it's new and popular, and thus newcomers are better off learning it. I think Node is great too, but while JS is a strength, it's also a weakness. It's simply a mess. Otherwise no one would bother to create languages that transpiles to it (like CoffeeScript or TypeScript). It's practically one of the most hated language still in active use, right up there with PHP.

    JS was designed to be a very simple scripting language for browsers, so that the browsers can do nifty stuff. It was never meant for general use. And despite the ongoing effort to rectify it, this root still shows. Contrast that to Python, which was designed for general use from the get go. It even teaches newcomers to indent stuff!

    So, a language that teaches best practices and is widely used in professional environment. I'd say that Python is an excellent choice for beginners.
     
    noisypixy likes this.
  10. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    It's obvious that the numbers I'm using are not the real ones. The point is not the size, it's the stupid programmers that know zero shit about the language they're programming in. The ones that pop up in Stack Overflow asking how a closure works, or why (" " == 0) evaluates to `true`. The ones that over-engineer everything because they don't know better.

    It's about maintainability.

    On a related note, you can Google about the "left-pad" incident.
     
  11. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    And 9/10 times you are forced to do front end anyways. Unless you are just making a commandline application, you always want some sort of interface. Before writing interfaces used to be tedious, but these days an HTML/JS interface makes it easy.

    As far as people creating languages, that is nothing new. There have always been adaptations of languages one to other.

    The biggest reason JS is hated is due to browser compatibility. But these are not issues with using things like NODE, and even front end, compatibility has improved a lot, especially with libraries like jquery.

    I am not saying node is better just because it is new and shiny. And Python while has generally been pushed as a starting language is at the end a dead end due to its limitations.

    Just like as much as I love Perl and as many things that I can do with it, at end of the day I am forced to use other programming languages to get things done.

    Not to mention, there are still issues with the Python syntax as well. Especially when you go from not needing brackets in python to needing them in almost every other programming language.

    As for PHP, the reason why it is hated is because of many inexperienced programmers using it as a go-to language despite its overall weakness in usage.

    Just an fyi, the use of libraries is actually the proper way to go about things. And it helps maintainability, especially jquery which is made for cross browser compatibility of code.

    As far as the left-pad issue, that was more to do with dependency. Overall, common things like left-pad should have been moved to CORE library. They also should follow the practices of CPAN which archives old versions of libraries, runs tests and lets you sync to an older version if new one is not available.
     
  12. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    Googled the left-pad incident and found this.

    One-liner module. Wow.
     
  13. Truerror

    Truerror Well-Known Member

    Joined:
    Jan 10, 2016
    Messages:
    546
    Likes Received:
    292
    Reading List:
    Link
    Nope. The biggest reason JS is hated is because it's a weak-typed, quirky language that's used way beyond its initial purpose. Browser compatibility is just icing on the cake.

    And I don't see why you're so adamant on voicing the death of Python. Every language has limitations. JS included. It thrives now, doesn't it?

    As for Python's no-bracket syntax, explaining what those brackets are would be way simpler once they understand the basics. Building a good habit? Not as simple.

    And yes, code should be reusable,so using libraries is good practice. Using a library that consists of 11 lines (or worse, a one-liner) in its entirety though?

    EDIT: Forgot to mention, but in this day and age, said interface might not be HTML+CSS+JS. It is often a mobile app or a desktop client, or simply "Interfaceless". Web APIs don't really need an interface of that sort. I don't know why you must make the distinction that if it's not a GUI it must be command line.
     
    Last edited: May 27, 2017
    noisypixy likes this.
  14. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    Hmm... So basically you're saying that you prefer to do this:

    Code:
    // Requires underscore.js
    
    var arr = [1, 2, 1, 3, 1, 4, 1, 5];
    
    var uniqueArr = _.uniq(arr);
    
    _.each(uniqueArr, function(n) {
      // Do something with `n`.
    });
    
    ... instead of this:

    Code:
    // No external dependencies.
    
    var arr = [1, 2, 1, 3, 1, 4, 1, 5];
    
    var uniqueArr = arr.filter(function(n, i) {
      return arr.indexOf(n) === i;
    });
    
    uniqueArr.forEach(function(n) {
      // Do something with `n`.
    });
    
    You sure have an interesting point of view.
     
  15. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    I am not voicing the death of Python. There is a reason why many programming languages exist, in the case of Python it is often used in the science/math community as was mentioned.

    All I was pointing out is if someone is going to start from scratch, the largest reach would be JS which you had to learn anyways.

    As far as using libraries goes, that is why I said common used stuff should be put into CORE. The issue with JS is due to its versatility, it makes putting things into core more difficult due to all the parties involved, but that could be solved with an extra commons like library.

    And what format is that Web API going to be in? Chances are if its a new project, RESFTful JSON.

    Many desktop clients now use HTML/CSS/JS for interface.
    Many mobile apps use HTML/CSS/JS or hybrid

    It all depends on your target audience. One workplace I know still uses IE7 in their workplace where the native filter function doesn't work. Good luck explaining these things to why your application doesn't work to your boss.

    A big part of libraries is cross compatibility.
     
    Last edited: May 27, 2017
  16. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    If a company is using an obsolete version of a program ("obsolete" as in "no longer supported by their authors"), they have bigger problems to care about.
     
  17. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    Once I was told this:

    There is the right answer, the wrong answer and the microsoft answer.

    End of the day you can argue all day till your blue about the "right way" to go about things. But reality isn't that simple, you have to deal with what you are given. Companies have hundreds of applications and some need certain environments, so they need to transisiton all those applications before swapping environments.
     
  18. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    And those same companies are bound to suffer the consequences of things like WannaCry over and over again, until they learn the lesson.
     
  19. lnv

    lnv ✪ Well-Known Hypocrite

    Joined:
    Jan 24, 2017
    Messages:
    7,702
    Likes Received:
    9,044
    Reading List:
    Link
    That may be true, but let me ask you this question. Will you be willing to lose your job over stubbornness of being "technically correct"?
     
  20. noisypixy

    noisypixy Sacatunn que pen, que summum que tun.

    Joined:
    Jun 25, 2016
    Messages:
    716
    Likes Received:
    950
    Reading List:
    Link
    Of course. I got nothing to do with companies that don't value their own security (and, by extension, their employees'). I myself have left jobs for less.

    Unless I'm really desperate, I only work for people that I deem respectable.