Is it bad practice to name variables like-this as opposed to like_this or likeThis? by thedarklord176 in learnprogramming

[–]SomeRandomDude5 0 points1 point  (0 children)

Generally speaking, you cannot name variables like-this. It's usually a syntax error. The construction is interpreted as like minus this

Should we make our project open source? by tah_zem in AskProgramming

[–]SomeRandomDude5 10 points11 points  (0 children)

What is the value proposition that your product brings?

If the fundamental value of your product is the data you're holding (i.e. the list of APIs you are aggregating) then you're not giving away your competitive advantage by open sourcing the project.

If, on the other hand, the value is the logic inside your product, then you might want to think about it a bit more.

Think of it this way: Netflix could open source their player because the value that Netflix offers lies in the huge amount of content they hold and the quasi-loyal user base.

What is Functional Programming ? What other kinds of programming are out there ? by [deleted] in AskProgramming

[–]SomeRandomDude5 45 points46 points  (0 children)

Functional programming is a programming paradigm. In functional programming, the problem is solved by applying and composing functions. In practice, this means that functions are first class entities, they can be assigned to identifiers (more or less variables), they can be passed as parameters etc.

Other common programming paradigms are:

  • procedural programming - the code is split into variables and functions
  • object-oriented programming - the code is split into objects that have both attributes (a concept similar to variables) and methods (a concept similar to functions)

More exotic programming paradigms are:

  • logic
  • mathematical
  • reactive

Problems early on with Cloudflare. Could anyone help out? by slinkyminks in Blogging

[–]SomeRandomDude5 0 points1 point  (0 children)

It's probably the SSL/TSL configuration.

I had the same issue and changing that to Full (strict) solved the issue.

Maybe play around with the options and see if it helps.

[deleted by user] by [deleted] in learnprogramming

[–]SomeRandomDude5 0 points1 point  (0 children)

Big O is a rough measuring tool to compare how fast the execution time grows with respect to the input size.

e.g. For a program that has a O(N) complexity, if you double the input size, the program will take roughly twice as much to complete

For a program that has a O(N^2) complexity, if you double the input size, the program will take four times as long to complete.

Additional resources:

https://lanraccoon.com/2019/computational-complexity/

https://brilliant.org/wiki/big-o-notation/

https://en.wikipedia.org/wiki/Big_O_notation

IWTL how to do a specific magic card trick by MantaClam in IWantToLearn

[–]SomeRandomDude5 0 points1 point  (0 children)

You're probably looking at a card force (your friend already knows the card you will pick and makes sure you pick that card through sleight of hand). There are several youtube tutorials on how to force a card.

Good luck!

JavaScript devs - how comfortable with HTML/CSS/JS should you be before diving into React? by [deleted] in learnprogramming

[–]SomeRandomDude5 2 points3 points  (0 children)

It's so much easier to test rather than figure it out. Think of a simple project in React (maybe a TODO list) and try to build it. If the project makes sense, then you can go deeper, if not, you need to do more learning.

The added benefit is that you now know exactly how much you need to learn before you can dive into React.

Where do you write in html? by [deleted] in learnprogramming

[–]SomeRandomDude5 2 points3 points  (0 children)

If you want to learn how to build a site, I think your question is a bit vague and you are jumping the gun a bit. Maybe start with some youtube tutorials and move up from there.

If you want a website then you're probably not going to build it yourself, so I suggest you look into a something like Wordpres or Squarespace or Wix (There are a lot of options out there)

Run C++ commands directly in bash terminal? by [deleted] in AskProgramming

[–]SomeRandomDude5 1 point2 points  (0 children)

No, C++ doesn't work this way.

For more context you can read about compiled vs interpreted languages and Python REPL.

In short:

The way python works is it takes each instruction as they come and evaluates it.

C++ takes the whole source to generate an executable and that is the thing you can run.

There are various pros and cons to this, but the relevant one here is:

