• Ever wanted an RSS feed of all your favorite gaming news sites? Go check out our new Gaming Headlines feed! Read more about it here.

Pokemaniac

Member
Oct 25, 2017
4,944
Actually I'd question long-term JVM as well. You are right that it's not going away in the next decade due to existing code but I strongly suspect WASM + WASI will eat it's lunch and GraalVM won't make much of an impact. It's been shown over and over that web-centric technologies will take over due to the much larger reach and I don't see this as any different. In fact, because node is so pervasive and re-writing library code again is such a waste of time even though organizations are pushing for node, WASM is really the best option for making sure things work in an agnostic way. I think containerization is also a stop-gap. Running a whole OS whether it be stripped down or not just to run application code is widely inefficient and I think as cloud computing evolves and we start really focusing on latency with edge computing and improving cold starts, again WASM becomes and interesting target because the isolation model already exists and scales much, much better. Take a look at CloudFlare's cloud workers, Fastly is also offering a similar thing. This is the future of serverless. You might still write it in Scala, but I doubt it'll be running on the JVM.
There's a very big difference between switching to another language on the JVM, and going all in on that language to the point where you could realistically target WASM. The former is typically just a few minor tweaks to your Gradle/Maven/Ant files. The latter will typically require very deep changes to the codebase to make it "portable", and throwing out possibly the entirety of your existing dependency tree.
 
Oct 25, 2017
3,789
There's a very big difference between switching to another language on the JVM, and going all in on that language to the point where you could realistically target WASM. The former is typically just a few minor tweaks to your Gradle/Maven/Ant files. The latter will typically require very deep changes to the codebase to make it "portable", and throwing out possibly the entirety of your existing dependency tree.

I think that will be the investments we see over the next decade. But moreover, a lot of the dependencies will already exist because many of the foundational libraries already exist in other forms (often built in C and C++) that can be compiled to WASM. You won't need to get JVM compatible in order to get what you want, and use Atwood's Law to its fullest.
 

mugurumakensei

Elizabeth, I’m coming to join you!
Member
Oct 25, 2017
11,320
WASM/WASI is probably a good decade away from being close to matching the most performant web service platforms on Java which is where a good portion of its base lies. Compile once is mostly only good for quick startups. For speed of a long running application (talking days to months to years at a time between updates), the lack of dynamic runtime optimization is a problem.
 

x.f

Member
Nov 1, 2017
72
Any Rubyists check out the annual language update? 2.7.0 seems fairly innocuous; I don't think I'll ever have to mess with the manual GC compaction in the Rails apps I manage. I'm more worried about the depreciation of the positional/keyword args stuff though since I have a large legacy code base that uses that heavily.
 
Oct 25, 2017
3,789
WASM/WASI is probably a good decade away from being close to matching the most performant web service platforms on Java which is where a good portion of its base lies. Compile once is mostly only good for quick startups. For speed of a long running application (talking days to months to years at a time between updates), the lack of dynamic runtime optimization is a problem.

WASM runtimes are built on top of javascript VMs which are some of the most optimized runtimes we have. There's literally every large company behind optimizing it, I don't see that as a problem. The reason it won't be as performant in isolation is because WASM is built with security first, and they will make those trade-offs, to the JVM it's always been secondary. But to my knowledge there is no real multi-user JVM solution on the horizon precisely because of that. And the long-running model is dying out anyway as the cloud means you are ready to scale up and down instances all the time to optimize for cost, reliability and performance and that's the type of optimization JS and WASM are really good at.
 

Pokemaniac

Member
Oct 25, 2017
4,944
WASM runtimes are built on top of javascript VMs which are some of the most optimized runtimes we have. There's literally every large company behind optimizing it, I don't see that as a problem. The reason it won't be as performant in isolation is because WASM is built with security first, and they will make those trade-offs, to the JVM it's always been secondary. But to my knowledge there is no real multi-user JVM solution on the horizon precisely because of that. And the long-running model is dying out anyway as the cloud means you are ready to scale up and down instances all the time to optimize for cost, reliability and performance and that's the type of optimization JS and WASM are really good at.
Let's not act like the JVM itself doesn't have a ton of effort put in to optimizing it as well. The garbage collectors in particular are very cutting edge. WASM isn't even really getting the full set of optimizations JS VMs usually apply, since it's (effectively) fully AOT instead of running in a JIT.

I also think you're vastly overestimating how dominant "serverless" will become. These sorts of trends ultimately tend to be fairly cyclical.
 
