It looks like you're using an Ad Blocker.

Please white-list or disable AboveTopSecret.com in your ad-blocking tool.

Thank you.

 

Some features of ATS will be disabled while you continue to use an ad-blocker.

 

A guide to programming - Part 1: Variables

page: 2
13
<< 1   >>

log in

join
share:

posted on Apr, 23 2021 @ 03:53 PM
link   

originally posted by: Midnite247
So just to clarify, it’s not a great idea for a thread, 😂😂

I understood your opinion, I just see things in a different way.


So my job is to cut to the chase, separate the wheat from the chaff,
in that when ur talking careers ur already talking full stack , back end/front end developer , to talk about basic entry level coding, is like starting a financial thread of economics starting with basic maths.

Live is more than a career, what stops people from having a career and an hobby in a completely different field?


The point being anyone interested in the thread already has a grasp of the basics, and an explanation of the basics is of no interest to anyone who has no interest in the topic.

Not necessarily, people may be interested in the topic of the thread but they are only starting to think about it. For people in that situation, this may help.


Unless the thread is going to progress to a intermediate/advanced understanding of coding, there’s no point in it.
Just sayin

Well, there's nothing preventing the thread from doing just that.



posted on Apr, 23 2021 @ 04:04 PM
link   

originally posted by: ThatDamnDuckAgain


Code's like this

double BaselineThrottleVal = 0; //real time Throttle value
double BaselineThrottleValAvrg = 0; //averaged Throttle value
double CollectiveBaselineThrottleVal =0; //Temp var for collecting measurements and do comparision
int CollectiveBaselineThrottleValCounter =5;


loop
...
...
secret stuff happening not even touching this var
...
...


//comment: this for loop is constantly running on a different thread, all custom function are on own thread but thread safe and can touch global vars

for(int i=0;i<CollectiveBaselineThrottleValCounter ;i++)
{
BaselineThrottleVal = IO.Thrttle; //IO.Thrttle contains double 0.0-0.999 representing 0-100%, it's filled by ECU on runtime.
CollectiveBaselineThrottleValCounter++;
CollectiveBaselineThrottleVal += BaselineThrottleVal;

//comment: (double) casts int into double
}
BaselineThrottleValAvrg = CollectiveBaselineThrottleVal / (double)CollectiveBaselineThrottleValCounter ;

loop end

I hope I haven't missed any character.

Here's the rest of the post:

Sometimes there's values like 391.13130310 just as an example.

Note this is not a feedback loop with the throttle, I can only do other things like inject less or more fuel, shift injection timing and duration or ignition timings and angles or open exhaust and intake gates (few other stuff). It doesn't have any effect on the main ECUs safety mechanisms, yes it's about programming a car


Hope I didn't confuse too much, like I say, very beginner.



posted on Apr, 23 2021 @ 04:12 PM
link   
a reply to: ArMaP

Thank you, in future I will quote



posted on Apr, 23 2021 @ 04:30 PM
link   
a reply to: ArMaP

