1
7

I am trying to come-up with a reusable template to quickly start new projects using my prefered tools and frameworks, and I'm happy with what I got. However, using Docker is quite new for me and I've probably done some weird or unconventional stuff in my docker-compose.yml or my Dockerfiles. I'd love to learn from people with more experience with Docker, so feel free to tell me everything that is wrong with my setup.

I'm more confident about the stuff I did with Python/Django and Nuxt, but all criticism is welcome. This also applies to the readme : I'd like to provide detailed instructions about working with this project template, so please report anything that is unclear or missing.

Thank you to anyone who takes the time to check it out and help me make this useful to as many people as possible.

2
114
submitted 13 hours ago* (last edited 13 hours ago) by SendMeYourTaTas@sh.itjust.works to c/programming@programming.dev

Hello!

I just wanted to make a post to share my excitement over discovering programming with Java. For context, my previous knowledge of any programming language barely extended into classes as I always struggled with understanding more than the basic basic things (classes? like what you wear on your face? get and set what? the table?).

I really liked the idea of programming though! So over the years (maybe 15-20?), I tried learning (and failed) with different languages, hoping something would help things click. I've tried C#, Basic, JavaScript, HTML/CSS and more but never Java. As to why not, I have no clue.

The reason for Java, now, is that I've been playing Minecraft a lot recently (my adhd thanks you Mojang) and I figured, why not give it a try? So I started a free online course covering the basics: variables, methods, objects... A week later, and after a lot of DuckDuckGoing, I now understand not only the basics but classes, IO, exceptions, and so much more! I'm currently wrapping my head around Generics but I'm having a wonderful time with it. After that, who knows :)

Take care and thank you for reading!

3
-2

In this article, we want to share our experience with fellow developers and offer insights using real-life examples on how to identify and optimize slow SQL queries, especially when working with relational database management systems like PostgreSQL, MySQL, MSSQL, Oracle, etc.

4
30
5
49
6
180
7
27
C and Hare communities (programming.dev)
submitted 1 day ago* (last edited 1 day ago) by modev@programming.dev to c/programming@programming.dev

I like to introduce you to matrix spaces for two languages, one is old and mature, and the other is new, effective, and promising.

#clang:bsd.cafe The C programming language

Rooms:

#hare:bsd.cafe The Hare programming language

Rooms:

8
253

On the one side I really like c and c++ because they’re fun and have great performance; they don’t feel like your fighting the language and let me feel sort of creative in the way I do things(compared with something like Rust or Swift).

On the other hand, when weighing one’s feelings against the common good, I guess it’s not really a contest. Plus I suspect a lot of my annoyance with languages like rust stems from not being as familiar with the paradigm. What do you all think?

9
183

As someone who spends time programming, I of course find myself in conversations with people who aren't as familiar with it. It doesn't happen all the time, but these discussions can lead to people coming up with some pretty wild misconceptions about what programming is and what programmers do.

  • I'm sure many of you have had similar experiences. So, I thought it would be interesting to ask.
10
21

You can use ASDL to describe the tree grammar of your language. After doing that, translate the code to C by running it through my program. Now you have a C file that contains a bunch of constructors, type defs, macros, etc ,that describe the AST of your language. Two examples, a basic one, and one for regex, has been provided. There's an e simple one for m4 in the man page.

Some people may need further explanations so let's go ahead and do it:

When you pass a program to the compiler or the interpreter, or another application does that for you, it first gets 'lexed', that is, every token is scanned and categorized. Then, these tokens are used to 'parse' the program. That is, the chunks of token are used to define the structure of your program, based on a pre-conceived grammar. For example, in my ASDL implementation, you can view the grammar for ASDL in both Yacc format and in EBNF format (in companions/GRAMMAR.ebnf).

Now, the parser takes 'semantic' actions whenever it successfully parses a chunk of code. In the early days of computing, people just printed Assembly code! But now, with optimizing compilers and stuff like that, there was need to represent the language in form of a tree. The parser tree was first used. But parser trees are dense, so 'abstract' form it was used, which is what this program makes. You can see the abstract structures that represent ASDL itself, in absyn.c.