Oct 27, 2017
3,884
London
There's a lot of things you have to learn about JS and web APIs but once you do it becomes easier. I don't know what browser spec you teacher wants but minimalistic code would look like this:

JavaScript:
const myForm = document.querySelector("form");

myForm.addEventListener("submit", async e => {
    e.preventDefault();
    await fetch("/my/route/", {
        method: "post",
        headers: {
            "Content-Type": "application/json"
        },
        body: JSON.stringify(Object.fromEntries(new FormData(e.target)))
    });
});

  • Line one finds the form (I'm assuming it's the only one so I use the element name itself, usually you'd use an id)
  • myForm.addEventListener(...) listens for the forms submit event and then does the action. "submit" is the typical event that listens for button press, enter etc. It's prefered over button clicks which you might also be aware of as it has better default behavior and works better with form accessibility.
  • "e => { }" is shorthand for a function with parameter "e" (I use this name by convention but you can call it what you want) which is the event object any DOM event will pass to it's callback.
  • The "async" on the front of the function does a little magic to make asynchronous code easier to write, basically it lets me use the "await" keyword 2 lines down and this allows the fetch which is asynchronous to wait until it completes before moving to the next line.
  • There is no next line though, I'm just waiting for it to finish. Technically I didn't need either because I don't actually care when it finishes but I imagine you will and might want to show a message or something.
  • The e.preventDefault() prevents normal form submission behavior from triggering, I'm taking full control of the event, but normally forms have an action and method properties that tell it how to post and we wouldn't need to write any JS. Realistically you should just use those if you have the choice, but they are limited to posting form data and will cause a refresh which I'm guessing is what your activity is to enhance.
  • The fetch function takes a url as its first parameter, wherever you are sending the data
  • The second parameter is an object with several properties, method is the http verb you want to use, for data creation POST is typical but it depends on your server, these are just common conventions.
  • You need to add the content type header because your data should be interpreted as JSON. The string is the MIME type for JSON.
  • The body is the payload of the request but we're doing some interesting things here.
  • Starting from the right:
    • e.target is the form, same as myForm. I'm using the event target because if you had multiple forms the code is a little more portable.
    • We pass this to new FormData to construct the FormData object which basically splits the inputs into key value pairs based on the input's name and value. As you might expect this is for form data types specifically.
    • To turn that into JSON I use Object.fromEntries. This is a newer ECMAscript 2019 feature, to do it by hand you would loop through the entries (formData.entries()) in the form data and create an object. FormData is iterable (a special property that means we can loop through it directly) so objectFromEntries just works.
    • Finally the body can't be an object because we can only send serialized (binary/text) data over HTTP, FormData magically gets converted into its text representation (it looks similar to a query string) but objects do not. So we need to serialize it directly as text with JSON.stringify.

Thank you! That helped a lot, I was wondering why the database was listing name, etc. as "null", and that was driving me crazy, turns out JSON data is not the same as JS objects. Also I have another question for this thread, do input ID's and associated labels in HTML forms need to be different for every form you make if there are multiple forms on one page? I looked into a solution that lets you toggle which forms you see on the page using Javascript, and that seems to be the best step since it reduces the amount of unnecessary HTML pages. Part of my HTML is here:

HTML:
<form id="new_user">
            <h2>Create New User</h2>
          
            <h4>User Details</h4>
            <p>
                <label for="userName">Name:</label>
                <input type="text" id="userName" name="name" >
            </p>
            <p>
                <label for="userBarcode">Barcode:</label>
                <input type="number" id="userBarcode" name="barcode" >
            </p>
          
              
            <fieldset class="member-radio-btns">
                <legend>Member Type</legend>
                <label for="choice1">Student</label>
                <input type="radio" id="choice1" name="memberType" value="Student">
                <label for="choice2">Staff</label>
                <input type="radio" id="choice2" name="memberType" value="Staff">
            </fieldset>
            <input type="submit" name="submit" value="Create User">
          
        </form>
 

mugurumakensei

Elizabeth, I’m coming to join you!
Member
Oct 25, 2017
11,320
Thank you! That helped a lot, I was wondering why the database was listing name, etc. as "null", and that was driving me crazy, turns out JSON data is not the same as JS objects. Also I have another question for this thread, do input ID's and associated labels like for this part of code for example, need to be different for every form you make if there are multiple forms on one page? I looked into a solution that lets you toggle which forms you see on the page using Javascript, and that seems to be the best step since it reduces the amount of unnecessary HTML pages. Part of my HTML is here:

all id's must be unique. If they are not, it's not valid html, and there's no guarantee how a browser will react.

names are what's submitted by default with form submits. As far as names being unique, that's up to the back end.
 
Oct 25, 2017
3,789
Let's not act like the JVM itself doesn't have a ton of effort put in to optimizing it as well. The garbage collectors in particular are very cutting edge. WASM isn't even really getting the full set of optimizations JS VMs usually apply, since it's (effectively) fully AOT instead of running in a JIT.

I also think you're vastly overestimating how dominant "serverless" will become. These sorts of trends ultimately tend to be fairly cyclical.

WASM is actually just an AST, the runtime can optimize however it wants.

Serverless already is a dominant player in terms of web or any long running task like scientific computing, data mining, complex rendering etc. and it's going to get bigger. There are lots of reasons to resist it, but it's hard to argue it's cheap and maintaining your own farms is only worth it to the absolute largest of companies. I would hope that decentralized models pick up, but ultimately I don't see it happening as they don't offer performance and no company is giving up control of data as that's where the money and power is. Even companies that run their own servers will adopt similar models to get the most out of the investment.
 

NetMapel

Member
Oct 25, 2017
3,383
Just in case anybody here is using VSCode and its C++ extension and wondering why LLDB debugging in macOS Catalina isn't working... took me like two hours trying to figure this out and then decided to check the C++ extension's GitHub page:


Now for some humours... :)
unknown.png
 
