Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411430 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 09:04:02 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)General programming discussion
Pages: 1 ... 11 12 [13] 14 15 16
Print
Author Topic: General programming discussion  (Read 29192 times)
Ordnas
Level 10
*****



View Profile WWW
« Reply #240 on: January 09, 2018, 01:02:21 AM »

"The idea with C++ and classes is that you have essentially only 3 states if possible, uninitialized/not yet constructed (more of a pseudo/virtual state as the object doesn't exist yet), valid, destructed."

I am not even sure if we can can define a class has having a state, because a class is just a definition of a type, and state is something related to an object.
Logged

Games:

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #241 on: January 17, 2018, 10:26:55 AM »

Timmy you might be interested in this.

Some people made a bi-directional visual/textual programming language

http://www.luna-lang.org/#Features
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #242 on: January 17, 2018, 03:31:46 PM »

Interesting, will look at it, I have beef with current visual language in that they don't necessarily solve the right problem, let see if it's different, also text base coding could be better with better IDE paragdim, I question more and more keyword highlighting, seems like a good idea from the beginning (tells us which keywords are reserved) but in the end we need more explicit highlighting (ex: highlight, bases on basic type every variable; for example if you declare a string, the variable is forever highlighted green to denote string type, etc...). We move the complexity of the ide to the  complexity of naming convention which is a hack of the use of identifier to expose hidden information.
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #243 on: January 17, 2018, 07:40:06 PM »


Have you tried emacs? If the functionality you are looking for isn't there or a addon package you can add it to your config.


Also I think there might be a visual studio addon for type-coloring. I seem to recall a co-worker telling me about that the other day.

EDIT : I googled it but I couldn't find exactly what you were describing. This was all I could find : https://marketplace.visualstudio.com/items?itemName=AndreasReischuck.SemanticColorizer
Logged

bateleur
Level 10
*****



View Profile
« Reply #244 on: January 17, 2018, 11:51:06 PM »

Have you tried emacs? If the functionality you are looking for isn't there or a addon package you can add it to your config.

Technically this is true, but it's actually quite a tricky task to write colouring systems in emacs unless they're compatible with font-lock or one of the other built-in colouring frameworks. I use a custom colouring system much simpler than what Timmy wants and it took a surprisingly long time to make it work.
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #245 on: January 18, 2018, 08:01:20 AM »

Have you tried emacs? If the functionality you are looking for isn't there or a addon package you can add it to your config.

Technically this is true, but it's actually quite a tricky task to write colouring systems in emacs unless they're compatible with font-lock or one of the other built-in colouring frameworks. I use a custom colouring system much simpler than what Timmy wants and it took a surprisingly long time to make it work.

I guess it's only easy (easier) to do for languages where you have access to the AST? Or at least be able to tell the type of a particular symbol.

It's kind of an interesting problem after you figure out the types. Given n types in a file, how do you give them each a color so you can tell them apart the easiest?

What kind of system are you using?
Logged

oahda
Level 10
*****



View Profile
« Reply #246 on: January 18, 2018, 08:04:30 AM »

also how many distinctive colours do you have left after colouring the keywords and literals etc
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #247 on: January 18, 2018, 09:19:11 AM »

Looking at my C# settings now. It actually looks like I have a ton of distinctive colors left. I'd say at least 15.

Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #248 on: January 18, 2018, 03:02:25 PM »

Also colors is not the only styling you can use, you can highlight keywords with bold or italics or changing the font type, ie apply basic graphic design instead of stonehedge convention.
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #249 on: January 18, 2018, 03:55:04 PM »

I'd be weary of changing the font type but I'm ok with changing the emphasis etc..

EDIT : Maybe as long as the font is monospaced it might be ok....
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #250 on: January 18, 2018, 04:50:31 PM »

It's because you have never seen a properly design code lay out by an actual designer, because designer are graphic people with allergy to code, only seeing it as a necessary evil to hide.
Logged

Crimsontide
Level 5
*****


View Profile
« Reply #251 on: January 18, 2018, 08:44:55 PM »

It's because you have never seen a properly design code lay out by an actual designer, because designer are graphic people with allergy to code, only seeing it as a necessary evil to hide.

Ya, I'd pay money for a professionally designed color/syntax highlighting.  Even without all the cool additions mentioned above.
Logged
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #252 on: January 18, 2018, 09:05:18 PM »

It's because you have never seen a properly design code lay out by an actual designer, because designer are graphic people with allergy to code, only seeing it as a necessary evil to hide.

Can you show me an example? That would help out a lot. I have trouble seeing a design that uses non-monospaced fonts mixed together being easier to comprehend.

I'm with you on the idea of taking more advantage of the color spectrum and fonts at a monospaced level but I can't picture a non-monospaced layout that is easier to comprehend.