After you translate your code to AST, you can translate it to DAGs ,or Directed Acyclic Graphs, to get the flow of the program. Then a control flow graph. If your language is interpeted, you can translate it to your VM bytecode.

So this is what ASDL is. A tool for constructing compilers and interpeters, and other DSLs perhaps?

I explained why I created this. Basically, the original implementation was useless.

Thanks.

11
18

Note: I call the scientists in this post by last name, not because I think I am their 'peer' but because that's how the English language works, and if I put 'Mr' before every last name, I'll sound like Consulla asking for Lemon Pledge! I am 30, will turn 31 in less than 20 days. I am the same age as the year of the Eternal September. I was born with web, but I hope Web dies before me!

Also, if you don't know who Alan Kay is, don't be distraught or feel like you're an 'outsider' (especially if you are not much into the 'science' side of programming). Just think he's a very important figure in CS (he is, you could look him up perhaps?)

Now, let me explain what Kay told me.

Basically, Kay thinks WWW people ignored works of people like Englebert and the NLS system, and it was a folly.

Dough Englebert, before UDP was even though of and TCP was a twinkle in the eyes of its creators, before Ethernet was created, back when switches were LARGE min-computers and ARPA was not DAPRA, tried his hand at sending media across a network (the aforementioned ARPA, you may know it from /usr/include/net/arpa), he even managed to do video conferencing. That was in the 1960s! He came up with a 'protocol' and this 'protocol' is not a TCP/IP stack we know today, it was completely different. I don't think he even called it that. The name of this 'protocol' was 'Online System' or NLS.

Englebert's NLS was different from the 4-lays abstraction we know and love today. It was different from web. It was like sending 'computations' across. Like a Flash clip! Kay believes that, WWW people should not have sent a 'page', they should have sent a 'process'. He basically says "You're on a computer, goddamit, send something that can be computed! Not plaintext!"

Full disclosure, yes, Kay is too brutal to Lee in this answer. I don't deny that. And his 'Doghouse' analogy is a bit reductive. But I digress.

Kay believes the TCP/IP stack is sound. I think anyone who has read a Network Theory book (like Computer Networking A Top-Down Approach which I have recently perused through) doesn't subject this. But he believes people are misusing it, abusing it, or not using it right.

In the speech which I am referring to at the question title, Kay said:

[Paraphrasing] "This is what happens when we let physicists play computer [...] If a computer scientist were to create 'web', he would do a pipeline, ending at X"

X refers to X Windowing System used in UNIX systems, it's a standard like Web is. The implementation of X11 on my system is Xorg. It's being slowly replaced by wayland.

So what does this mean? Well Kay says, 'send a process that can be piped'! Does it sound dangerous and insecure? WELL DON'T ELEVATE ITS ACCESS!

Imagine if this process-based protocol was too, called web, and the utility to interface with it was called 'wcomm', just like wget is. To view a video:

Imagine PostScript was strong enough to describe videos with. So we could get a video from Youtube, render it, and watch it:

$ ~ wcomm youtube.com/fSWmufgTp6EQ.ps | mkmpg | xwatch

So what is different here? How is it different than using a utility like ytdl and piping it to VLC?

Remember, when we do that, we are getting a binary file. But in my imaginary example, we are getting a 'video description' in form of PostScript.

====

So anyways, as I said, I am not super expert myself. But I think this is what Kay means. As Kay says himself, PostScript is too weak for today's use! But I guess, if Web was not this 'hacky', there would be a 'WebScript' that did that!

Thanks.

12
20
submitted 2 days ago* (last edited 1 day ago) by Asudox@lemmy.world to c/programming@programming.dev

So I want to make a new project. It will have a website and an algorithm which will handle the requests. The thing is, web development in Rust feels harder than say in Go or Python. So I thought maybe I could somehow make bindings in Rust for Go since the faster the algorithm is, the better. However, that seems to complicate stuff as well. So do you think I should just rewrite the current algorithm in Go? Is it fast enough for it to not be a noticeable difference?

