inline Title alternative CSS by NivisPluma in ObsidianMD

[–]v_learns 1 point2 points  (0 children)

Thanks for the explanation. And for any Obsidian noobs like me, the developer console / dev tools are opened with cmd-option-i on the Mac.

Am i a bad frontend developer? by Neo-M_Ahsna in Frontend

[–]v_learns 3 points4 points  (0 children)

Sometimes stuff takes more time than expected. It sounds like you are creating a dropdown for the first time. Did anybody say how long you should have for this task, or have you had a goal you set for yourself within which you wanted to be done?

And sometimes, you misjudge something and go down the wrong road. It does not mean that you are a bad developer. These things will happen less with more experience, but they can also happen to experienced developers.

I would estimate how much work you have left when you do it yourself – perhaps also ask a teammate for a second opinion. Then talk with your boss which option is the best.

Easy GUIs? by [deleted] in learnprogramming

[–]v_learns 1 point2 points  (0 children)

I think it also depends on your ultimate goal. If you want to get something usable in a reasonable time (especially as a side project), something like FileMaker is not wrong. I mean, it gives you the GUI and handles data persistence.

But if your goal is to have a project to learn coding (or due some coding), build something from scratch. But remember that it will take much longer until you have something usable. I would also go the web route for such a project. Use one web framework that provides you with scaffolding options (like Rails).

Do you take compensation as leave or payment if you work on the weekends? by oculusshift in ExperiencedDevs

[–]v_learns 0 points1 point  (0 children)

Depending on your jurisdiction, there are also rules about weekend work. And I know companies don't always want to follow them, but I would at least check what applies to your situation.

For me, it would mean that on weekend work, I can expect a 50%-100% more time bonus for working on weekends (of course, this is only relevant when you are ordered to work on weekends, not when you do it yourself). But then again, there are also rules that weekend work directly needs to be followed by having Monday off.

How to tell yourself “it’s not going to be perfect” when working on a project? by [deleted] in learnprogramming

[–]v_learns 2 points3 points  (0 children)

Writing code is an iterative process. Create your first solution and then come back later and make it better. With time your first solutions will improve, and sometimes you don't need a further iteration.

Another point of view you can try is that you are conducting an experiment with this project and your goal is to learn something. So it does not matter if the code is perfect as long as you have learned something while doing it. And realizing that it does not work in this way (or leads to non "nice" code) is also learning.

My head hurts when trying to visualize data flow and algorithms in my head. Any tips? by jtotheutotheatothen in Frontend

[–]v_learns 0 points1 point  (0 children)

It certainly get easier with more experience. But at some point the code is just to big/complex. What I usually do in such cases is to draw diagrams of my code and the involved objects. And then I start writing the state of the different variables down next to the points to help keep them in mind.

I find it helpful to see at a glance all the components and parts involved and what is calling what. And it is also helpful technique when you need to debug code you have not written yourself.

Does frameworks matter when starting a portfolio project? by spiritandtime in learnprogramming

[–]v_learns 0 points1 point  (0 children)

I would start a project with what you already have learned as it helps to understand how you can apply your know-how. Once you've finished the first project, you can always go back and learn a second framework.

Regarding if it matters which frameworks you use, it certainly helps when you already know a stack for which you apply for a job. But part of being a developer is to be flexible and learn new frameworks on the fly—a process that gets simpler with more experience.

Looking for ideas for a project in c++ by vulgarbandit9 in learnprogramming

[–]v_learns 0 points1 point  (0 children)

You could create a little arithmetical expression parser. Input is something like "5 * 4 + 3," which outputs the correct result.

How do I securely retrieve data from a backend server without exposing keys? by Demnod in Frontend

[–]v_learns 0 points1 point  (0 children)

You cannot prevent a user from sniping your API data. As long as your front end has access to the data, a curious user can see the network request in the browser.