For what it's worth. I spent almost 15 years of my life in the arts and design before going back to school for programming/math. I'm not saying I know much of anything in regards to art/design but I wanted to say that people can be both interested in design and code. Also programmers can understand UX and the advantages of better layout/design. That's precisely why we're having this conversation.

It's because you have never seen a properly design code lay out by an actual designer, because designer are graphic people with allergy to code, only seeing it as a necessary evil to hide.

Ya, I'd pay money for a professionally designed color/syntax highlighting.  Even without all the cool additions mentioned above.

EDIT : I feel like that must exist for some of the higher level languages considering the designer/programmer mesh at that level. Also companies like JetBrains highers those types of designers for exactly that purpose.
« Last Edit: January 18, 2018, 10:47:10 PM by InfiniteStateMachine » Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #253 on: January 19, 2018, 12:27:22 AM »

I mean it hasn't be done has no one seems to think about it, at best you have an overall fonts for all the code, but never a style guide like we have for books (brb googling to be sure) nope find no evidence of that, and by that I mean I complete rethink of how we visually see code (what to put emphasis on and why), not aesthetics variation of the same tropes.

In general there is some define school of thought:
- Text is bad we will rethink code around visual element like block or diagram to make accessible and approachable
- code is fine, we will just choose a better set of color and fonts to theme your IDE
- text is fine but current presentation is ugly verbose and a sore to the eyes(ex c++ brackets), let's design a new cleaner language (ex ruby)

The problem is that we don't think outside these model at all, and they seems to address to many things at once while ignoring so many other, there is no cross analysis, it's either all or nothing. For example moving away form text paradigm seems to not learn from the strength and weakness of that format, they identify one major problem and then toss away everything to start from scratch on a new paradigm that is presented as a silver bullet, it's visual therefore it's better and accessible, without a deep analysis of that assumption and of the many problem inherent to coding itself.

My take is that there should be a comparative analysis base on identifying the problem of each without necessary tossing everything, acknowledging what works and why and translating into a solution that address all parts.

For example most visual implementation are based on a data flow model, which is great to see what "become" what and track dependency but it generally become a visual mess, also data element get mixed with command element and it's hard to separate both because most of them don't have a visual emphasis in the difference (at best data link is colored and command link is monochrome, even though the block themselves are all look alike), also despite being visual, they have weak representation of actual important command flow like loop, and finally they don't take advantage of the tree structure to perform alternate view of particular structure (for example following the influence of a single variable).

Text paradigm on the other side, seems to emphasize things that are not actually useful past a certain level, I mean highlighting keyword is nice and all, but I care about what's what more than what keyword I already know does, especially when the syntax structure already give the relevant info, I know it's a type because the identifier is last, position is already an information. And the root of all evil is the said identifier, I understand it's a human readable key to uniquely identify a value, but god we hacked it to do much more to compensate. Not only that using identifier obfuscate data flow big time.

Visual design translated in text is basically Output = Node(node(),node(), [inputs...]); it's tedious to read and write (people hated lisp, and also why it's hard to generate readable code with visual language, though that should be fixable on the visual side by ACTUALLY ALLOWING NAMING THE LINKS), so we create generally little link with temporary variables like String Link = Playername(); Output = Node(Link); to make more visible, but it open the possibility to reuse the identifier Link after the data as been process once, which don't happen in visual data flow format, and that mean the same identifier can actually represent very different things, obfuscating the behavior of the code, not only that, it can teleport data across the code base without proper visibility of dependency , which make tracking bug hard, it can even hold and inject obsolete data when the code is modified, creating hard to find bugs. They are great on a local view of data but link in visual language are better for overall view and analysis (they are already parsed tree).

One key problem in visual language is to combine command flow and data flow in a way where "expression" are actually readable and not weird floating tree, I mean "health + 1 + score / stamina"  shouldn't be these spaghetti monster that scared text code apologist high priest into damning the whole paradigm.

Code need a rethink




Edit note:
The funny things is that language "presentation" is often confuse with language "paradigm", when I say "all or nothing", when they change one of this, they also change the other, python is cleaner (presentation) but also typeless (paradigm). It's always the case, for example I believe it's possible to make a c# language look like python by using just a syntax conversion, not touching anything else, it would create regular c# text then it is compile as usual. But no currently you have to go python OR c# OR javascript, and these brackets and semi colon are getting on my nerves Sad
« Last Edit: January 19, 2018, 12:33:31 AM by gimymblert » Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #254 on: January 19, 2018, 08:18:58 AM »

That's a lot to process, I have a few notes but will have to think about it more in general.

Wow that's a lot to process but I do have a few notes :