Oct 26, 2017
19,729
Sorry to ramble, but....

I've been spending about 2 hours a day for the last week learning C++, then another 2 on Unreal Engine 4. My company I work for has been slicing jobs like crazy this last year, and company stock won't stop tumbling. I see the writing on the wall and I realize that I'm not qualified for shit if I lose my job, so I'm trying to take learning very seriously. UE4 is more for fun, but C++ I'm hoping to learn to open up opportunities in case my position does go away. Problem? Every damn time I go to YouTube, I am now getting recommendations for videos telling me "Top reasons I dropped C++" or "Why you should learn Java instead" etc. It's started to get to me, and I'm left wondering if C++ is an unwise first language to try and learn...
 

Deleted member 55966

User requested account closure
Banned
Apr 15, 2019
1,231
Sorry to ramble, but....

I've been spending about 2 hours a day for the last week learning C++, then another 2 on Unreal Engine 4. My company I work for has been slicing jobs like crazy this last year, and company stock won't stop tumbling. I see the writing on the wall and I realize that I'm not qualified for shit if I lose my job, so I'm trying to take learning very seriously. UE4 is more for fun, but C++ I'm hoping to learn to open up opportunities in case my position does go away. Problem? Every damn time I go to YouTube, I am now getting recommendations for videos telling me "Top reasons I dropped C++" or "Why you should learn Java instead" etc. It's started to get to me, and I'm left wondering if C++ is an unwise first language to try and learn...
C++ is your first language? Yeah, that's going to be an incredibly steep learning curve. A lot has changed in the past decade and there's twenty prior years of knowledge and educational materials out there that, while still useful, doesn't acknowledge all the new, helpful stuff. Plus C++ is a very large language.

C++ is still very widely used, but depending on what you want to work on C#, Java, or Python will help you out a lot more for your first go around.
 

ara

Member
Oct 26, 2017
13,000
C++ is a good first language in the sense that because it's so difficult, you're going to be much better equipped to learn other languages somewhere down the line. But yeah, the learning curve is steep indeed. We started with C++ in uni and even with all the teachers and resources, it was really damn hard.

If you're just looking to get employed in the field, java might be the better choice? Feel like java devs are needed everywhere.
 

Zoe

Member
Oct 25, 2017
14,228
I feel like the uses of C++ are too specific for a hobbyist to compete against people who learned it for years in school. Java will get you through the door quicker.

My University dropped C++ as an intro language almost 20 years ago.
 

Post Reply

Member
Aug 1, 2018
4,506
I feel like the uses of C++ are too specific for a hobbyist to compete against people who learned it for years in school. Java will get you through the door quicker.

My University dropped C++ as an intro language almost 20 years ago.

Yeah, my school's intro programming class taught C and then every class after that was C++. They now use Java and Python.

In fact, my first programming job used Java for development and Python for tooling/DevOps.
 