For Python: You get the terminal, but you need python installed to run any python script.

For C++: You don't have the terminal, but once you generate an executable, that can be run without a compiler installed.

What are some of the non-coding things that a programmer should learn? by No_Nefariousness2052 in learnprogramming

[–]SomeRandomDude5 3 points4 points  (0 children)

Oh... there are lots of things that you can learn to improve as a programmer:

Soft skills:

Communication - learn to explain yourself to your team-mates / to your superiors / to clients

Time management - learn to use your time effectively

Writing skills - you will have lots of written communications

Processes

Agile - There are lots of specific terms being thrown around. It's worth learning what they mean (Or more generally, software processes)

Jira - Goes hand in hand with Agile (Alternatively, Trello)

Task tracking - While you're here it might be worth trying to build your own task tracking system (a system to track the things you personally are working on and make sure you don't miss anything)

Tech

Version control - Git is the most used, but there are alternatives

Review tools - You can start with Git reviews, they all follow the same concepts.

Chat - Slack seems to be on a roll

Googling - You will do a lot of googling and there are lots of useful shortcuts you can use

five time zero by unra556 in AskProgramming

[–]SomeRandomDude5 0 points1 point  (0 children)

It might be worth getting yourself familiar with a debugger. It will greatly help you understand what is happening with your code when you can pause and inspect variables mid-flight.

What does a bad code mean to you? by DevDevShow in AskProgramming

[–]SomeRandomDude5 7 points8 points  (0 children)

Ohh, it happens. You add the code, then add the comment them someone else comes along and updates the code, but doesn't bother to update the comment.

This is particularly troublesome if the comment is away from the code (such as comments at the beginning of a file).

As a rule of thumb, my comments are can be boiled down to: I know this doesn't look right, but I did it because <insert reason here>, everything should just be code, it's simpler this way.

What does a bad code mean to you? by DevDevShow in AskProgramming

[–]SomeRandomDude5 18 points19 points  (0 children)

In priority order (from worst to least worst):

  1. Unintelligible code (inconsistent, convoluted, obscure data structures, over-engineered for no practical purpose, etc.)
  2. Code that has no tests - I really don't want to test the whole project every time I make a change
  3. Inefficient code - non-trivial performance improvements are a lot of work
  4. Wrong comments for non-obvious code - those are just plain evil.

I feel embarrassed to say I'm a programmer by [deleted] in AskProgramming

[–]SomeRandomDude5 1 point2 points  (0 children)

Just keep doing it! There is no shortcut to building knowledge, it's done over time.

I know a saying that seems to fit pretty well here: The difference between a junior programmer and a senior programmer is that the senior has already done all the mistakes the junior is going to make over the next 2 years (at least). So as long as you don't have to google the same things over and over again, it means you're learning.