Visual design translated in text is basically Output = Node(node(),node(), [inputs...]); it's tedious to read and write (people hated lisp, and also why it's hard to generate readable code with visual language, though that should be fixable on the visual side by ACTUALLY ALLOWING NAMING THE LINKS), so we create generally little link with temporary variables like String Link = Playername(); Output = Node(Link); to make more visible, but it open the possibility to reuse the identifier Link after the data as been process once, which don't happen in visual data flow format, and that mean the same identifier can actually represent very different things, obfuscating the behavior of the code, not only that, it can teleport data across the code base without proper visibility of dependency , which make tracking bug hard, it can even hold and inject obsolete data when the code is modified, creating hard to find bugs. They are great on a local view of data but link in visual language are better for overall view and analysis (they are already parsed tree).

One key problem in visual language is to combine command flow and data flow in a way where "expression" are actually readable and not weird floating tree, I mean "health + 1 + score / stamina"  shouldn't be these spaghetti monster that scared text code apologist high priest into damning the whole paradigm.


I agree, one of the worst parts of visual languages is how they represent expressions.





Edit note:
The funny things is that language "presentation" is often confuse with language "paradigm", when I say "all or nothing", when they change one of this, they also change the other, python is cleaner (presentation) but also typeless (paradigm). It's always the case, for example I believe it's possible to make a c# language look like python by using just a syntax conversion, not touching anything else, it would create regular c# text then it is compile as usual. But no currently you have to go python OR c# OR javascript, and these brackets and semi colon are getting on my nerves Sad

You are pretty much describing F#. It even uses the same standard library as c# and generates the same output (MSIL). It also has a much more robust and thought out type system than the C#/c++ languages.

On top of that it addresses your issues where Link can have multiple meanings at different time because F# is an immutable language and won't allow rebinding to a symbol once it's declared (you must bind at declaration time).

https://fsharpforfunandprofit.com/

EDIT : I should mention that f# is part of a family/type of language called ML. OTher languages in that family include Ocaml, Miranda and Haskell.




Was going to post more but I have to go to work Sad

Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #255 on: January 19, 2018, 11:24:01 AM »

When I say they can have multiple meaning it's not because you are not rebinding it but because you use the same type of data but which has different meaning, like passing health to a variable and reusing it later to pass ammo because why not? That's a caricature example, but it's not uncommon to have the same variable hold temporary data before finally having it's true meaning realize, like for an easy example in a NN you store the sum of all weighted inputs before storing the activation of these same input in the same variable, it can become more complex and obscure in some complex works with iterated code.
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #256 on: January 19, 2018, 12:56:17 PM »

When I say they can have multiple meaning it's not because you are not rebinding it but because you use the same type of data but which has different meaning, like passing health to a variable and reusing it later to pass ammo because why not? That's a caricature example, but it's not uncommon to have the same variable hold temporary data before finally having it's true meaning realize, like for an easy example in a NN you store the sum of all weighted inputs before storing the activation of these same input in the same variable, it can become more complex and obscure in some complex works with iterated code.

Ah yes I see. F# is built to strongly discourage that type of coding. The general pattern would be do to something like

type Health of int

From there it becomes an error to try to mix Health and int in an expression. The difference between F# and C++ typedefs is that this will show up as a compile time error (edit : the reason is because Health is a completely different type, not an alias for int).

This is one of the reasons these ML types languages are popular in the sciences where you want to represent various units of measurement.
« Last Edit: January 19, 2018, 01:19:36 PM by InfiniteStateMachine » Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #257 on: March 01, 2018, 12:40:50 PM »

[quoteSaqib Shaikh, a developer who happens to be blind, shows how he uses Visual Studio 2017 with screen reader software for writing and debugging code. From the Microsoft Build 2017 conference, which took place May 10th-12th 2017 in Seattle.][/quote]



How a Blind Developer uses Visual Studio

Logged

oahda
Level 10
*****



View Profile
« Reply #258 on: March 01, 2018, 02:19:08 PM »

That was great! People have been recently voting up accessibility request for Unity so would be great to have some more votes: https://feedback.unity3d.com/suggestions/screen-reader-accessibility
Logged

DireLogomachist
Level 4
****



View Profile
« Reply #259 on: March 30, 2018, 10:46:43 PM »

Ok so I'm messing around with GameMaker Studio 2, and I'm kinda stuck. There's a few features I'm missing from Unity and a bunch of basic programming stuff as well but mostly I can make it work just fine.

But how do you reference object instances within other object instances from the room editor?
Like if I want complex interacting objects set before run-time, then uh how can I do that?

You make an object variable, set it to a resource type, and then you're stuck cause you can only select from base object types. Anyone know how to make this work, preferably in a way that can be done quickly and painlessly?
Logged


Living and dying by Hanlon's Razor
Pages: 1 ... 11 12 [13] 14 15 16
Print
Jump to:  

Theme orange-lt created by panic