Oct 26, 2017
19,729
Thank you, everyone. I really appreciate the responses. I'm going to sit down tonight after work and re-evaluate my choices here, and more than likely gear shift.
 

Deleted member 55966

User requested account closure
Banned
Apr 15, 2019
1,231
Thank you, everyone. I really appreciate the responses. I'm going to sit down tonight after work and re-evaluate my choices here, and more than likely gear shift.
I feel like it's also important to point out certain languages are dominant in certain domains. If C++ is difficult but you like making games or squeezing every ounce of performance out of a system then it might be the best choice. If you want to do that but are looking for an immediate job then maybe switch to C and look for embedded / manufacturing / medical jobs.

You're never going anywhere outside a large enterprise with Java. C# is a pretty similar answer, but it seems to have made in roads in server side web dev.

Python appears to be a big second language for shops. Easy to learn and powerful enough to do everything else. Also seems big in data science.

Take these things into consideration when thinking through your next steps.
 

manifest73

Member
Oct 28, 2017
515
What are your career goals? If you want to a job where you make games (or be an indie dev and make your own) you probably want to learn C++ or C# (for Unity), though if you are joining a larger company and are happy to work on tooling/live ops/etc there are a number of other options. If this is your first language you'll almost certainly have an easier go at it with C#.

But if your goal is just to be employable i'd steer you in the direction of JavaScript (node.js if you want to work on backend - and whatever if you want to work in the browser). There is a huge number of jobs available using is and a giant shortage of developers. If you can demonstrate competence you shouldn't have too much trouble finding work. If JS is not your thing then Python and Java are also great languages to get your foot in the door somewhere.

If aren't super confident in your abilities and you have the means (mostly the time, but they can be expensive) coding bootcamps are an option - my understanding is they typically teach either JavaScript or Python. Personally I have mixed feelings about them, but if you can make it through and get that first programming job somewhere you will likely be able to pull down a six figure salary within a few years.
 

firehawk12

Member
Oct 25, 2017
24,158
Somewhat random question. I'm trying to understand composition and I'm wondering if my own semantic understanding of how it's used makes sense:

Rather that define methods inside a superclass that are inherited by subclasses, you are defining individual methods as classes onto themselves and then you create objects that implement these classes as properties.

So if you were implementing a vehicle subclasses like "car" and "truck", rather than have car and truck inherent from a vehicle superclass, you create "drive" and "park" methods and that are implemented by both "car" and "truck" instead?
 
Oct 25, 2017
3,789
Somewhat random question. I'm trying to understand composition and I'm wondering if my own semantic understanding of how it's used makes sense:

Rather that define methods inside a superclass that are inherited by subclasses, you are defining individual methods as classes onto themselves and then you create objects that implement these classes as properties.

So if you were implementing a vehicle subclasses like "car" and "truck", rather than have car and truck inherent from a vehicle superclass, you create "drive" and "park" methods and that are implemented by both "car" and "truck" instead?

Close. You wouldn't make classes but rather interfaces for those methods as most languages don't support multi-inheritance but do allow you to implement multiple interfaces (if you are using a cool language you can even have default implementations of methods on interfaces). Class inheritance is rather limiting which is why people like to do it this way. Also, subclassing tends to get unwieldy after the first level. Note that this is just a form of composition, different languages have different ways to do it but the overall idea is that you combine different useful aspects to build up your object. A common OO setup could look like:

Code:
interface Parkable {
    void park()
}

interface Drivable {
    void drive()
}

class car implements Drivable, Parkable {
    void park() { ... } //implementation
    void drive() { ... } //implementation
}
 

firehawk12

Member
Oct 25, 2017
24,158
Close. You wouldn't make classes but rather interfaces for those methods as most languages don't support multi-inheritance but do allow you to implement multiple interfaces (if you are using a cool language you can even have default implementations of methods on interfaces). Class inheritance is rather limiting which is why people like to do it this way. Also, subclassing tends to get unwieldy after the first level. Note that this is just a form of composition, different languages have different ways to do it but the overall idea is that you combine different useful aspects to build up your object. A common OO setup could look like:

Code:
interface Parkable {
    void park()
}

interface Drivable {
    void drive()
}

class car implements Drivable, Parkable {
    void park() { ... } //implementation
    void drive() { ... } //implementation
}

Oh interesting, so you are basically saying that a class will implement these methods, but the methods themselves are still written within the class itself? You're just guaranteeing that your class will implement the interfaces and that the program will be able to call these methods any time a new "car" class is created?
 

