this post was submitted on 11 Jul 2023
26 points (100.0% liked)

General Programming Discussion

7704 readers
1 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS
 

I don't really want to go in depth into programming, I just want to know what I'm looking at if I ever come across anything like that at my job (mechanical engineering) and maybe solve some simple problems.

I learned C and Java in my first year in college, but it's all mostly forgotten. I'm leaning towards Python since I read it's relatively simple and used a lot nowadays, and it's what my teachers used later on in college anyway.

What do you guys think?

Thanks in advance!

top 21 comments
sorted by: hot top controversial new old
[–] randombullet@lemmy.world 23 points 1 year ago

I have a vote for Python. It's like child's play vs Java.

[–] justsayit@lemm.ee 14 points 1 year ago (1 children)

Python or Go.

I recommend people try learning Python through Jupyter Notebooks as a first attempt. It’s nice being able to run individual blocks of code and auto printing of output is great for learning more quickly.

Go is just a generally straightforward language and is known for being productive after a short time of learning. Plus generating binaries that can run anywhere can be a motivator if you’re planning on sharing the output of your programming.

[–] G0FuckThyself@lemmy.world 6 points 1 year ago

+1 to python and go

[–] ShadowRam@kbin.social 10 points 1 year ago (1 children)

For mechanical engineering, any thing computer or programming related will be

Python and C/C++

knowing your way around MATLAB.

and maybe possibly Ladder-Logic or Function Block. (PLC's and the like)

All depends on what engineering you end up doing. But Python is a good place to start.

[–] Linnce@lemmy.ml 1 points 1 year ago

That's good to know, thanks!

[–] Miro@lemmy.world 5 points 1 year ago

Humble Bundle is actually running a pretty good promotion on Python courses/materials.

I haven't opened them yet but there are like 45 items in that bundle. I had decided to learn a new language myself and this made the choice for me.

If it’s just for learning I’d say JavaScript. It’s in basically everything online and there are plenty of free learning tools and courses. It has a bit of everything and no types makes it pretty beginner friendly.

[–] iByteABit@kbin.social 4 points 1 year ago

No idea about mechanical engineering, but Python is so easy to learn that you have a huge benefit over cost (in time) for it

[–] rikudou@lemmings.world 4 points 1 year ago

I'd go with php, it can be strictly or loosely typed, has C-like syntax (same as C#, Java, C, C++, Javascript and others) and has a huge standard library built-in, so for a lot of tasks you don't even need an external dependency.

[–] Rhin0@lemmy.world 4 points 1 year ago

C is the way to go my friend. The popular languages such as Python which you mentioned, are just C in a trench coat. It's all abstraction. If you understand C, you will be able to understand any language.

[–] ramblingsteve@lemmy.world 4 points 1 year ago* (last edited 1 year ago)

To flip this around, think of some projects you want to do. The languages are just tools and will be determined by what you want to do, and then each type of project has it's best tool chain. Think of the problem(s) you want to solve first and the rest will follow.

[–] Eavolution@kbin.social 3 points 1 year ago

This won't be very popular, but something with manual memory management. You probably won't use it a whole tonne, but that's not the important thing. The important thing is the understanding of memory concepts such as addressing and pointers.

Personally I learned C++ first, haven't used it a whole lot, but it absolutely helped me understand other languages much much much better.

[–] addie@feddit.uk 3 points 1 year ago

Another vote for Python. It's quick to learn the basics, and there are libraries available to let you achieve most anything. You can program it in a procedural, functional or object-oriented way, and if you understand those, you'll be well set-up to learn any other language. You may not need to learn any other languages - Python is both comprehensive and available in most places, and you can make a career out of it.

My primary problem with Python is that its unstructured nature causes bigger projects to collapse into a big ball of mud after a while - any function being able to accept any argument is more of a curse than a blessing. And I wouldn't want to code collaboratively in it - Java, for all it gets shit, is blessfully limited in what nonsense my coworkers can get up to.

It's also not 'fast', although it's made great strides. I did Advent Of Code in Python this year; a simple rewrite in C++ only acheived about a 4× speed-up, when it used to be 10× a few years ago, and that's for some very algorithm-heavy code. Python multithreading is still pretty terrible, though, so if you're really wanting to get the best out of your computer you'll want to use a native-code library like NumPy, or use some other language.

[–] gsx@discuss.tchncs.de 3 points 1 year ago (1 children)

You should learn the basics of VBA, as much as I despise this language, I can tell you as a mechanical engineer myself, that you will stumble over countless excel sheets with VBA from your colleges and it's good to have at least a rough understanding of what they did. Also it's unfortunately the automation/macro language of many CAD-Systems (Catia, SolidWorks, Inventor,… to name just a few). Python with jupyter notebooks or julia with weave are also worth taking a look into it. They a both pretty good for calculations + documentation and drawing nice graphs. That's what most of my collegues do in excel with VBA, but it's much nicer to do in the two mentioned before.

[–] Linnce@lemmy.ml 1 points 1 year ago

This feels like the best answer so far, there's nothing better than experience huh. Thanks a lot.

[–] cassetti@kbin.social 3 points 1 year ago

Wanna learn something completely different yet useful? Check out OpenSCAD - it's a very simple programming language which lets you generate 3D models that you can then export and 3D print (you can also export 2D models in vectorized 2D formats like DXF and SVG)

Really simple software to learn, but extremely empowering when paired with a 3D printer

[–] maporita@lemmy.ml 3 points 1 year ago

Apart from a front end language like Python it's always good to know basic SQL. A lot of engineering software uses some sort of relational database and it's handy to be able to query the data source directly. If you're going to be doing any kind of data analysis then look at R also.

[–] nik282000@lemmy.ml 2 points 1 year ago

Python is easy to pick up but it is very different from Java/C/C++ so it may or may not help you in understanding other people's work. If you are just messing around I would recommend looking at Python, Processing.org (Java) and Arduino(C++). If you can solve the same simple problems with all three you will be set for most anything (and you get to play around with Arduinos).

[–] Darkrai@kbin.social 2 points 1 year ago

If you go with Python and prefer a video tutorial I used this free course. It might be too basic and beginner level for you however. https://learning.edx.org/course/course-v1:HarvardX+CS50P+Python/home

[–] Prefix@lemm.ee 1 points 1 year ago

I think JavaScript is a great first language. Easy to pick up, but lots of potential (frontend/backend/native). A lot of people dislike JavaScript (some valid reasons, some not) but it's undeniably a great first language.

[–] peter@feddit.uk 1 points 1 year ago

Python is good but the syntax is quite different from what you get in most other languages, so if you then want to learn another language you might find it a higher learning curve than if you learnt something like Java or Javascript

load more comments
view more: next ›