Totally agree,it is my opinion, and I’m not disparaging either the topic or anyone contributing to it. I’m not.
I’m just saying I don’t think it belongs in either this ATS site or this forum, it’s
1. Too technical a convo for general discussion and/or
2. The content is too technically detailed for the general subject. ( ie, writing specific code lines when talking about the introductory elements of basic coding which are the basic building blocks for anyone interested in the topic is really like talking about learning your ABC’s in a creative writing course, or a literature course, .

I’d say the point is if I was starting a thread on literature I wouldn’t start with “we start with ‘learning A,B, C’ ... I think I would make clear such a thread as “this is an introduction to A,B,C.... not advanced literature , get me?



posted on Apr, 23 2021 @ 05:29 PM
link   
a reply to: ChaoticOrder

My apologies,I don’t want to seem a Dk, it’s not the content I’m slagging it’s the forum,
If I’m in an aeroplane and see 2 mags,
1 basic coding; in all over it, does what it says in the tin, it’s an interesting topic, can be as basic or advanced as u like and as ur prepared to get into it
2 general stuff.com magazine .. ... I’m not reading this


edit on 23-4-2021 by Midnite247 because: (no reason given)



posted on Apr, 23 2021 @ 05:54 PM
link   
a reply to: Midnite247

There's no problem with this kind of thread on ATS, i just think it needs a better title that accurately reflects the contents myself.



posted on Apr, 23 2021 @ 06:00 PM
link   

originally posted by: jerich0
10 A$ = "Holy Moly, how far we've come."
20 PRINT A$
30 GOTO 10

cheers, I'll read this properly, as a self taught coder from the old days. always good to keep the brain lubricated.


When I was introduced to object programming, my reaction was "Where the ## was this, when we were wasting time with line numbers and GOTO??"
edit on 23-4-2021 by gb540 because: (no reason given)



posted on Apr, 23 2021 @ 06:04 PM
link   
a reply to: ThatDamnDuckAgain

It's not just a question of quoting, quote my post and look at the differences between what is written and what appears in the post.



posted on Apr, 23 2021 @ 07:00 PM
link   
a reply to: gb540

Hey come on, you can program anything you need as long as you've mastered if/else and goto. Anything else is just training wheels.

Even Assembly's just a crutch, you should be able to just write raw machine code in a hex editor. If you can't do that, might as well not even call yourself a programmer.



posted on Apr, 23 2021 @ 10:02 PM
link   
a reply to: Midnite247


I don’t think this is the right forum to regurgitate beginner learning ( whatever the subject) as some sort of informative thread! ,otherwise I’ll start one next with basic multiplication

Except this isn't particularly what I would call "beginner level", it's a bit more complicated than it needs to be, but I did that for an important reason... I could have easily just said "this an int, it holds whole numbers, a float holds decimals, a bool holds true or false", but that isn't the point of this thread. The point is to properly explain what the variables really are on a bit level, especially in languages like JavaScript which don't make it clear what the variable types are. Understanding these core concepts at an early stage provides a very strong foundation for later learning, and I rarely see explanations of how variables really work, what conversions will take place between them, etc. For a long time I wrote code without properly understanding these concepts but learning C++ basically forced me to learn them.
edit on 23/4/2021 by ChaoticOrder because: (no reason given)



posted on Apr, 23 2021 @ 10:09 PM
link   
a reply to: dug88


Apart from it being easy to find information, my main problem with this thread is that it's actually pretty offputting for beginners and if they were already intimidated by coding, this is going to make it worse.

It doesn't really explain anything other than how c++ represents some types and for some reason bitwise operators without even explaining what a statement is, why you need to know these things or even what programming is.

Dumping everything about signed and unsigned integers, the difference between floats and doubles and a whole bunch of other things that aren't actually helpful for someone who's a complete beginner.

I do realize it's a bit of a strange approach to present such complex ideas before other more simple concepts, but there is a method to my madness. Once I get to if statements, loops, etc, in my next thread it will be much easier to explain some complex ideas and I wont have to backtrack and explain what the variables are really doing. This is essentially the way I wish I could have learned to program if I could go back and start again. It might seem intimidating at first but once you understand these basic concepts about variables it will provide the framework for writing efficient bug free code that does exactly what you want it to do.



posted on Apr, 23 2021 @ 10:40 PM
link   

originally posted by: Encia22
a reply to: ChaoticOrder

Finally, just so I can gauge what we can expect, how deep do you think you'll take us before letting go of our hands to fend for ourselves?

Well I've followed a lot of coding tutorial series over the years and I know how complex they can get, so I don't plan to get super deep, and I don't really have the time for it. There will probably be another 2 or 3 parts to explain functions, loops, classes, etc.

For anyone who may want to continue learning C++ I would highly suggest the C++ tutorials from TheCherno and for those more daring people who want to learn assembly, a great channel I recently discovered called Creel has a Modern x64 Assembly tutorial series.

He also has a lot of other really interesting videos relating to programming in general (usually fairly advanced concepts), here's a few of the ones which I found highly informative:





edit on 23/4/2021 by ChaoticOrder because: (no reason given)



posted on Apr, 24 2021 @ 02:04 AM
link   
a reply to: ChaoticOrder

Honestly, I wish I'd known all the things you talk about in your thread when i first learned to program, but i didn't learn those things until i decided i wanted to get into hacking SNES ROMs, then i tried to learn 65816 assembly from guides i found here en.m.wikibooks.org...

and then decided # that so i wrote my own assembly language and 16-bit virtual machine and learned all the stuff you talked about in your op.

I'm not a professional programmer and mostly self taught, but, by the time i did that I'd already written i dunno how many silly little one file programs in a bunch of different languages, I'd gotten comfortable with lua, D most of the common webstack, bash, and I'd played around with Perl, c, java and a ton of other languages. I'd written a small game engine, a couple of mini roguelikes, a basic platformer engine with collision and stuff, a graphical remote for a roku, i dunno a bunch of other #, then i learned those basic things about memory addressing, pointers, the layout of variables in memory.

None of that stuff was fundamental to my learning how algorithms function by manipulating data. Which is number one basic thing that programming is.

I as a programmer I am telling a computer things it's supposed to do with data i define using the abstractions my particular language gives me.

Nowhere in your post did you explain that. As a complete noob who literally doesn't understand even what programming or memory is, you need to start at the absolute beginning.

Pretend they understand nothing and just want to learn how to make computers do what they tell them to, because that's all programming is.

Using words to tell a computer to make cool #.
edit on 24/4/2021 by dug88 because: (no reason given)



posted on Apr, 24 2021 @ 06:52 AM
link   
a reply to: dug88

I still remember a couple of the Z80's opcodes from almost 40 years ago.



posted on Apr, 24 2021 @ 07:00 AM
link   
a reply to: dug88

That's one problem I see with most programming courses, they teach how to program in one or two specific languages instead of doing the most difficult part, teach how to convert real world situations into data, work with that data and present the results back to the real world.



posted on Apr, 24 2021 @ 08:01 AM
link   
Would you say it is best to first learn the abstracts? I ask because I am beginner and before I even read into the first lessons, I tried to get an overview what is what. Easy stuff like variables I already am familiar from math. For while if do and all the basics. Terminology and such.

Once I understood the object oriented programming style, solutions were easy to find. Searching for examples to understand showed up a lot of markup is the same for others.

Now I can write code for an arduino that converts sensor signals to BUS packets and also logs to SD cards. But it's a bit patched together, I want to be fit enough to come up with my own solution so I can integrate fallback methods, interupts and such. I need to process a lot of real time data and some of it needs to be critical fast. For that I think I need to leverage all knowledge and really go donw to the basics.

Are there any websites recommend or even a good book? I am at the level of forging own delegates and design my own objects but I have troubles with multithreading or tasking how it's called now. Locking objects and such I can do and I looked into race conditions, but it all feels a bit dirty. I keep threads in IEnumberable List, not sure if that's a death sin but it works for me.



posted on Apr, 27 2021 @ 10:50 PM
link   
a reply to: ThatDamnDuckAgain


Would you say it is best to first learn the abstracts?

I would say the best way to start is by actually writing code. You can start by reading or watching a few beginner guides, but there's no point learning abstract or high level concepts until you have the basic groundwork in place, and that only comes from practice. It will involve a lot of Google searches to learn how things work and to fix bugs, but that process helps you remember how to do it in the future.


Are there any websites recommend or even a good book? I am at the level of forging own delegates and design my own objects but I have troubles with multithreading or tasking how it's called now.

As I said earlier TheCherno has a lot of good C++ tutorials. Not sure if he has much about multi-threading and I've only written multi-threaded code a few times myself. Just look up tutorials on how to properly use std::thread and std::atomic. I'm guessing the issue with your code has something to do with the threading, you can use atomic variables to prevent data race conditions.



posted on Oct, 17 2022 @ 03:58 AM
link   
Hey, thanks for sharing this informative thread. Can you help me with this problem?
How would you describe JavaScript closures to someone who understands the ideas they are made up of (for example, functions, variables, and so on), but not the closures themselves?
I saw the Scheme example on wikipedia, but it was ineffective for me.
Thanks in advance!



posted on Oct, 18 2022 @ 01:53 AM
link   
a reply to: ChaoticOrder
Also, when I found out why multiple inheritance was not included in Java, the reasons given were to maintain simplicity and reduce complication.' However, working in a Java environment after coming from a C++ background, as well as the interface concept to support multiple inheritance, has complicated rather than solved the problem.




top topics



 
13
<< 1   >>

log in

join