mugurumakensei

Elizabeth, I’m coming to join you!
Member
Oct 25, 2017
11,320
Oh interesting, so you are basically saying that a class will implement these methods, but the methods themselves are still written within the class itself? You're just guaranteeing that your class will implement the interfaces and that the program will be able to call these methods any time a new "car" class is created?

right, it's basically a guarantee the class will implement w that returns x, takes in y, and throws z where x = return type, y is zero or more parameters, and z some type of exception

When you have default implementations, it helps with avoiding duplicate code if most implementations will be the same.
 

firehawk12

Member
Oct 25, 2017
24,158
right, it's basically a guarantee the class will implement w that returns x, takes in y, and throws z where x = return type, y is zero or more parameters, and z some type of exception
What happens if you know that every vehicle type will have the exact same drive method? Is there a way to write an interface method that makes it apply to every class that implements it without having to duplicate code?
 

mugurumakensei

Elizabeth, I’m coming to join you!
Member
Oct 25, 2017
11,320

mugurumakensei

Elizabeth, I’m coming to join you!
Member
Oct 25, 2017
11,320
Ah interesting. Thanks.

I can see why composition is more flexible. I think I've just gotten so used to class inheritance since it just appears everywhere. lol

In Java, combining annotations and interfaces can give you a really painless way of decorating classes but I'd worry about that more with advanced topics in composition.
 

NetMapel

Member
Oct 25, 2017
3,383
Starting to learn programming with C++ seems like a really difficult thing to do. I feel like it'd be better to start with an easier interpreted OOP language instead like python or java. That way, you can focus on learning OOP design patterns. Then you can pick up more complicated language like C++ which gives you even more control and memory management.
 
Dec 4, 2018
533
Starting to learn programming with C++ seems like a really difficult thing to do. I feel like it'd be better to start with an easier interpreted OOP language instead like python or java. That way, you can focus on learning OOP design patterns. Then you can pick up more complicated language like C++ which gives you even more control and memory management.

What are you trying to accomplish with this post? Are you looking for validation?
 
Oct 26, 2017
19,729
Thank you again to everyone for your considerate answers!

What are your career goals? If you want to a job where you make games (or be an indie dev and make your own) you probably want to learn C++ or C# (for Unity), though if you are joining a larger company and are happy to work on tooling/live ops/etc there are a number of other options. If this is your first language you'll almost certainly have an easier go at it with C#.

But if your goal is just to be employable i'd steer you in the direction of JavaScript (node.js if you want to work on backend - and whatever if you want to work in the browser). There is a huge number of jobs available using is and a giant shortage of developers. If you can demonstrate competence you shouldn't have too much trouble finding work. If JS is not your thing then Python and Java are also great languages to get your foot in the door somewhere.

If aren't super confident in your abilities and you have the means (mostly the time, but they can be expensive) coding bootcamps are an option - my understanding is they typically teach either JavaScript or Python. Personally I have mixed feelings about them, but if you can make it through and get that first programming job somewhere you will likely be able to pull down a six figure salary within a few years.
For right now, my goal is just to be employable. I sense the impending doom of my company, I have 0 other skills, and want to make sure I can take care of my family. I've landed here because I've dabbled in programming in the past, and really enjoyed it. I have too many hobbies though, and was afraid of being jack of all trades, master of none. So, I dropped programming so I could focus on guitar, writing, photography, etc. My guitar time has fallen off drastically since marriage, and programming can fill that void while also helping me bit a little more employable. At least, that's the hope!
 

Vector

Member
Feb 28, 2018
6,631
If you want to do game development then C++ is obviously what you want to focus on.

It's not as hard as some people make it out to be - the OOP principles are the same across all OOP languages, and although there are C++ specific implementation steps (like header files, library linking, manual deallocation of memory etc.) it shouldn't take long to get familiar with it.

If you specifically want to hone in on game development, I would definitely recommend picking up a good C++ course to get you started - starting with Python would probably raise more questions if you decide to immediately dive into C++ afterwards.
 
Dec 4, 2018
533
Oh sorry I was more or less responding to Vincent Alexander's previous post about picking up C++ as his first language.

No worries. I just wasn't sure if you were looking for a advice, validation, or just a ramble. Didn't understand the context but now I do.

That seems unnecessarily harsh.
You're reading too much into it.


Sorry to ramble, but....