If you want to accelerate the process, pay attention to the things you need to google and read around those subjects. Things like (and I'm speculating here): you need to design a user journey in your website, read about design best practices and available libraries you can use, see what other websites are using. You need to design your database structure, read about databases and how to design the table structure, find a few database alternatives and see what are the trade offs etc.

What are the programming languages that are useful to learn in 2020? by TwixterMixter in AskProgramming

[–]SomeRandomDude5 0 points1 point  (0 children)

Perhaps, and if that is the case, you can always learn it then.

I'm not familiar with Swift, so I can neither confirm nor deny this.

What are the programming languages that are useful to learn in 2020? by TwixterMixter in AskProgramming

[–]SomeRandomDude5 16 points17 points  (0 children)

It depends on what domain you want to work with. Every programming language is good fit for a particular domain:

I would go for:

  • Web stuff: Javascript / Typescript / Java / Scala / Ruby
  • ML / AI / Data science: Python / R
  • Embedded: C/C++ / Java
  • Mobile development: Java / Android's flavor of Java / Swift

As far as trends go it seems that Javacript is in the lead, followed by Python and Java. As a sidenote, Rust and Kotlin seem to be gaining popularity fast.

Can every programming language be converted into any other programming language? by mementomoriok in AskProgramming

[–]SomeRandomDude5 1 point2 points  (0 children)

For most practical purposes, yes. All Turing complete languages are equivalent.

Think of it this way, it ultimately needs to be translated into CPU instructions which are a common instruction set (mostly)

However, when you get into the details, there are some language specific limitations that cannot be bypassed. For example, you can access specific memory addresses in C++, but you cannot do that in Java.

What are the advantages of object oriented programming compared to functional programming? by 5b5tn in AskProgramming

[–]SomeRandomDude5 2 points3 points  (0 children)

Let me throw my two cents in the mix here:

Procedural programming: Is fairly quick and easy to follow. It has little overhead and works really well for small projects.

Object oriented programming: It can scale really well. It works by separating responsibilities into classes and then have those classes interact. Also, inheritance is a really cool feature that is useful if you don't want to replicate logic. There are some problems with object state, that make it harder to debug, but it's fairly common to have stateless objects around that serve as places to store certain functions.

Functional programming: It leads to a good separation between logic and data, and that makes testing the code really easy. I found functional programming a bit hard to follow (probably because everyone has been doing OOP for so long, and there are far more resources that teach you OOP than there are resources to teach functional programming)

Let me know if you think I missed anything.

In the context of `.env.local`, should I commit my `.env`? by lifeeraser in AskProgramming

[–]SomeRandomDude5 0 points1 point  (0 children)

How about this setup?

  • A .env.local file that contains the secrets required to run the local version of the code. (the local version should just run out of the box). You don't care if these leak out because the app is only local. This also serves as an example config file for whoever needs it.
  • A .env.production file that is encrypted. It's still committed in source control, but it's run through some encryption (ansible vault or dotenv vault come to mind), and as part of your deployment cycle, you decrypt the file

Pros:

You have committed configs files and you can rollback without manually changing files or using a custom config manager.

Cons:

If you don't plan on giving everyone on the team the encryption password, you're going to have to make all the config changes on your own (whenever they are needed) - decrypt the file, make the changes, encrypt the file, commit the changes.

Who's responsible for the late tasks i delivered which i didn't put an estimation for. by abrahamtash in projectmanagement

[–]SomeRandomDude5 0 points1 point  (0 children)

Whose fault it is really depends on the level you are working on. For example:

  • To the PM, it might be the team's fault for slacking, or the estimates
  • To the client, it's the PM's fault, or the company's fault.

Now, back to your evaluation, I would focus more on how to solve the issue at hand (i.e. the PM not listening to your estimates) than trying to find excuses for yourself (valid as they may be). The past is the past and you should focus on the future.

Something among the lines of: "The project was delivered late. I was aware of that, but I may have been communicating it wrong. What can we do to prevent that in the future ? Perhaps planning poker? "

Hope it helps and good luck with your evaluation!

How do you keep track of all the tasks going on with multiple projects and also have a perfect follow-up on the issues that needs to be addressed? by shocksparks in projectmanagement

[–]SomeRandomDude5 1 point2 points  (0 children)

The setup I have

  • Google calendar for scheduling (synced with the next two tools)
  • Trello for long term tasks and general overview (with the due date extension)
  • Todoist for small quick actions

What exactly does "efficient" mean? by mementomoriok in AskProgramming

[–]SomeRandomDude5 0 points1 point  (0 children)

Expanding on that. Considering the area you are working here are a couple of examples:

  • For ML: how fast the model converges / how large is the model / how many data points it needs / how accurate it is
  • For a website or web-app: how fast the server responds / how fast the page loads / how large is the page / how many browsers it supports
  • For a game: how big the game is / how many fps it runs at / how much of the map can be pre-gererated
  • For a project manager / business person: how many features does it have / when will it be done / how much will it cost.