Edit: Thanks for the suggestions and advice! I decided to go with Rust for the website with Axum and the algorithm as well.

13
97
14
31

I'm in a situation where I'm looking for jobs local to me with decent pay and benefits. I did searches on all the major job sites with my criteria, sorted how I want, striped out the session ids and saved the links in an auto hotkey script so I can quickly check each site every day.

I still have issues with irrelevant results, such as jobs on towns I have no desire to commute to, companies I would never work for, and jobs with requirements I don't have, such as nursing.

I'm not really a programmer, but I can tinker around with things to an extent. It would be nice to be able to scrape these sites in order to reduce the irrelevant postings, I just don't know how to go about it.

15
18

Like let's say I have a few old HP alphanumeric LED displays that have a simple bit pattern protocol. I've gotten them working in Arduino a long time ago. If I can find some unused pins how can I bit bang them into a custom protocol from user space using pins that may be unrelated as far as I/O ports on a modern computer? Is it even possible without a kernel module? Am I stuck with using a serial channel like SPI/I2C/UART to talk to an external controller?

16
60
17
30
18
36
19
5

I wrote a post about how our Operational Transfomation (OT) algorithm works at Fiberplane. OT is an algorithm that enables real-time collaboration, and I also built and designed our implementation. So if you have any questions, I'd be happy to answer them!

20
-2

Consider this: it's much easier to parse S-Expressions than JSON! Plus, in statically typed languages, this script could excel, because it declares the type first. Remember that you can always use my S-Expression parser in C to parse them:

https://gist.github.com/Chubek/d2f0ac9067521716d2ab31c93948e885

PS: Is it just me, or 'JSON to Sexp' sounds like 'Jason 2: Sex Pest'?

21
15

As a total beginner to c++ I am looking for learning resources, be they books or videos.

22
133

I could use some honest advice from experienced programmers and engineers.

I'm almost at the two year mark as a developer. On paper I might look like a passable Junior Dev, but if you sat me down and asked me about algorithms or anything else I did to get my job in the first place I would be clueless. I can solve problems and always get my work done, but I don't even know the language/framework I use daily well enough to explain what's going on, I can just do things. I don't think I have imposter syndrome, I think I really might have let any skill I had atrophy.

I used to enjoy programming as a hobby in my spare time, but in two years I've opened the IDE on my personal machine no more than twice. People talk about all the side projects they have, but I have none. I feel too stressed out from the job to do any programming outside of work, even though I love it. I feel like I can't level up from a Junior to Senior because I either don't have the headspace or the will to do so. It doesn't help that the job I've had has taught me very little and my dev team has been a shitshow from the beginning.

At the moment I have an offer on the table to do a job that isn't engineering (but still tech) and it surprisingly pays more. Part of me thinks I should take that job, rediscover my passion in my spare time and build my skills, but I fear I might go down this route and never be able to come back to engineering. Not that I'm sure I want to.

It might sound defeatist but I don't think I'll ever be a top 5% or even 25% engineer. I could be average with a lot of work, but not great. I could potentially be great in the new field I'm being recruited for, but that's also hard to say without being in the job.

I know that some people just aren't cut out for being engineers. Maybe I have the aptitude but not the mentality to do this for 30+ years. I want to know if that's what it sounds like to people who've seen that before. If you were in my position, would you walk away and just be a hobbyist programmer or stick it out and hope to be a mediocre engineer one day?

23
28
submitted 4 days ago* (last edited 4 days ago) by starman@programming.dev to c/programming@programming.dev
24
8
Microsoft DevBlogs now federated (devblogs.microsoft.com)

cross-posted from: https://programming.dev/post/10535103

Microsoft DevBlogs has just been federated and can be followed at @msftdevblogs@dotnet.social.

Thanks to @mapache@hachyderm.io!

25
68
view more: next ›

Programming

15099 readers
714 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 8 months ago
MODERATORS