I've been spending about 2 hours a day for the last week learning C++, then another 2 on Unreal Engine 4. My company I work for has been slicing jobs like crazy this last year, and company stock won't stop tumbling. I see the writing on the wall and I realize that I'm not qualified for shit if I lose my job, so I'm trying to take learning very seriously. UE4 is more for fun, but C++ I'm hoping to learn to open up opportunities in case my position does go away. Problem? Every damn time I go to YouTube, I am now getting recommendations for videos telling me "Top reasons I dropped C++" or "Why you should learn Java instead" etc. It's started to get to me, and I'm left wondering if C++ is an unwise first language to try and learn...

Hi Vincent,
I know you're freaking out. Take a breath and do some meditation. A few points of advice:

  1. Don't listen to what everyone says you should learn. There will always be a Youtube video, blog, recruiter, someone telling you should be learning something while you're learning another thing.
  2. Make plans, a short term and a long term along with a contingency plan.
  3. Short term option, take a React / Javascript crash course online, stick to it. Easy, straight forward, cheap/ free options to learn.
  4. Don't be afraid of going down to Trader Joes, Starbucks, Costco (great benefits) to get an application or get a waiter job if you get fired tomorrow. Make that contingency plan now.

I know how you feel but you need to convince yourself you have skills and that is why you have a job doing what you do today. Now is the time to review everything you've done at that job and update that CV and resume.

Long term, you have to figure out where you want to be, network with those people and find out what foundations they have that got them there and make that decision.

Good Luck. Feel free to ask for resume critiques where you can get them.
 

NetMapel

Member
Oct 25, 2017
3,383
endBracket.h
C++:
}

main.cpp
C++:
#include <iostream>

int main()
{
    std::cout << "Hello world!\n";
#include "endBracket.h"
Learning C++ and I like to live dangerously 😎
 

Deleted member 55966

User requested account closure
Banned
Apr 15, 2019
1,231
endBracket.h
C++:
}

main.cpp
C++:
#include <iostream>

