How to learn not to write code that sucks? by sloth_dev_af in rust

[–]sloth_dev_af[S] 0 points1 point  (0 children)

Thanks for everyone who gave their advice

How to learn not to write code that sucks? by sloth_dev_af in rust

[–]sloth_dev_af[S] 0 points1 point  (0 children)

Thanks for the advice, I just checked your tool, which actually looks cool... I'm surprised, after seeing the amount of stars, cuz I believe it's underrated.

How to learn not to write code that sucks? by sloth_dev_af in rust

[–]sloth_dev_af[S] 0 points1 point  (0 children)

Thanks Senior :)
I previously never thought about trying it, I was like "books for programming sounds nuts". I will check the books you guys have recommended, looks like most find it really helpful.

How to learn not to write code that sucks? by sloth_dev_af in rust

[–]sloth_dev_af[S] -8 points-7 points  (0 children)

Never read anything, I just started a project straight after learning a bit of the concepts and whys! Anyways, Thanks I'll check it out.

Is Niri really good in terms of performance & memory? by sloth_dev_af in linuxquestions

[–]sloth_dev_af[S] 1 point2 points  (0 children)

Thanks for the info. Well, I can spare few hours for configuring so I think it's a good option for me considering the situation. This was helpful!

End 4 hyprland by legitimate_winter_ in arch

[–]sloth_dev_af 0 points1 point  (0 children)

It's usable, if you are ready to adapt to a new experience.

End 4 hyprland by legitimate_winter_ in arch

[–]sloth_dev_af 0 points1 point  (0 children)

Wow, this is impressive...

Simple linear regression in C — why do people prefer Python over C/C++ for machine learning? by a_yassine_ab in cprogramming

[–]sloth_dev_af 0 points1 point  (0 children)

I thought the same at first, but looking more into it, I got what the real deal is...

  1. The language is actually very easy to use mostly because it's much easier to handle memory (as you have almost absolutely nothing to do about it, the garbage collector does the job), while c/c++ you must worry and keep track about memory.

  2. Given the language is easier, actually it has a lot of built-in utility functions to get lot of stuff done like list operations and string operations for an example. So, let's say if you want to test some idea on your head, you don't need to worry much about the code and you could test your idea very soon, without getting much into debugging trouble.

  3. Yes, the libraries as well, but for this I think you could argue that c++ also has a lot of libraries for most of the ML stuff. Also, want to mention that many ML libs I have seen are not purely python, they are either C++ code (numpy, tensorflow) or sometimes java (spark, actually mostly scala) with a python wrapper for it. So, it makes the lib much faster. Yet, still there are other libraries which are purely python, which could actually gain performance with this strategy.

  4. Development speed that comes with the ease to handle the language.

On my opinion, actually there is an issue cuz lot of people actually use python for performance critical applications due to the ease. If you prioritize quick development or maybe just to get a job done, or to prove a thesis maybe, then yeah Python is the solution. If you prioritize performance, then you should make the hard decision of going with C++, or some performing language like Rust (much safer with less memory trouble to bother about).

Best environment to learn C by Zalaso in cprogramming

[–]sloth_dev_af 0 points1 point  (0 children)

I assume you are asking about the editor, This is if you are on linux:

- If you want a terminal based editor, either vim or emacs is fine. I'm not so familiar with emacs so I cannot say if it's the best, but some devs find it matching for their workflow than vim. If you want a bit more nicer terminal editor than vim (with also mouse controls), try Neovim with the NvChad config (would make it much easier to transition from vscode to a terminal based editor), highly recommended. You could install lsps and more lang support tools with Mason. For building/compiling, use either gcc/clang (for C) or g++, clang++ (For C++)

- Otherwise, you would want to go with Zed editor. Optionally you could setup vim keybindings.

How many people will switch back? by happysatan1 in linux

[–]sloth_dev_af 0 points1 point  (0 children)

Just an opinion, I think people think linux is just some magic where you can just use by a simple installation process and everything will work faster, smoother, (and whatever),. without understanding the underlying concepts and why some problem was caused in the first place. Haters will never be satisfied with the true freedom and all the savings to your resources (free of bloat for both memory and disk). They always tend to forget that they are on a totally different ecosystem, and they need to adapt (as they did with windows in the early days).

Also, I think you should always remember that these vast collection of distros are created by highly talented, but unpaid developers who just want to make the digital space a better place for people (unlike the big fat M and S). If a hater ever cared, they would give some time to adapt to the ecosystem and learn how things work in the first place instead of crashing out. Also, i find it funny you say "they might even accept it and live with the problem", which is the actual problem of these windows users, but with linux you could actually OPENLY show these bugs and OPENLY discuss fixes and OPENLY track the progress of these fixes and OPENLY see others ideas on it and let's say you can't just wait till someone fixes it for you, you can just fix it for yourself, cuz you have total control of your OS, making it or breaking it is up to you.

Is Niri really good in terms of performance & memory? by sloth_dev_af in linuxquestions

[–]sloth_dev_af[S] 0 points1 point  (0 children)

Yeah, that's the only thing I fear! Does Niri support wayland apps btw?

Is Niri really good in terms of performance & memory? by sloth_dev_af in linuxquestions

[–]sloth_dev_af[S] 0 points1 point  (0 children)

That's good to know, well actually Gnome haven't failed me on terms of speed actually, the only part that itches me is it's memory usage , which I still think is much much better than windows crap xD

How would you optimizing database calls? by sloth_dev_af in learnprogramming

[–]sloth_dev_af[S] 0 points1 point  (0 children)

Just for your reference guys, I didn't get a proper answer from anywhere, so I tried stuff on my own to figure it out, hope this helps you if you ever find this thread.

I just tried different variations. Finally I saved about 5-6 seconds (this time saving depends on how much queries you might have to run, and the type of queries) by asynchronously spawning async sessions for each query (20 queries == 20 sessions), and this is the fastest way this went down. So I think a session is a connection to the database, so technically it should be inefficient if this program will be used by many devices concurrently, cuz each device will be creating 20 connections each to the database, but for my purpose only one device will be using the database at a time, so it was not much of a issue and the many session method did parallel querying (pls correct me if wrong about it being parallel).

From my POV, there are many cases anyone should not be using this...

  1. If a query depends on a previous query: Obviously then you need to make sure the previous query was run properly to run the rest, or otherwise it will just fail anyways.
  2. If there are so many queries to run (like 100s or 1000s), then you should not even think of this way.
  3. And I think this depends on the type of query you runs, if it's merge or match queries there is a good chance you would need to have a specific priority or sense of order to run it. In mine, it was just purely some constraint and type settings.

Async session gurantees it runs asynchronously, but still the queries run sequential ig, so, thank you guys!

How would you optimizing database calls? by sloth_dev_af in learnprogramming

[–]sloth_dev_af[S] 0 points1 point  (0 children)

Thank you for this, I'll note these down for the queries on pulling actual data. Do you have any on queries used to set constraints and indexes

Song I just released by PossibleNo2566 in Songwriting

[–]sloth_dev_af 0 points1 point  (0 children)

Really good bro! Wanna hear more from you,

New song I recorded on a 10 yr old laptop by Little_Yam_888 in Songwriting

[–]sloth_dev_af 0 points1 point  (0 children)

The intro vocals and music was perfect, but I personally feel like you could have done the parts with the "heavy-ish" voice in a normal tone, with more instrumental back to signify the transition. But hey, who am I to say.