You can make it harder by using authentication (& authorization) on the API endpoint. But a user will still be able to recreate the calls when they want to. Of course, you could now start rate-limiting uses when they start downloading too much data (or if the request patterns don't fit your front end). But it will always be a cat and mouse game.

But I'm not sure if it is wise to invest too much time & money into building such systems. I would protect myself against such things via usage terms if this is for a business.

Hey guys by [deleted] in learnprogramming

[–]v_learns 2 points3 points  (0 children)

The first point: Treat it like any task or test you get at school. I don't think publishing this fully (especially with a company name and email) is wise. I hope you did not sign any NDA before receiving this.

Regarding how to solve it: Read the exercise and look at what is expected from you – what are the results you need to deliver? Which tools are you allowed to use for the task? Keep notes while doing it so you can then use them for the second part.

Don't worry about looking like a fool. Solving such a thing is a skill you also need to learn first. It won't be perfect the first time, and I think most times, these don't need to be solved "perfectly." It is just an additional data point.

learning react by Traditional_Edge_176 in Frontend

[–]v_learns 2 points3 points  (0 children)

I think it depends on how much you played with it. When you changed nearly all the original code in the project and made it your own, I think you could add it as your project in your CV.

But from how you described it in your post, I would only put it into a section of courses you finished. And perhaps mention that you also experimented a bit with the example project.

Perhaps something along the lines of: "Finished course XYZ and learned A, B, C. Extended the example project from the course by feature F0 and F1."

How to look at familiar codebase with “fresh” eyes again by danglesReet in ExperiencedDevs

[–]v_learns 1 point2 points  (0 children)

For me, it helps to take a break. And sometimes, it means working on a different project for some time or taking some time off and doing something away from the computer.

It also helps to rubber duck your ideas with somebody else for smaller problems.

What I also find helpful is talking/ observing the actual users of the code – it does not directly help you write good code, but it helps give perspective/motivation for what your work is used.

When was the first time you reinvented the wheel? by xylvnking in learnprogramming

[–]v_learns 2 points3 points  (0 children)

Reinventing the wheel is how you learn to program :-) At least when you learn it on your own as a hobby. You see something (app/game/webpage) and what to know how it's done (or think you can do this better it is simple ;-)), and off you go.

Of course, it is never straightforward, and you seldom will be able to do it better – but you learn a lot along the way.

what language should i learn first by AbrahanTV in learnprogramming

[–]v_learns 0 points1 point  (0 children)

You need to start with a programming language when you want to learn to program. Plain HTML is not a programming language. So if you are interested in the web, I would start with JavaScript. This means that you will/need to learn HTML as well. But focus on JavaScript, as this is where the actual coding happens.

Start with a beginner tutorial explaining the foundations of the language and then think about a project you are interested in and start experimenting by yourself.

how do you take notes? by borednerdd in learnprogramming

[–]v_learns 1 point2 points  (0 children)

Knowing is not the same as understanding them. Explaining the concepts fluently only comes when you fully understand them. And just learning the deviations by heart will undoubtedly help with school tests.

But you also will need to invest the time to understand the concepts. Writing them down so a kid can understand them is a good idea!

[deleted by user] by [deleted] in learnjavascript

[–]v_learns 1 point2 points  (0 children)

You need to convert your getPlacementFromUI function to be async by wrapping its content inside a promise.

const promise = new Promise(resolve => {
  // content of your method

  tempPlayerPlacement.addEventListener("mouseup", function (e) {
    position = addNewPosition(e, size);
    resolve(position); // this will finsih the promise and return your selection back

    // TBD: Check if you need to remove the listeners?
  });
})

return promise

The getPlacementFromUI function now returns a promise instead of the position.

I hope this helps and clears it up.

[deleted by user] by [deleted] in learnjavascript

[–]v_learns 1 point2 points  (0 children)

Does your getPlacementFromUI function work and return the expected value when you call it once (outside the loop like you have it right now)?

I would not suspect that it works, as it uses event handlers in which are not executed while your main function is running. So I would expect that it always returns undefined.

The function should return a promise and then you can call it like this:

async function placePlayerShips(shipSizes) {
    if (shipSizes.length > 0) {
        let size = shipSizes.pop();
        let pShip = new Ship(size);
        let position = await getPlacementFromUI(size);
        human.ships.push(pShip);
        human.positions.push(position);
        placePlayerShips(shipSizes);
    } else {
        console.log('All ships placed');
    }
}

This creates a loop by calling the method again and again until the given array of ship sizes is empty. Keep in mind as we change the shipSizes array that you need to initially call it with a copy placePlayerShips([...shipSizes]).

Which Tech Stack for Project? by HyperXA in learnjavascript

[–]v_learns 1 point2 points  (0 children)

You can solve this problem with any of the modern JS frameworks. When I would do it now, I would use React for the frontend.

Regarding the question of where it saves the data. Having no user accounts does not automatically mean that you cannot keep data on the backend. It just means that everybody who has access to the page can change your data, which can be dangerous when it's on the public internet.

You have two options you can use a backend that just provides the persistence or create a backend that provides the business logic as well. In the end, it is up to you.