int main()
{
    std::cout << "Hello world!\n";
#include "endBracket.h"
Learning C++ and I like to live dangerously 😎
Fire that man!

Just kidding, you can still have your job if you can find out what doesn't compile (without copying and compiling!).
C++:
#include <array>
#include <iostream>
#include <string>

int main()
{
    std::array<std::string, 4> people { { "Bob" },
                                        { "Joe" },
                                        { "Lisa" },
                                        { "Olivia" } };

    for(auto it = people.begin();
        it != people.end();
        std::cout << *it, it++);

    return 0;
}
 

NetMapel

Member
Oct 25, 2017
3,383
Fire that man!

Just kidding, you can still have your job if you can find out what doesn't compile (without copying and compiling!).
C++:
#include <array>
#include <iostream>
#include <string>

int main()
{
    std::array<std::string, 4> people { { "Bob" },
                                        { "Joe" },
                                        { "Lisa" },
                                        { "Olivia" } };

    for(auto it = people.begin();
        it != people.end();
        std::cout << *it, it++);

    return 0;
}
That looks like a for loop without opening and closing bracket? Is that the issue you're referring to?
 

Deleted member 55966

User requested account closure
Banned
Apr 15, 2019
1,231

Sensei

Avenger
Oct 25, 2017
6,495
how did you guys get to the point in your learning where you understood that you could create something useful with the knowledge that you have?

i think that this is somewhat confusing to me as someone who is new to programming... i have these building blocks but organizing them feels somewhat... esoteric???? music and drawing seem much more straightforward in my head
 

merzpup

Member
Oct 11, 2019
37
Did music and drawing feel straightforward at the beginning too? Because that's not definitely my case...

Although when it comes to programming I think it's easier to feel that disconnection between grasping the foundation and being able to finish something that feels functional; it does have a steeper learning curve due to an intrinsically wider foundation of basic knowledge.

What do you know about programming? What are you able to do? What are you studying it for?

p.s: first resetera post yay 👋
 

Sensei

Avenger
Oct 25, 2017
6,495
Did music and drawing feel straightforward at the beginning too? Because that's not definitely my case...

Although when it comes to programming I think it's easier to feel that disconnection between grasping the foundation and being able to finish something that feels functional; it does have a steeper learning curve due to an intrinsically wider foundation of basic knowledge.

What do you know about programming? What are you able to do? What are you studying it for?

p.s: first resetera post yay 👋
hello !

hmm... for me, learning to read music was basically just following instructions. i just needed to learn the "language" of it and then i could play the song. i didnt have to create the song from what i knew, i just would read and play. learning the instrument itself was tough at the start, but i didnt have to "create" anything by learning how to play the notes or to breathe properly. if i could play it, i could use it to perform what was already written for me. and once you know one instrument, every instrument after that is easier to learn (imo), which is what i've read about coding/programming. 🤔

and drawing lets me deconstruct things into basic shapes so i can build on those, and those basic shapes are basically the... instructions... like reading and playing the music on a page 🤔 🤔 🤔

i think that what those things have and what coding doesnt is that i dont have instructions. or maybe there are instructions, but i dont recognize them yet since i am so new to coding 🤔 (i've only been doing it for a few weeks now).

HTML has been very straightforward (i'm re-learning it alongside CSS and Javascript because i want to make a website), but when i do non-html things i have to go to a tutorial and look up how to do it. and when i do that, i feel like i'm just copying and not actually learning

but from typing all this, i remember when i was doing private lessons and my teacher was getting me to learn how to read music in a different pitch and i was frustrated because i felt like i was doing rote memory and not actually learning or understanding what i was doing and he said "i know you feel like you're just doing it as muscle memory, but there's nothing wrong with that right now. that's part of learning." hmm... 🤔 this was a good talk mr. merzpup, i think i understand now 🤔 thank you for helping me remember my teacher! youre a very good poster already

i will keep studying
 

Deleted member 55966

User requested account closure
Banned
Apr 15, 2019
1,231
p.s: first resetera post yay 👋
Welcome!

how did you guys get to the point in your learning where you understood that you could create something useful with the knowledge that you have?

i think that this is somewhat confusing to me as someone who is new to programming... i have these building blocks but organizing them feels somewhat... esoteric???? music and drawing seem much more straightforward in my head
Drawing is actually a good connection. To draw you need to know what surfaces work best for your future drawing, what materials to use for the surface you're using, and how to properly store your drawing for future use. Once you know that, you move to how to draw basic shapes, represent objects from different perspectives, maybe move to shading and coloring. All the while, you have an idea of what you want to do in your mind. You might have gotten that idea from a book, picture, or something in your environment, but you still have the idea in your head of what you want to do.

Programming is radically similar in this regard. Your surface is your environment (OS / web / embedded / Excel *shudder*), your materials are the language you're using (Python?), your storage is some sort of file system (maybe synced between multiple because you don't want to lose it). You probably breezed through this because you wanted to start learning, but like a great artist you'll probably spend a decent amount of time thinking about this for some future project. Your basic shapes are your functions, loops, expressions, and statements. You'll probably learn to represent them in different ways through imperative, object-oriented, functional, or aspect-oriented paradigms. Without a what though, this'll all seem daunting and scattered. What's the need to learn more?

Like drawing you learn more to better represent your idea. You can create something useful right now with what you know, you just need an idea to start putting that knowledge to practice. You'll quickly find though that what you know will make it hard to put that idea into practice. When you feel like things are needlessly hard or you can't make some part of your idea work then you do some research on the problem, learn more, then put it into practice. If you need some more structure right now, you can look up the path of the CS degree of your local university.

Hope that was actually useful.
 

opticalmace

Member
Oct 27, 2017
4,029
Has anyone taken any of the AWS certification exams? My current workplace uses their own cloud/data center setup, I was thinking about maybe learning AWS for fun in my own time (for future job prospects). Might ask some questions if someone's done some of them.
 
Oct 25, 2017
3,789
hello !

hmm... for me, learning to read music was basically just following instructions. i just needed to learn the "language" of it and then i could play the song. i didnt have to create the song from what i knew, i just would read and play. learning the instrument itself was tough at the start, but i didnt have to "create" anything by learning how to play the notes or to breathe properly. if i could play it, i could use it to perform what was already written for me. and once you know one instrument, every instrument after that is easier to learn (imo), which is what i've read about coding/programming. 🤔

and drawing lets me deconstruct things into basic shapes so i can build on those, and those basic shapes are basically the... instructions... like reading and playing the music on a page 🤔 🤔 🤔

i think that what those things have and what coding doesnt is that i dont have instructions. or maybe there are instructions, but i dont recognize them yet since i am so new to coding 🤔 (i've only been doing it for a few weeks now).

HTML has been very straightforward (i'm re-learning it alongside CSS and Javascript because i want to make a website), but when i do non-html things i have to go to a tutorial and look up how to do it. and when i do that, i feel like i'm just copying and not actually learning

but from typing all this, i remember when i was doing private lessons and my teacher was getting me to learn how to read music in a different pitch and i was frustrated because i felt like i was doing rote memory and not actually learning or understanding what i was doing and he said "i know you feel like you're just doing it as muscle memory, but there's nothing wrong with that right now. that's part of learning." hmm... 🤔 this was a good talk mr. merzpup, i think i understand now 🤔 thank you for helping me remember my teacher! youre a very good poster already

i will keep studying

I don't know if there was a point where I suddenly thought that. Most of the time it's just doing something until it becomes so repetitive that you stop having to look it up and debugging it so many times you intuitively understand what happened when things go bad and architect ways to avoid it. I can say it takes hundreds of hours to get there, without doing this 8 hours a day it would be very hard to build up proficiency. Over my year end break I've been doing more work on 3D engines which is not something I normally deal with. I've gone through these exercises about half a dozen times and it's always confusing and I feel like I'm just code copying, but each time I feel a little more comfortable with what I'm doing. It's okay if only about 10% sticks each time.

I think in general you learn the most from debugging, being forced to dig into the unfamiliar step-by-step to truly discover what went wrong is where you really get an expertise.
 

lupin23rd

Member
Oct 27, 2017
590
Happy new year all!

Been doing some interview coding tests recently and came across one where I understand how to solve it, but think there's a more optimal solution that doesn't involve (m)any loops.

I think it was called ring buffer?

Input looks like this:
"2 1 one two three"

First number is size of a new array. Second number is the i-th element (what we'll check later).

The rest of the string is a list of words that go into the array, and you start back at the beginning if you have more words than space. Could be more, less or equal

ie at the end of the above, the array is [three, two], and you want the first element value, so the answer is three.

I know you can fill in the array first then check the desired element, but I'm thinking there is some sort of optimal solution that involves math (probably some kind of division).

Anyone with some good solutions to this? (Hopefully I've explained it well)
 

metaprogram

Member
Oct 28, 2017
1,174
Happy new year all!

Been doing some interview coding tests recently and came across one where I understand how to solve it, but think there's a more optimal solution that doesn't involve (m)any loops.

I think it was called ring buffer?

Input looks like this:
"2 1 one two three"

First number is size of a new array. Second number is the i-th element (what we'll check later).

The rest of the string is a list of words that go into the array, and you start back at the beginning if you have more words than space. Could be more, less or equal

ie at the end of the above, the array is [three, two], and you want the first element value, so the answer is three.

I know you can fill in the array first then check the desired element, but I'm thinking there is some sort of optimal solution that involves math (probably some kind of division).

Anyone with some good solutions to this? (Hopefully I've explained it well)

array[i % size] = value

?
 

firehawk12

Member
Oct 25, 2017
24,158
Here's another mundane question - are UUID's the best way to create unique identifiers that can later be used in a database (or at least cross-referenced)?

I thought about trying to manually craft a unique id/key system that would have semantic meaning to my workplace, but I assume that's not an afternoon project...
 

Zevenberge

Member
Oct 27, 2017
570
Here's another mundane question - are UUID's the best way to create unique identifiers that can later be used in a database (or at least cross-referenced)?

I thought about trying to manually craft a unique id/key system that would have semantic meaning to my workplace, but I assume that's not an afternoon project...

You can use integer identities. Generally you let the database manage the counter, which increments on each insert. In SQL you can have an identity column. RavenDB has an option to let the database concat an integer ID to a collection name (table) (set Id = "event|", to have the events collection be assigned an ID). I don't know the various options for other databases.

If you need to assign the ID up front, you can look at HiLo identifiers: https://stackoverflow.com/questions/282099/whats-the-hi-lo-algorithm
 

firehawk12

Member
Oct 25, 2017
24,158
You can use integer identities. Generally you let the database manage the counter, which increments on each insert. In SQL you can have an identity column. RavenDB has an option to let the database concat an integer ID to a collection name (table) (set Id = "event|", to have the events collection be assigned an ID). I don't know the various options for other databases.

If you need to assign the ID up front, you can look at HiLo identifiers: https://stackoverflow.com/questions/282099/whats-the-hi-lo-algorithm
Yeah, I'm trying to figure out if it's just better to use the system to do it - we use something that would generate UUIDs. I'll take a look at hi lo and see what I can do with it, thanks!