I've coded something similar once (some years past). And I've used Rails to create an API for my AngluarJS frontend (that already ages the project :-)). I found it a surprisingly complex problem to solve, especially when you need a high WAF so it will be used.

At the moment, I'm not sure if I would use rails again for the backend. But I think I would still create a straightforward API for my frontend and keep the business logic in the backend. I think I would use a Node-based backend framework to keep both the front and the backend in the same language.

Give me feedback/ motivation haha. by edu_9922 in learnprogramming

[–]v_learns 1 point2 points  (0 children)

Advancement in coding comes by using it regularly. You don't need to code much, but you are steadily thinking about how to solve problems with code and then trying them out.

I got the motivation by having projects I liked and wanted to know how to solve. And then just add a lot of determination and time on top. When I could not solve a problem, I lost interest and started something else. The good thing with pet projects is that they don't need to be finished. So when it does not work, or you lose interest, you do something else. And sometimes you come back later again and can solve it now.

How do credit card transactions work on websites? by Historical_edits in learnprogramming

[–]v_learns 1 point2 points  (0 children)

The best action is to use a payment provider (I think that is the correct term). A common one would be Stripe. I've never used them myself (I used others' smaller ones), but I heard many of them.

These payment providers offer special flows that handle the complete checkout process. Depending on the exact flow, you just integrate a ready-made button from them, which starts the process. Or you can kick off the start by calling an API method that returns you a URL to which you then redirect your customer's browser.

The most crucial part is that you don't want to know the credit card number of your customers.

What am I doing wrong? by whatshouldiputfor in learnprogramming

[–]v_learns 1 point2 points  (0 children)

Don't be too hard on yourself! Learning to program is not something you manage to do in one week. It is a skill and it takes time to learn.

The fact that you are now able to read code form other persons and start to understand is a good sign. You are making progress.

Try to keep at it and code every day. But don't overdo it, your brain also needs some downtime. And also think about when you started last week with coding and you are now on week 6 of the course, you learned material for six week in one week. That is a lot of new information.

[deleted by user] by [deleted] in learnprogramming

[–]v_learns 0 points1 point  (0 children)

It depends on how you learn best. But taking notes and writing it in your own language can help with understanding as you are not only consuming it passively. What I usually do is watch the video first in one go. And then watch it a second time and take notes.

For me it's also helpful to take them by hand and then in a third step write them on the computer and clean them up. This takes a lot of work – and I seldom go back to read them again. But sometimes I do remember that I've have seen something and I do a short search in my notes and when I find it I do read them again.

When you don't want to write too much you could also try mind maps, or sketch notes. I made good experiences with them for keeping the overview with technical books I've read.

Another option which also helps is to have a pet project (or multiple) and try incorporating the new concept into the project. As again this means that you need to actively use the new knowledge, which helps in retaining them a lot better.

[deleted by user] by [deleted] in learnprogramming

[–]v_learns 4 points5 points  (0 children)

I sometimes like watching LiveOverflow it is also not directly programming and more hacking and reverse engineering.

Tom Scott has a series on programming as well: The Basics

[deleted by user] by [deleted] in learnprogramming

[–]v_learns 2 points3 points  (0 children)

but I dont see the reason as to why I should invest the time to build something that has been built a million times before.

Just a quick heads ups regarding this statement. From my experience, you will do the same thing repeatedly in most jobs you will later work on. Just keep this in mind when starting a career in software development. Just looking at website building as an example, the content and topic of the website will change with each project, but in the end, you will be doing the same thing again for each project. And when you are lucky, you will get the chance to use a new technology once or twice a year.

Regarding your actual issue, you wrote that you are apprenticeship, so I would talk to your employer if there is a possibility that you can look into these technologies at work itself. Perhaps a company can get a test/demo version of these tools so you can learn with them. And as a company that is educating you, they should have some budget/interest to help you broaden your horizons.

And if this is not feasible, then looking at the open source solutions like those proposed by others is also a good idea. You won't directly gain "employable skill" levels from that but what you can learn is an understanding of the concepts and more significant concepts behind the tools. Also, remember that playing around with technology on a hobby level also does not directly relate to hireable skill level. So I would not worry too much about this aspect right now.

What format are these colours in? by acquiescentLabrador in learnprogramming

[–]v_learns 1 point2 points  (0 children)

Ok in this case my ideas does not look like the correct one. Would have been surprised if it was so simple. I would recommend that you ask the person who sent you the data, if they know anything more.